Index: /CKEditor/branches/features/bbcode/CHANGES.html
===================================================================
--- /CKEditor/branches/features/bbcode/CHANGES.html	(revision 6780)
+++ /CKEditor/branches/features/bbcode/CHANGES.html	(revision 6781)
@@ -1,3 +1,3 @@
-﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+﻿﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <!--
 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
@@ -36,33 +36,90 @@
 	</h1>
 	<h3>
-			CKEditor 3.5.3 (SVN)</h3>
+			CKEditor 3.5.4 (SVN)</h3>
 	<p>
 			New features:</p>
 	<ul>
+		<li></li>
+	</ul>
+	<p>
+			Fixed issues:</p>
+	<ul>
+		<li><a href="http://dev.ckeditor.com/ticket/7347">#7347</a> : The ENTER key will not any more be caught by the dialog cover element.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6718">#6718</a> : Paste from word command dominates over force paste as plain text configuration.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6629">#6629</a> : Padding body is not anymore needed when last block is pre-formatted.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/4844">#4844</a> : IE: dialogs fail to load if there are too many editors in the page.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/5788">#5788</a> : Html parser trims empty spaces following &lt;br&gt; elements.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7513">#7513</a> : Invalid markup could lead the editor to hang.</li>
+	</ul>
+	<h3>
+			CKEditor 3.5.3</h3>
+	<p>
+			New features:</p>
+	<ul>
 		<li><a href="http://dev.ckeditor.com/ticket/4890">#4890</a> : Added the possibility to edit the <code>rel</code> attribute for links.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/7004">#7004</a> : Allow loading plugin translations even if they aren't present in the plugin definition.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7004">#7004</a> : Allow loading plugin translations even if they are not present in the plugin definition.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7315">#7315</a> : Firing the <code>resize</code> event on dialog window instances is now possible.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7259">#7259</a> : Dialog window definition allows to specify initial <code>width</code> and <code>height</code> values.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7131">#7131</a> : List item numbering is now supported on pasting from Microsoft Word.</li>
 	</ul>
 	<p>
 			Fixed issues:</p>
 	<ul>
-		<li><a href="http://dev.ckeditor.com/ticket/1272">#1272</a> : It's now possible to apply styles to collapsed selections on Safari and Chrome (WebKit).</li>
-		<li><a href="http://dev.ckeditor.com/ticket/7054">#7054</a> : Special characters' tooltips are now lowercased, making them more readable.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/7102">#7102</a> : "Replacing Div" sample didn't work when double clicking inside of formatted text.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/7088">#7088</a> : Loading of plugins failed on new instances of the editor after special character dialog has been used.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/1272">#1272</a> : [WebKit] It is now possible to apply styles to collapsed selections in Safari and Chrome.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7054">#7054</a> : The tooltips for special characters are now lowercased, making them more readable.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7102">#7102</a> : "Replace DIV" sample did not work when double-clicking inside the formatted text.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7088">#7088</a> : Loading of plugins failed on new instances of the editor after the Insert Special Character dialog window was used.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/6215">#6215</a> : Removal of inline styles now also removes overrides.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/6144">#6144</a> : Rich combos have wrong height when toolbar is wrapped.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/6387">#6387</a> : AutoGrow may cause an error when editor instance is destroyed too quickly after height change.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/6901">#6901</a> : Mixed direction content was not properly respected on a shared toolbar.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/4809">#4809</a> : Table related tags are outputted in wrong order.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/7092">#7092</a> : Corrupted toolbar button state for inline style after switch to source.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/6921">#6921</a> : Pasted text marked by SCAYT in one language is not re-checked if another spellchecking language is selected in editor.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/6671">#6671</a> : combo drop down list selected item not refreshed .</li>
-		<li><a href="http://dev.ckeditor.com/ticket/6614">#6614</a> : Resize handler in RTL enhancement.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/5924">#5924</a> : Flash plugin now recognizes flash contents without an <code>embed</code> tag.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/4475">#4475</a> : Protected source in attributes and inline CSS text are not handled.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/6984">#6984</a> : [FF] Tailing line breaks are lost in enter mode BR.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/6987">#6987</a> : [IE] Text selection lost when calling editor::insertHtml from dialog in some situation.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/6865">#6865</a> : BiDi mirroring doesn't work when a text direction change is done through dialog.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/6966">#6966</a> : [IE] Unintended paragraph is created on empty document in enter mode BR and DIV.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6144">#6144</a> : Rich text drop-down lists have wrong height when toolbar is wrapped.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6387">#6387</a> : AutoGrow may cause an error when editor instance is destroyed too quickly after a height change.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6901">#6901</a> : Mixed direction content was not properly respected in a shared toolbar setting.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/4809">#4809</a> : Table-related tags are output in wrong order.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7092">#7092</a> : Corrupted toolbar button state for inline style after switching to Source.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6921">#6921</a> : Pasted text marked by SCAYT in one language is not re-checked if another spellchecking language is selected in the editor.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6614">#6614</a> : Enhancement of the resize handle in RTL.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/5924">#5924</a> : Flash plugin now recognizes Flash content without an <code>embed</code> tag.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/4475">#4475</a> : Protected source in attributes and inline CSS text is not handled correctly.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6984">#6984</a> : [FF] Trailing line breaks are lost in <code>ENTER_BR</code>.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6987">#6987</a> : [IE] Text selection lost when calling <code>editor::insertHtml</code> from a dialog window in some situations.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6865">#6865</a> : BiDi mirroring does not work when a text direction change is done through a dialog window.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6966">#6966</a> : [IE] Unintended paragraph is created in an empty document in <code>enterMode</code> set for <code>BR</code> and <code>DIV</code>.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7084">#7084</a> : SCAYT dialog window is now working properly with more than one editor instance in a page.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6662">#6662</a> : [FF] List structure pasting error caused by a regression from FF3.5.x is now fixed.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7300">#7300</a> : Link dialog window now loads numeric values correctly.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7330">#7330</a> : New list items no longer inherit the <code>value</code> attribute from their sibling.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7293">#7293</a> : The "Automatic" color button is now presented correctly without focus inside the editor.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7018">#7018</a> : [IE] Toolbar drop-down lists did not have a border around them.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7073">#7073</a> : Image dialog window no longer allows zero height and width value to be entered.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7316">#7316</a> : [FF] Clicking on "Paste" button incorrectly breaks the line at the cursor position.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6751">#6751</a> : Inline whitespaces are incorrectly stripped when pasting from Word.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6236">#6236</a> : [IE] Fixing malformed nested list structure which was introduced by the <em>Backspace</em> key.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6649">#6649</a> : [IE] Selection of the full table sometimes does not work.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6946">#6946</a> : HTML parser is now able to fix orphan list items.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6861">#6861</a> : Indenting a list item should retain the text direction.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6938">#6938</a> : Outdenting a list item should retain the text direction.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6849">#6849</a> : Correct <em>Enter</em> key behavior on list item.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7113">#7113</a> : [WebKit] Undesired document scroll on click after scrolling.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6491">#6491</a> : Undesired Image dialog window dimension lock reset on URL change.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7284">#7284</a> : [FF Quirks] Maximize now works correctly.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6609">#6609</a> : [IE9] Browser in high contrast mode is not properly detected.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7222">#7222</a> : [WebKit] Impossible to apply a single style to a collapsed selection without giving the editor focus.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7180">#7180</a> : [IE9] When using Kama skin and RTL layout dialog window buttons were not being displayed correctly.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7182">#7182</a> : [IE9] When using Office2003/v2 skin and RTL layout dialog window shadows were corrupted.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6913">#6913</a> : Invalid escape sequence (<code>\b</code>) was used in the PHP integration.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/5757">#5757</a> : [IE6] Text was not wrapping in the accessibility instructions dialog window.</li>
+		<li><a href="http://dev.ckeditor.com/changeset/6604">[6604]</a> : <code>Xml.js</code> and <code>Ajax.js</code> are now available as plugins ('xml' and 'ajax').</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7304">#7304</a> : Microsoft Word cleanup function is not always invoked when clicking on the "Paste From Word" button.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6658">#6658</a> : [IE] Pasting text from Microsoft Word with one or more tabs between list items was failing.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7433">#7433</a> : [IE9] <code>ENTER_BR</code> at the end of a block breaks due to an IE9 regression.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7432">#7432</a> : [WebKit] Unable to create a new list in an empty document.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/4880">#4880</a> : CKEditor changes tag style inside HTML comment with <code>cke_protected</code>.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7023">#7023</a> : [IE] JavaScript error when a Selection Field is inserted into a page.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7034">#7034</a> : Inserting special characters into styled text.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7132">#7132</a> : Paste toolbar buttons are becoming disabled.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7138">#7138</a> : The <code>api.html</code> sample in Opera does not work as expected.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7160">#7160</a> : Cannot paste the form element on top of the page.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7171">#7171</a> : Double-clicking an image in non-editable content opens the editing dialog window.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7455">#7455</a> : Extra line break is added automatically to the preformatted element.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7467">#7467</a> : [Firefox] Extra <code>br</code> element is added in a nested list.</li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.ckeditor.com/ticket/7124">#7124</a> : Czech;</li>
@@ -76,4 +133,6 @@
 			<li>Hebrew;</li>
 			<li>Spanish;</li>
+			<li>Polish;</li>
+			<li>German;</li>
 		</ul></li>
 	</ul>
Index: /CKEditor/branches/features/bbcode/_dev/docs_build/template/static/default.css
===================================================================
--- /CKEditor/branches/features/bbcode/_dev/docs_build/template/static/default.css	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_dev/docs_build/template/static/default.css	(revision 6781)
Index: /CKEditor/branches/features/bbcode/_dev/releaser/release.bat
===================================================================
--- /CKEditor/branches/features/bbcode/_dev/releaser/release.bat	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_dev/releaser/release.bat	(revision 6781)
@@ -11,3 +11,3 @@
 :: rmdir /S /Q release
 
-java -jar ckreleaser/ckreleaser.jar ckreleaser.release ../.. release "3.5.3 (SVN)" ckeditor_3.5.3_svn --run-before-release=langtool.bat
+java -jar ckreleaser/ckreleaser.jar ckreleaser.release ../.. release "3.5.4 (SVN)" ckeditor_3.5.4_svn --run-before-release=langtool.bat
Index: /CKEditor/branches/features/bbcode/_dev/releaser/release.sh
===================================================================
--- /CKEditor/branches/features/bbcode/_dev/releaser/release.sh	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_dev/releaser/release.sh	(revision 6781)
@@ -13,4 +13,4 @@
 
 pushd $DIR
-java -jar ckreleaser/ckreleaser.jar ckreleaser.release ../.. release "3.5.3 (SVN)" ckeditor_3.5.3_svn --run-before-release=$LANGTOOL
+java -jar ckreleaser/ckreleaser.jar ckreleaser.release ../.. release "3.5.4 (SVN)" ckeditor_3.5.4_svn --run-before-release=$LANGTOOL
 popd
Index: /CKEditor/branches/features/bbcode/_samples/ajax.html
===================================================================
--- /CKEditor/branches/features/bbcode/_samples/ajax.html	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_samples/ajax.html	(revision 6781)
@@ -18,5 +18,5 @@
 	//<![CDATA[
 
-var editor;
+var editor, html = '';
 
 function createEditor()
@@ -25,5 +25,4 @@
 		return;
 
-	var html = document.getElementById( 'editorcontents' ).innerHTML;
 
 	// Create a new editor inside the <div id="editor">, setting its value to html
@@ -39,5 +38,5 @@
 	// Retrieve the editor contents. In an Ajax application, this data would be
 	// sent to the server or used in any other way.
-	document.getElementById( 'editorcontents' ).innerHTML = editor.getData();
+	document.getElementById( 'editorcontents' ).innerHTML = html = editor.getData();
 	document.getElementById( 'contents' ).style.display = '';
 
Index: /CKEditor/branches/features/bbcode/_samples/divreplace.html
===================================================================
--- /CKEditor/branches/features/bbcode/_samples/divreplace.html	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_samples/divreplace.html	(revision 6781)
@@ -59,5 +59,5 @@
 	}
 	while ( element && ( name = element.nodeName.toLowerCase() ) && ( name != 'div' || element.className.indexOf( 'editable' ) == -1 ) && name != 'body' )
-	
+
 
 	if ( name == 'div' && element.className.indexOf( 'editable' ) != -1 )
Index: /CKEditor/branches/features/bbcode/_samples/output_html.html
===================================================================
--- /CKEditor/branches/features/bbcode/_samples/output_html.html	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_samples/output_html.html	(revision 6781)
@@ -118,6 +118,5 @@
 							{
 								element : 'font',
-								attributes : { 'color' : '#(color)' },
-								overrides	: [ { element : 'span', attributes : { 'class' : /^FontColor(?:1|2|3)$/ } } ]
+								attributes : { 'color' : '#(color)' }
 							},
 
Index: /CKEditor/branches/features/bbcode/_source/adapters/jquery.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/adapters/jquery.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/adapters/jquery.js	(revision 6781)
@@ -47,5 +47,5 @@
 	 * @example
 	 * // ... then later in the code ...
-	 * 
+	 *
 	 * $( 'textarea' ).ckeditor();
 	 * // ...
Index: /CKEditor/branches/features/bbcode/_source/core/_bootstrap.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/core/_bootstrap.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/core/_bootstrap.js	(revision 6781)
@@ -17,17 +17,8 @@
 	}
 
-	// Check is High Contrast is active by creating a temporary element with a
-	// background image.
-
-	var useSpacer = CKEDITOR.env.ie && CKEDITOR.env.version < 7,
-		useBlank = CKEDITOR.env.ie && CKEDITOR.env.version == 7;
-
-	var backgroundImageUrl = useSpacer ? ( CKEDITOR.basePath + 'images/spacer.gif' ) :
-							 useBlank ? 'about:blank' : 'data:image/png;base64,';
-
+	// Check whether high contrast is active by creating a colored border.
 	var hcDetect = CKEDITOR.dom.element.createFromHtml(
-		'<div style="width:0px;height:0px;' +
-			'position:absolute;left:-10000px;' +
-			'background-image:url(' + backgroundImageUrl + ')"></div>', CKEDITOR.document );
+		'<div style="width:0px;height:0px;position:absolute;left:-10000px;' +
+			'border: 1px solid;border-color: red blue;"></div>', CKEDITOR.document );
 
 	hcDetect.appendTo( CKEDITOR.document.getHead() );
@@ -37,5 +28,5 @@
 	try
 	{
-		CKEDITOR.env.hc = ( hcDetect.getComputedStyle( 'background-image' ) == 'none' );
+		CKEDITOR.env.hc = hcDetect.getComputedStyle( 'border-top-color' ) == hcDetect.getComputedStyle( 'border-right-color' );
 	}
 	catch (e)
Index: Editor/branches/features/bbcode/_source/core/ajax.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/core/ajax.js	(revision 6780)
+++ 	(revision )
@@ -1,142 +1,0 @@
-﻿/*
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
-
-/**
- * @fileOverview Defines the {@link CKEDITOR.ajax} object, which holds ajax methods for
- *		data loading.
- */
-
-/**
- * @namespace Ajax methods for data loading.
- * @example
- */
-CKEDITOR.ajax = (function()
-{
-	var createXMLHttpRequest = function()
-	{
-		// In IE, using the native XMLHttpRequest for local files may throw
-		// "Access is Denied" errors.
-		if ( !CKEDITOR.env.ie || location.protocol != 'file:' )
-			try { return new XMLHttpRequest(); } catch(e) {}
-
-		try { return new ActiveXObject( 'Msxml2.XMLHTTP' ); } catch (e) {}
-		try { return new ActiveXObject( 'Microsoft.XMLHTTP' ); } catch (e) {}
-
-		return null;
-	};
-
-	var checkStatus = function( xhr )
-	{
-		// HTTP Status Codes:
-		//	 2xx : Success
-		//	 304 : Not Modified
-		//	   0 : Returned when running locally (file://)
-		//	1223 : IE may change 204 to 1223 (see http://dev.jquery.com/ticket/1450)
-
-		return ( xhr.readyState == 4 &&
-				(	( xhr.status >= 200 && xhr.status < 300 ) ||
-					xhr.status == 304 ||
-					xhr.status === 0 ||
-					xhr.status == 1223 ) );
-	};
-
-	var getResponseText = function( xhr )
-	{
-		if ( checkStatus( xhr ) )
-			return xhr.responseText;
-		return null;
-	};
-
-	var getResponseXml = function( xhr )
-	{
-		if ( checkStatus( xhr ) )
-		{
-			var xml = xhr.responseXML;
-			return new CKEDITOR.xml( xml && xml.firstChild ? xml : xhr.responseText );
-		}
-		return null;
-	};
-
-	var load = function( url, callback, getResponseFn )
-	{
-		var async = !!callback;
-
-		var xhr = createXMLHttpRequest();
-
-		if ( !xhr )
-			return null;
-
-		xhr.open( 'GET', url, async );
-
-		if ( async )
-		{
-			// TODO: perform leak checks on this closure.
-			/** @ignore */
-			xhr.onreadystatechange = function()
-			{
-				if ( xhr.readyState == 4 )
-				{
-					callback( getResponseFn( xhr ) );
-					xhr = null;
-				}
-			};
-		}
-
-		xhr.send(null);
-
-		return async ? '' : getResponseFn( xhr );
-	};
-
-	return 	/** @lends CKEDITOR.ajax */ {
-
-		/**
-		 * Loads data from an URL as plain text.
-		 * @param {String} url The URL from which load data.
-		 * @param {Function} [callback] A callback function to be called on
-		 *		data load. If not provided, the data will be loaded
-		 *		asynchronously, passing the data value the function on load.
-		 * @returns {String} The loaded data. For asynchronous requests, an
-		 *		empty string. For invalid requests, null.
-		 * @example
-		 * // Load data synchronously.
-		 * var data = CKEDITOR.ajax.load( 'somedata.txt' );
-		 * alert( data );
-		 * @example
-		 * // Load data asynchronously.
-		 * var data = CKEDITOR.ajax.load( 'somedata.txt', function( data )
-		 *     {
-		 *         alert( data );
-		 *     } );
-		 */
-		load : function( url, callback )
-		{
-			return load( url, callback, getResponseText );
-		},
-
-		/**
-		 * Loads data from an URL as XML.
-		 * @param {String} url The URL from which load data.
-		 * @param {Function} [callback] A callback function to be called on
-		 *		data load. If not provided, the data will be loaded
-		 *		asynchronously, passing the data value the function on load.
-		 * @returns {CKEDITOR.xml} An XML object holding the loaded data. For asynchronous requests, an
-		 *		empty string. For invalid requests, null.
-		 * @example
-		 * // Load XML synchronously.
-		 * var xml = CKEDITOR.ajax.loadXml( 'somedata.xml' );
-		 * alert( xml.getInnerXml( '//' ) );
-		 * @example
-		 * // Load XML asynchronously.
-		 * var data = CKEDITOR.ajax.loadXml( 'somedata.xml', function( xml )
-		 *     {
-		 *         alert( xml.getInnerXml( '//' ) );
-		 *     } );
-		 */
-		loadXml : function( url, callback )
-		{
-			return load( url, callback, getResponseXml );
-		}
-	};
-})();
Index: /CKEditor/branches/features/bbcode/_source/core/ckeditor_basic.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/core/ckeditor_basic.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/core/ckeditor_basic.js	(revision 6781)
@@ -174,6 +174,5 @@
 			{
 				var config = null,
-					textarea = textareas[i],
-					name = textarea.name;
+					textarea = textareas[i];
 
 				// The "name" and/or "id" attribute must exist.
Index: /CKEditor/branches/features/bbcode/_source/core/dom/walker.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/core/dom/walker.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/core/dom/walker.js	(revision 6781)
@@ -339,5 +339,7 @@
 	CKEDITOR.dom.element.prototype.isBlockBoundary = function( customNodeNames )
 	{
-		var nodeNameMatches = CKEDITOR.tools.extend( {}, CKEDITOR.dtd.$block, customNodeNames || {} );
+		var nodeNameMatches = customNodeNames ?
+			CKEDITOR.tools.extend( {}, CKEDITOR.dtd.$block, customNodeNames || {} ) :
+			CKEDITOR.dtd.$block;
 
 		// Don't consider floated formatting as block boundary, fall back to dtd check in that case. (#6297)
Index: /CKEditor/branches/features/bbcode/_source/core/dtd.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/core/dtd.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/core/dtd.js	(revision 6781)
@@ -182,5 +182,4 @@
         table : {thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1},
         code : L,
-        script : N,
         tfoot : M,
         cite : L,
Index: /CKEditor/branches/features/bbcode/_source/core/editor.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/core/editor.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/core/editor.js	(revision 6781)
@@ -562,5 +562,5 @@
 		 *		executed, otherwise "false".
 		 * @example
-		 * editorInstance.execCommand( 'Bold' );
+		 * editorInstance.execCommand( 'bold' );
 		 */
 		execCommand : function( commandName, data )
Index: /CKEditor/branches/features/bbcode/_source/core/env.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/core/env.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/core/env.js	(revision 6781)
@@ -145,4 +145,14 @@
 			 */
 			env.ie8Compat = document.documentMode == 8;
+
+			/**
+			 * Indicates that CKEditor is running on Internet Explorer 9's standards mode.
+			 * @name CKEDITOR.env.ie9Compat
+			 * @type Boolean
+			 * @example
+			 * if ( CKEDITOR.env.ie9Compat )
+			 *     alert( "IE9, the beauty of the web!" );
+			 */
+			env.ie9Compat = document.documentMode == 9;
 
 			/**
Index: /CKEditor/branches/features/bbcode/_source/core/htmlparser.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/core/htmlparser.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/core/htmlparser.js	(revision 6781)
@@ -19,5 +19,5 @@
 	this._ =
 	{
-		htmlPartsRegex : new RegExp( '<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:[^"\'>]+)|(?:"[^"]*")|(?:\'[^\']*\'))*)\\/?>))', 'g' )
+		htmlPartsRegex : new RegExp( '<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:"[^"]*")|(?:\'[^\']*\')|[^"\'>])*)\\/?>))', 'g' )
 	};
 };
Index: /CKEditor/branches/features/bbcode/_source/core/htmlparser/element.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/core/htmlparser/element.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/core/htmlparser/element.js	(revision 6781)
@@ -128,5 +128,5 @@
 					var writer = new CKEDITOR.htmlParser.basicWriter();
 					CKEDITOR.htmlParser.fragment.prototype.writeChildrenHtml.call( element, writer, filter );
-					element.children = new CKEDITOR.htmlParser.fragment.fromHtml( writer.getHtml() ).children;
+					element.children = new CKEDITOR.htmlParser.fragment.fromHtml( writer.getHtml(), 0, element.clone() ).children;
 					isChildrenFiltered = 1;
 				}
Index: /CKEditor/branches/features/bbcode/_source/core/htmlparser/fragment.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/core/htmlparser/fragment.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/core/htmlparser/fragment.js	(revision 6781)
@@ -38,14 +38,12 @@
 (function()
 {
-	// Elements which the end tag is marked as optional in the HTML 4.01 DTD
-	// (expect empty elements).
-	var optionalClose = {colgroup:1,dd:1,dt:1,li:1,option:1,p:1,td:1,tfoot:1,th:1,thead:1,tr:1};
-
 	// Block-level elements whose internal structure should be respected during
 	// parser fixing.
-	var nonBreakingBlocks = CKEDITOR.tools.extend(
-			{table:1,ul:1,ol:1,dl:1},
-			CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl ),
-		listBlocks = CKEDITOR.dtd.$list, listItems = CKEDITOR.dtd.$listItem;
+	var nonBreakingBlocks = CKEDITOR.tools.extend( { table:1,ul:1,ol:1,dl:1 }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl );
+
+	var listBlocks = { ol:1, ul:1 };
+
+	// Dtd of the fragment element, basically it accept anything except for intermediate structure, e.g. orphan <li>.
+	var rootDtd = CKEDITOR.tools.extend( {}, { html: 1 }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, { style:1,script:1 } );
 
 	/**
@@ -53,4 +51,5 @@
 	 * @param {String} fragmentHtml The HTML to be parsed, filling the fragment.
 	 * @param {Number} [fixForBody=false] Wrap body with specified element if needed.
+	 * @param {CKEDITOR.htmlParser.element} contextNode Parse the html as the content of this element.
 	 * @returns CKEDITOR.htmlParser.fragment The fragment created.
 	 * @example
@@ -59,15 +58,13 @@
 	 * alert( fragment.children[1].value );  " Text"
 	 */
-	CKEDITOR.htmlParser.fragment.fromHtml = function( fragmentHtml, fixForBody )
+	CKEDITOR.htmlParser.fragment.fromHtml = function( fragmentHtml, fixForBody, contextNode )
 	{
 		var parser = new CKEDITOR.htmlParser(),
-			html = [],
-			fragment = new CKEDITOR.htmlParser.fragment(),
+			fragment = contextNode || new CKEDITOR.htmlParser.fragment(),
 			pendingInline = [],
 			pendingBRs = [],
 			currentNode = fragment,
 		    // Indicate we're inside a <pre> element, spaces should be touched differently.
-			inPre = false,
-			returnPoint;
+			inPre = false;
 
 		function checkPending( newTagName )
@@ -115,11 +112,29 @@
 		}
 
-		function addElement( element, target, enforceCurrent )
-		{
+		/*
+		* Beside of simply append specified element to target, this function also takes
+		* care of other dirty lifts like forcing block in body, trimming spaces at
+		* the block boundaries etc.
+		*
+		* @param {Element} element  The element to be added as the last child of {@link target}.
+		* @param {Element} target The parent element to relieve the new node.
+		* @param {Boolean} [moveCurrent=false] Don't change the "currentNode" global unless
+		* there's a return point node specified on the element, otherwise move current onto {@link target} node.
+		 */
+		function addElement( element, target, moveCurrent )
+		{
+			// Ignore any element that has already been added.
+			if ( element.previous !== undefined )
+				return;
+
 			target = target || currentNode || fragment;
+
+			// Current element might be mangled by fix body below,
+			// save it for restore later.
+			var savedCurrent = currentNode;
 
 			// If the target is the fragment and this inline element can't go inside
 			// body (if fixForBody).
-			if ( fixForBody && !target.type )
+			if ( fixForBody && ( !target.type || target.name == 'body' ) )
 			{
 				var elementName, realElementName;
@@ -131,8 +146,6 @@
 					elementName =  element.name;
 
-				if ( elementName && elementName in CKEDITOR.dtd.$inline )
-				{
-					var savedCurrent = currentNode;
-
+				if ( elementName && !( elementName in CKEDITOR.dtd.$body || elementName == 'body' || element.isOrphan ) )
+				{
 					// Create a <p> in the fragment.
 					currentNode = target;
@@ -140,8 +153,5 @@
 
 					// The new target now is the <p>.
-					target = currentNode;
-
-					if ( enforceCurrent )
-						currentNode = savedCurrent;
+					element.returnPoint = target = currentNode;
 				}
 			}
@@ -171,7 +181,9 @@
 				delete element.returnPoint;
 			}
+			else
+				currentNode = moveCurrent ? target : savedCurrent;
 		}
 
-		parser.onTagOpen = function( tagName, attributes, selfClosing )
+		parser.onTagOpen = function( tagName, attributes, selfClosing, optionalClose )
 		{
 			var element = new CKEDITOR.htmlParser.element( tagName, attributes );
@@ -182,4 +194,6 @@
 				element.isEmpty = true;
 
+			element.isOptionalClose = optionalClose;
+
 			// This is a tag to be removed if empty, so do not add it immediately.
 			if ( CKEDITOR.dtd.$removeEmpty[ tagName ] )
@@ -202,79 +216,69 @@
 			}
 
-			var currentName = currentNode.name;
-
-			var currentDtd = currentName
-				&& ( CKEDITOR.dtd[ currentName ]
-					|| ( currentNode._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span ) );
-
-			// If the element cannot be child of the current element.
-			if ( currentDtd   // Fragment could receive any elements.
-				 && !element.isUnknown && !currentNode.isUnknown && !currentDtd[ tagName ] )
-			{
-
-				var reApply = false,
-					addPoint;   // New position to start adding nodes.
-
-				// Fixing malformed nested lists by moving it into a previous list item. (#3828)
-				if ( tagName in listBlocks
-					&& currentName in listBlocks )
-				{
-					var children = currentNode.children,
-						lastChild = children[ children.length - 1 ];
-
-					// Establish the list item if it's not existed.
-					if ( !( lastChild && lastChild.name in listItems ) )
-						addElement( ( lastChild = new CKEDITOR.htmlParser.element( 'li' ) ), currentNode );
-
-					returnPoint = currentNode, addPoint = lastChild;
-				}
-				// If the element name is the same as the current element name,
-				// then just close the current one and append the new one to the
-				// parent. This situation usually happens with <p>, <li>, <dt> and
-				// <dd>, specially in IE. Do not enter in this if block in this case.
-				else if ( tagName == currentName )
-				{
-					addElement( currentNode, currentNode.parent );
-				}
-				else if ( tagName in CKEDITOR.dtd.$listItem )
-				{
-					parser.onTagOpen( 'ul', {} );
-					addPoint = currentNode;
-					reApply = true;
-				}
-				else
-				{
-					if ( nonBreakingBlocks[ currentName ] )
+			while( 1 )
+			{
+				var currentName = currentNode.name;
+
+				var currentDtd = currentName ? ( CKEDITOR.dtd[ currentName ]
+						|| ( currentNode._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span ) )
+						: rootDtd;
+
+				// If the element cannot be child of the current element.
+				if ( !element.isUnknown && !currentNode.isUnknown && !currentDtd[ tagName ] )
+				{
+					// Current node doesn't have a close tag, time for a close
+					// as this element isn't fit in. (#7497)
+					if ( currentNode.isOptionalClose )
+						parser.onTagClose( currentName );
+					// Fixing malformed nested lists by moving it into a previous list item. (#3828)
+					else if ( tagName in listBlocks
+						&& currentName in listBlocks )
 					{
-						if ( !returnPoint )
-							returnPoint = currentNode;
+						var children = currentNode.children,
+							lastChild = children[ children.length - 1 ];
+
+						// Establish the list item if it's not existed.
+						if ( !( lastChild && lastChild.name == 'li' ) )
+							addElement( ( lastChild = new CKEDITOR.htmlParser.element( 'li' ) ), currentNode );
+
+						!element.returnPoint && ( element.returnPoint = currentNode );
+						currentNode = lastChild;
+					}
+					// Establish new list root for orphan list items.
+					else if ( tagName in CKEDITOR.dtd.$listItem && currentName != tagName )
+						parser.onTagOpen( tagName == 'li' ? 'ul' : 'dl', {}, 0, 1 );
+					// We're inside a structural block like table and list, AND the incoming element
+					// is not of the same type (e.g. <td>td1<td>td2</td>), we simply add this new one before it,
+					// and most importantly, return back to here once this element is added,
+					// e.g. <table><tr><td>td1</td><p>p1</p><td>td2</td></tr></table>
+					else if ( currentName in nonBreakingBlocks && currentName != tagName )
+					{
+						!element.returnPoint && ( element.returnPoint = currentNode );
+						currentNode = currentNode.parent;
 					}
 					else
 					{
-						addElement( currentNode, currentNode.parent, true );
-
-						if ( !optionalClose[ currentName ] )
+						// The current element is an inline element, which
+						// need to be continued even after the close, so put
+						// it in the pending list.
+						if ( currentName in CKEDITOR.dtd.$inline )
+							pendingInline.unshift( currentNode );
+
+						// The most common case where we just need to close the
+						// current one and append the new one to the parent.
+						if ( currentNode.parent )
+							addElement( currentNode, currentNode.parent, 1 );
+						// We've tried our best to fix the embarrassment here, while
+						// this element still doesn't find it's parent, mark it as
+						// orphan and show our tolerance to it.
+						else
 						{
-							// The current element is an inline element, which
-							// cannot hold the new one. Put it in the pending list,
-							// and try adding the new one after it.
-							pendingInline.unshift( currentNode );
+							element.isOrphan = 1;
+							break;
 						}
 					}
-
-					reApply = true;
-				}
-
-				if ( addPoint )
-					currentNode = addPoint;
-				// Try adding it to the return point, or the parent element.
+				}
 				else
-					currentNode = currentNode.returnPoint || currentNode.parent;
-
-				if ( reApply )
-				{
-					parser.onTagOpen.apply( this, arguments );
-					return;
-				}
+					break;
 			}
 
@@ -283,6 +287,4 @@
 
 			element.parent = currentNode;
-			element.returnPoint = returnPoint;
-			returnPoint = 0;
 
 			if ( element.isEmpty )
@@ -309,5 +311,5 @@
 				candidate = currentNode;
 
-			while ( candidate.type && candidate.name != tagName )
+			while ( candidate != fragment && candidate.name != tagName )
 			{
 				// If this is an inline element, add it to the pending list, if we're
@@ -322,8 +324,9 @@
 				pendingAdd.push( candidate );
 
-				candidate = candidate.parent;
-			}
-
-			if ( candidate.type )
+				// Make sure return point is properly restored.
+				candidate = candidate.returnPoint || candidate.parent;
+			}
+
+			if ( candidate != fragment )
 			{
 				// Add all elements that have been found in the above loop.
@@ -358,6 +361,6 @@
 		parser.onText = function( text )
 		{
-			// Trim empty spaces at beginning of element contents except <pre>.
-			if ( !currentNode._.hasInlineStarted && !inPre )
+			// Trim empty spaces at beginning of text contents except <pre>.
+			if ( ( !currentNode._.hasInlineStarted || pendingBRs.length ) && !inPre )
 			{
 				text = CKEDITOR.tools.ltrim( text );
@@ -374,5 +377,5 @@
 				 && CKEDITOR.tools.trim( text ) )
 			{
-				this.onTagOpen( fixForBody, {} );
+				this.onTagOpen( fixForBody, {}, 0, 1 );
 			}
 
@@ -403,22 +406,7 @@
 		sendPendingBRs( !CKEDITOR.env.ie && 1 );
 
-		// Close all pending nodes.
-		while ( currentNode.type )
-		{
-			var parent = currentNode.parent,
-				node = currentNode;
-
-			if ( fixForBody
-				 && ( !parent.type || parent.name == 'body' )
-				 && !CKEDITOR.dtd.$body[ node.name ] )
-			{
-				currentNode = parent;
-				parser.onTagOpen( fixForBody, {} );
-				parent = currentNode;
-			}
-
-			parent.add( node );
-			currentNode = parent;
-		}
+		// Close all pending nodes, make sure return point is properly restored.
+		while ( currentNode != fragment )
+			addElement( currentNode, currentNode.parent, 1 );
 
 		return fragment;
Index: /CKEditor/branches/features/bbcode/_source/core/loader.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/core/loader.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/core/loader.js	(revision 6781)
@@ -25,5 +25,4 @@
 		{
 			'core/_bootstrap'		: [ 'core/config', 'core/ckeditor', 'core/plugins', 'core/scriptloader', 'core/tools', /* The following are entries that we want to force loading at the end to avoid dependence recursion */ 'core/dom/comment', 'core/dom/elementpath', 'core/dom/text', 'core/dom/rangelist' ],
-			'core/ajax'				: [ 'core/xml' ],
 			'core/ckeditor'			: [ 'core/ckeditor_basic', 'core/dom', 'core/dtd', 'core/dom/document', 'core/dom/element', 'core/editor', 'core/event', 'core/htmlparser', 'core/htmlparser/element', 'core/htmlparser/fragment', 'core/htmlparser/filter', 'core/htmlparser/basicwriter', 'core/tools' ],
 			'core/ckeditor_base'	: [],
@@ -67,6 +66,5 @@
 			'core/themes'			: [ 'core/resourcemanager' ],
 			'core/tools'			: [ 'core/env' ],
-			'core/ui'				: [],
-			'core/xml'				: [ 'core/env' ]
+			'core/ui'				: []
 		};
 
Index: Editor/branches/features/bbcode/_source/core/xml.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/core/xml.js	(revision 6780)
+++ 	(revision )
@@ -1,165 +1,0 @@
-﻿/*
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
-
-/**
- * @fileOverview Defines the {@link CKEDITOR.xml} class, which represents a
- *		loaded XML document.
- */
-
-/**
- * Represents a loaded XML document.
- * @constructor
- * @param {object|string} xmlObjectOrData A native XML (DOM document) object or
- *		a string containing the XML definition to be loaded.
- * @example
- * var xml = <b>new CKEDITOR.xml( '<books><book title="My Book" /></books>' )</b>;
- */
-CKEDITOR.xml = function( xmlObjectOrData )
-{
-	var baseXml = null;
-
-	if ( typeof xmlObjectOrData == 'object' )
-		baseXml = xmlObjectOrData;
-	else
-	{
-		var data = ( xmlObjectOrData || '' ).replace( /&nbsp;/g, '\xA0' );
-		if ( window.DOMParser )
-			baseXml = (new DOMParser()).parseFromString( data, 'text/xml' );
-		else if ( window.ActiveXObject )
-		{
-			try { baseXml = new ActiveXObject( 'MSXML2.DOMDocument' ); }
-			catch(e)
-			{
-				try { baseXml = new ActiveXObject( 'Microsoft.XmlDom' ); } catch(e) {}
-			}
-
-			if ( baseXml )
-			{
-				baseXml.async = false;
-				baseXml.resolveExternals = false;
-				baseXml.validateOnParse = false;
-				baseXml.loadXML( data );
-			}
-		}
-	}
-
-	/**
-	 * The native XML (DOM document) used by the class instance.
-	 * @type object
-	 * @example
-	 */
-	this.baseXml = baseXml;
-};
-
-CKEDITOR.xml.prototype =
-{
-	/**
-	 * Get a single node from the XML document, based on a XPath query.
-	 * @param {String} xpath The XPath query to execute.
-	 * @param {Object} [contextNode] The XML DOM node to be used as the context
-	 *		for the XPath query. The document root is used by default.
-	 * @returns {Object} A XML node element or null if the query has no results.
-	 * @example
-	 * // Create the XML instance.
-	 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
-	 * // Get the first <item> node.
-	 * var itemNode = <b>xml.selectSingleNode( 'list/item' )</b>;
-	 * // Alert "item".
-	 * alert( itemNode.nodeName );
-	 */
-	selectSingleNode : function( xpath, contextNode )
-	{
-		var baseXml = this.baseXml;
-
-		if ( contextNode || ( contextNode = baseXml ) )
-		{
-			if ( CKEDITOR.env.ie || contextNode.selectSingleNode )	// IE
-				return contextNode.selectSingleNode( xpath );
-			else if ( baseXml.evaluate )							// Others
-			{
-				var result = baseXml.evaluate( xpath, contextNode, null, 9, null);
-				return ( result && result.singleNodeValue ) || null;
-			}
-		}
-
-		return null;
-	},
-
-	/**
-	 * Gets a list node from the XML document, based on a XPath query.
-	 * @param {String} xpath The XPath query to execute.
-	 * @param {Object} [contextNode] The XML DOM node to be used as the context
-	 *		for the XPath query. The document root is used by default.
-	 * @returns {ArrayLike} An array containing all matched nodes. The array will
-	 *		be empty if the query has no results.
-	 * @example
-	 * // Create the XML instance.
-	 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
-	 * // Get the first <item> node.
-	 * var itemNodes = xml.selectSingleNode( 'list/item' );
-	 * // Alert "item" twice, one for each <item>.
-	 * for ( var i = 0 ; i < itemNodes.length ; i++ )
-	 *     alert( itemNodes[i].nodeName );
-	 */
-	selectNodes : function( xpath, contextNode )
-	{
-		var baseXml = this.baseXml,
-			nodes = [];
-
-		if ( contextNode || ( contextNode = baseXml ) )
-		{
-			if ( CKEDITOR.env.ie || contextNode.selectNodes )		// IE
-				return contextNode.selectNodes( xpath );
-			else if ( baseXml.evaluate )							// Others
-			{
-				var result = baseXml.evaluate( xpath, contextNode, null, 5, null);
-
-				if ( result )
-				{
-					var node;
-					while ( ( node = result.iterateNext() ) )
-						nodes.push( node );
-				}
-			}
-		}
-
-		return nodes;
-	},
-
-	/**
-	 * Gets the string representation of hte inner contents of a XML node,
-	 * based on a XPath query.
-	 * @param {String} xpath The XPath query to execute.
-	 * @param {Object} [contextNode] The XML DOM node to be used as the context
-	 *		for the XPath query. The document root is used by default.
-	 * @returns {String} The textual representation of the inner contents of
-	 *		the node or null if the query has no results.
-	 * @example
-	 * // Create the XML instance.
-	 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
-	 * // Alert "<item id="test1" /><item id="test2" />".
-	 * alert( xml.getInnerXml( 'list' ) );
-	 */
-	getInnerXml : function( xpath, contextNode )
-	{
-		var node = this.selectSingleNode( xpath, contextNode ),
-			xml = [];
-		if ( node )
-		{
-			node = node.firstChild;
-			while ( node )
-			{
-				if ( node.xml )				// IE
-					xml.push( node.xml );
-				else if ( window.XMLSerializer )	// Others
-					xml.push( ( new XMLSerializer() ).serializeToString( node ) );
-
-				node = node.nextSibling;
-			}
-		}
-
-		return xml.length ? xml.join( '' ) : null;
-	}
-};
Index: /CKEditor/branches/features/bbcode/_source/lang/_translationstatus.txt
===================================================================
--- /CKEditor/branches/features/bbcode/_source/lang/_translationstatus.txt	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/lang/_translationstatus.txt	(revision 6781)
@@ -11,5 +11,5 @@
 cy.js      Found: 435 Missing: 87
 da.js      Found: 388 Missing: 134
-de.js      Found: 521 Missing: 1
+de.js      Found: 522 Missing: 0
 el.js      Found: 274 Missing: 248
 en-au.js   Found: 345 Missing: 177
@@ -24,5 +24,5 @@
 fo.js      Found: 521 Missing: 1
 fr-ca.js   Found: 289 Missing: 233
-fr.js      Found: 521 Missing: 1
+fr.js      Found: 522 Missing: 0
 gl.js      Found: 271 Missing: 251
 gu.js      Found: 288 Missing: 234
@@ -43,5 +43,5 @@
 nl.js      Found: 513 Missing: 9
 no.js      Found: 521 Missing: 1
-pl.js      Found: 521 Missing: 1
+pl.js      Found: 522 Missing: 0
 pt-br.js   Found: 506 Missing: 16
 pt.js      Found: 270 Missing: 252
Index: /CKEditor/branches/features/bbcode/_source/lang/de.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/lang/de.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/lang/de.js	(revision 6781)
@@ -183,5 +183,5 @@
 		charset			: 'Ziel-Zeichensatz',
 		styles			: 'Style',
-		rel			: 'Relationship', // MISSING
+		rel			: 'Beziehung',
 		selectAnchor		: 'Anker auswählen',
 		anchorName		: 'nach Anker Name',
Index: /CKEditor/branches/features/bbcode/_source/lang/fr.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/lang/fr.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/lang/fr.js	(revision 6781)
@@ -183,5 +183,5 @@
 		charset			: 'Charset de la cible',
 		styles			: 'Style',
-		rel			: 'Relationship', // MISSING
+		rel			: 'Relation',
 		selectAnchor		: 'Sélectionner l\'ancre',
 		anchorName		: 'Par nom d\'ancre',
Index: /CKEditor/branches/features/bbcode/_source/lang/pl.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/lang/pl.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/lang/pl.js	(revision 6781)
@@ -183,5 +183,5 @@
 		charset			: 'Kodowanie znaków obiektu docelowego',
 		styles			: 'Styl',
-		rel			: 'Relationship', // MISSING
+		rel			: 'Relacja',
 		selectAnchor		: 'Wybierz kotwicę',
 		anchorName		: 'Wg nazwy',
Index: /CKEditor/branches/features/bbcode/_source/lang/sv.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/lang/sv.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/lang/sv.js	(revision 6781)
@@ -5,5 +5,5 @@
 
 /**
-* @fileOverview 
+* @fileOverview
 */
 
Index: /CKEditor/branches/features/bbcode/_source/plugins/a11yhelp/dialogs/a11yhelp.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/a11yhelp/dialogs/a11yhelp.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/a11yhelp/dialogs/a11yhelp.js	(revision 6781)
@@ -171,4 +171,5 @@
 						type : 'html',
 						id : 'legends',
+						style : 'white-space:normal;',
 						focus : function() {},
 						html : buildHelpContents() +
@@ -182,4 +183,15 @@
 								'overflow-x:hidden;' +
 							'}' +
+							// Some adjustments are to be done for IE6 and Quirks to work "properly" (#5757)
+							'.cke_browser_quirks .cke_accessibility_legend,' +
+							'.cke_browser_ie6 .cke_accessibility_legend' +
+							'{' +
+								'height:390px' +
+							'}' +
+							// Override non-wrapping white-space rule in reset css.
+							'.cke_accessibility_legend *' +
+							'{' +
+								'white-space:normal;' +
+							'}' +
 							'.cke_accessibility_legend h1' +
 							'{' +
@@ -199,5 +211,4 @@
 							'.cke_accessibility_legend dd' +
 							'{' +
-								'white-space:normal;' +
 								'margin:10px' +
 							'}' +
Index: /CKEditor/branches/features/bbcode/_source/plugins/ajax/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/ajax/plugin.js	(revision 6781)
+++ /CKEditor/branches/features/bbcode/_source/plugins/ajax/plugin.js	(revision 6781)
@@ -0,0 +1,152 @@
+﻿/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.ajax} object, which holds ajax methods for
+ *		data loading.
+ */
+
+(function()
+{
+	CKEDITOR.plugins.add( 'ajax',
+		{
+			requires : [ 'xml' ]
+		});
+
+	/**
+	 * Ajax methods for data loading.
+	 * @namespace
+	 * @example
+	 */
+	CKEDITOR.ajax = (function()
+	{
+		var createXMLHttpRequest = function()
+		{
+			// In IE, using the native XMLHttpRequest for local files may throw
+			// "Access is Denied" errors.
+			if ( !CKEDITOR.env.ie || location.protocol != 'file:' )
+				try { return new XMLHttpRequest(); } catch(e) {}
+
+			try { return new ActiveXObject( 'Msxml2.XMLHTTP' ); } catch (e) {}
+			try { return new ActiveXObject( 'Microsoft.XMLHTTP' ); } catch (e) {}
+
+			return null;
+		};
+
+		var checkStatus = function( xhr )
+		{
+			// HTTP Status Codes:
+			//	 2xx : Success
+			//	 304 : Not Modified
+			//	   0 : Returned when running locally (file://)
+			//	1223 : IE may change 204 to 1223 (see http://dev.jquery.com/ticket/1450)
+
+			return ( xhr.readyState == 4 &&
+					(	( xhr.status >= 200 && xhr.status < 300 ) ||
+						xhr.status == 304 ||
+						xhr.status === 0 ||
+						xhr.status == 1223 ) );
+		};
+
+		var getResponseText = function( xhr )
+		{
+			if ( checkStatus( xhr ) )
+				return xhr.responseText;
+			return null;
+		};
+
+		var getResponseXml = function( xhr )
+		{
+			if ( checkStatus( xhr ) )
+			{
+				var xml = xhr.responseXML;
+				return new CKEDITOR.xml( xml && xml.firstChild ? xml : xhr.responseText );
+			}
+			return null;
+		};
+
+		var load = function( url, callback, getResponseFn )
+		{
+			var async = !!callback;
+
+			var xhr = createXMLHttpRequest();
+
+			if ( !xhr )
+				return null;
+
+			xhr.open( 'GET', url, async );
+
+			if ( async )
+			{
+				// TODO: perform leak checks on this closure.
+				/** @ignore */
+				xhr.onreadystatechange = function()
+				{
+					if ( xhr.readyState == 4 )
+					{
+						callback( getResponseFn( xhr ) );
+						xhr = null;
+					}
+				};
+			}
+
+			xhr.send(null);
+
+			return async ? '' : getResponseFn( xhr );
+		};
+
+		return 	/** @lends CKEDITOR.ajax */ {
+
+			/**
+			 * Loads data from an URL as plain text.
+			 * @param {String} url The URL from which load data.
+			 * @param {Function} [callback] A callback function to be called on
+			 *		data load. If not provided, the data will be loaded
+			 *		synchronously.
+			 * @returns {String} The loaded data. For asynchronous requests, an
+			 *		empty string. For invalid requests, null.
+			 * @example
+			 * // Load data synchronously.
+			 * var data = CKEDITOR.ajax.load( 'somedata.txt' );
+			 * alert( data );
+			 * @example
+			 * // Load data asynchronously.
+			 * var data = CKEDITOR.ajax.load( 'somedata.txt', function( data )
+			 *     {
+			 *         alert( data );
+			 *     } );
+			 */
+			load : function( url, callback )
+			{
+				return load( url, callback, getResponseText );
+			},
+
+			/**
+			 * Loads data from an URL as XML.
+			 * @param {String} url The URL from which load data.
+			 * @param {Function} [callback] A callback function to be called on
+			 *		data load. If not provided, the data will be loaded
+			 *		synchronously.
+			 * @returns {CKEDITOR.xml} An XML object holding the loaded data. For asynchronous requests, an
+			 *		empty string. For invalid requests, null.
+			 * @example
+			 * // Load XML synchronously.
+			 * var xml = CKEDITOR.ajax.loadXml( 'somedata.xml' );
+			 * alert( xml.getInnerXml( '//' ) );
+			 * @example
+			 * // Load XML asynchronously.
+			 * var data = CKEDITOR.ajax.loadXml( 'somedata.xml', function( xml )
+			 *     {
+			 *         alert( xml.getInnerXml( '//' ) );
+			 *     } );
+			 */
+			loadXml : function( url, callback )
+			{
+				return load( url, callback, getResponseXml );
+			}
+		};
+	})();
+
+})();
Index: /CKEditor/branches/features/bbcode/_source/plugins/bidi/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/bidi/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/bidi/plugin.js	(revision 6781)
@@ -91,5 +91,5 @@
 				element.removeStyle( 'direction' );
 				element.removeAttribute( 'dir' );
-				return null;
+				return;
 			}
 		}
@@ -102,5 +102,5 @@
 		// Stop if direction is same as present.
 		if ( elementDir == dir )
-			return null;
+			return;
 
 		// Clear direction on this element.
@@ -121,5 +121,5 @@
 		editor.forceNextSelectionCheck();
 
-		return null;
+		return;
 	}
 
@@ -257,5 +257,5 @@
 							dir : evt.data.getDirection( 1 )
 						} );
-				})
+				});
 			});
 		}
Index: /CKEditor/branches/features/bbcode/_source/plugins/clipboard/dialogs/paste.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/clipboard/dialogs/paste.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/clipboard/dialogs/paste.js	(revision 6781)
@@ -165,5 +165,10 @@
 				iframe = container.getElementsByTag( 'iframe' ).getItem( 0 ),
 				editor = this.getParentEditor(),
-				html = iframe.$.contentWindow.document.body.innerHTML;
+				body = iframe.getFrameDocument().getBody(),
+				bogus = body.getBogus(),
+				html;
+			bogus && bogus.remove();
+			// Saving the contents in variable so changes until paste is complete will not take place (#7500)
+			html = body.getHtml();
 
 			setTimeout( function(){
Index: /CKEditor/branches/features/bbcode/_source/plugins/clipboard/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/clipboard/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/clipboard/plugin.js	(revision 6781)
@@ -159,4 +159,6 @@
 	};
 
+	function cancel( evt ) { evt.cancel(); }
+
 	// Allow to peek clipboard content by redirecting the
 	// pasting content into a temporary bin and grab the content of it.
@@ -209,17 +211,9 @@
 		var bms = sel.createBookmarks();
 
+		this.on( 'selectionChange', cancel, null, null, 0 );
+
 		// Turn off design mode temporarily before give focus to the paste bin.
 		if ( mode == 'text' )
-		{
-			if ( CKEDITOR.env.ie )
-			{
-				var ieRange = doc.getBody().$.createTextRange();
-				ieRange.moveToElementText( pastebin.$ );
-				ieRange.execCommand( 'Paste' );
-				evt.data.preventDefault();
-			}
-			else
-				pastebin.$.focus();
-		}
+			pastebin.$.focus();
 		else
 		{
@@ -235,4 +229,5 @@
 			mode == 'text' && CKEDITOR.env.gecko && editor.focusGrabber.focus();
 			pastebin.remove();
+			editor.removeListener( 'selectionChange', cancel );
 
 			// Grab the HTML contents.
@@ -323,4 +318,6 @@
 							editor.insertText( data[ 'text' ] );
 
+						setTimeout( function () { editor.fire( 'afterPaste' ); }, 0 );
+
 					}, null, null, 1000 );
 
@@ -371,6 +368,4 @@
 				editor.on( 'key', onKey, editor );
 
-				var mode = editor.config.forcePasteAsPlainText ? 'text' : 'html';
-
 				// We'll be catching all pasted content in one line, regardless of whether the
 				// it's introduced by a document command execution (e.g. toolbar buttons) or
@@ -379,19 +374,23 @@
 				{
 					var body = editor.document.getBody();
-					body.on( ( ( mode == 'text' && CKEDITOR.env.ie ) || CKEDITOR.env.webkit ) ? 'paste' : 'beforepaste',
-						function( evt )
+					body.on( 'beforepaste', function( evt )
 						{
 							if ( depressBeforeEvent )
 								return;
 
-							getClipboardData.call( editor, evt, mode, function ( data )
+							// Fire 'beforePaste' event so clipboard flavor get customized
+							// by other plugins.
+							var eventData =  { mode : 'html' };
+							editor.fire( 'beforePaste', eventData );
+
+							getClipboardData.call( editor, evt, eventData.mode, function ( data )
 							{
 								// The very last guard to make sure the
 								// paste has successfully happened.
-								if ( !data )
+								if ( !CKEDITOR.tools.trim( data.toLowerCase().replace( /<span[^>]+data-cke-bookmark[^<]*?<\/span>/g,'' ) ) )
 									return;
 
 								var dataTransfer = {};
-								dataTransfer[ mode ] = data;
+								dataTransfer[ eventData.mode ] = data;
 								editor.fire( 'paste', dataTransfer );
 							} );
Index: /CKEditor/branches/features/bbcode/_source/plugins/colorbutton/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/colorbutton/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/colorbutton/plugin.js	(revision 6781)
@@ -67,5 +67,5 @@
 
 						// Find the closest block element.
-						block = path.block || path.blockLimit;
+						block = path.block || path.blockLimit || editor.document.getBody();
 
 						// The background color might be transparent. In that case, look up the color in the DOM tree.
Index: /CKEditor/branches/features/bbcode/_source/plugins/colordialog/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/colordialog/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/colordialog/plugin.js	(revision 6781)
@@ -1,13 +1,15 @@
-﻿( function()
+﻿/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.plugins.colordialog =
 {
-	CKEDITOR.plugins.colordialog =
+	init : function( editor )
 	{
-		init : function( editor )
-		{
-			editor.addCommand( 'colordialog', new CKEDITOR.dialogCommand( 'colordialog' ) );
-			CKEDITOR.dialog.add( 'colordialog', this.path + 'dialogs/colordialog.js' );
-		}
-	};
+		editor.addCommand( 'colordialog', new CKEDITOR.dialogCommand( 'colordialog' ) );
+		CKEDITOR.dialog.add( 'colordialog', this.path + 'dialogs/colordialog.js' );
+	}
+};
 
-	CKEDITOR.plugins.add( 'colordialog', CKEDITOR.plugins.colordialog );
-} )();
+CKEDITOR.plugins.add( 'colordialog', CKEDITOR.plugins.colordialog );
Index: /CKEditor/branches/features/bbcode/_source/plugins/dialog/dialogDefinition.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/dialog/dialogDefinition.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/dialog/dialogDefinition.js	(revision 6781)
@@ -88,4 +88,25 @@
  */
 
+
+/**
+ * The initial width of the dialog, in pixels.
+ * @name CKEDITOR.dialog.definition.prototype.width
+ * @field
+ * @type Number
+ * @default @CKEDITOR.dialog.definition.prototype.minWidth
+ * @since 3.5.3
+ * @example
+ */
+
+/**
+ * The initial height of the dialog, in pixels.
+ * @name CKEDITOR.dialog.definition.prototype.height
+ * @field
+ * @type Number
+ * @default @CKEDITOR.dialog.definition.prototype.minHeight
+ * @since 3.5.3
+ * @example
+ */
+
 /**
  * The buttons in the dialog, defined as an array of
@@ -611,5 +632,5 @@
 /**
  * (Optional) The action attribute of the form element associated with this file upload input.
- * If empty, CKFinder will use path to server connector for currently opened folder.
+ * If empty, CKEditor will use path to server connector for currently opened folder.
  * @name CKEDITOR.dialog.definition.file.prototype.action
  * @type String
@@ -680,5 +701,5 @@
 
 /**
- * The instruction for CKFinder how to deal with file upload.
+ * The instruction for CKEditor how to deal with file upload.
  * By default, the file and fileButton elements will not work "as expected" if this attribute is not set.
  * @name CKEDITOR.dialog.definition.fileButton.prototype.filebrowser
@@ -738,7 +759,7 @@
  * 	minHeight : 200,
  * 	onOk : function() {
- * 		// "this" is now a CKFinder.dialog object.
+ * 		// "this" is now a CKEDITOR.dialog object.
  * 		var document = this.getElement().getDocument();
- * 		// document = CKFinder.dom.document
+ * 		// document = CKEDITOR.dom.document
  * 		var element = <b>document.getById( 'myDiv' );</b>
  * 		if ( element )
@@ -759,5 +780,5 @@
  * 		}
  * 	],
- * 	buttons : [ CKFinder.dialog.cancelButton, CKFinder.dialog.okButton ]
+ * 	buttons : [ CKEDITOR.dialog.cancelButton, CKEDITOR.dialog.okButton ]
  * };
  */
@@ -1059,3 +1080,2 @@
  * @example
  */
-
Index: /CKEditor/branches/features/bbcode/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/dialog/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/dialog/plugin.js	(revision 6781)
@@ -638,8 +638,15 @@
 					}, this._.editor );
 
+				this.fire( 'resize',
+					{
+						skin : this._.editor.skinName,
+						width : width,
+						height : height
+					}, this._.editor );
+
 				// Update dialog position when dimension get changed in RTL.
 				if ( this._.editor.lang.dir == 'rtl' && this._.position )
 					this._.position.x = CKEDITOR.document.getWindow().getViewPaneSize().width -
-						this._.contentSize.width - parseInt( this._.element.getFirst().getStyle( 'right' ) );
+						this._.contentSize.width - parseInt( this._.element.getFirst().getStyle( 'right' ), 10 );
 
 				this._.contentSize = { width : width, height : height };
@@ -748,6 +755,6 @@
 
 			// First, set the dialog to an appropriate size.
-			this.resize( this._.contentSize && this._.contentSize.width || definition.minWidth,
-					this._.contentSize && this._.contentSize.height || definition.minHeight );
+			this.resize( this._.contentSize && this._.contentSize.width || definition.width || definition.minWidth,
+					this._.contentSize && this._.contentSize.height || definition.height || definition.minHeight );
 
 			// Reset all inputs back to their default value.
@@ -952,5 +959,5 @@
 							expand : !!contents.expand,
 							padding : contents.padding,
-							style : contents.style || 'width: 100%;'
+							style : contents.style || 'width: 100%;height:100%'
 						}, pageHtml );
 
@@ -1276,5 +1283,5 @@
 			 * 	{
 			 * 		editor.addCommand( 'mydialog',new CKEDITOR.dialogCommand( 'mydialog' ) );
-			 *  
+			 *
 			 * 		if ( editor.contextMenu )
 			 * 		{
@@ -1291,5 +1298,5 @@
 			 * 			});
 			 * 		}
-			 *  
+			 *
 			 * 		<strong>CKEDITOR.dialog.add</strong>( 'mydialog', function( api )
 			 * 		{
@@ -1330,10 +1337,10 @@
 			 * 				}
 			 * 			};
-			 * 
+			 *
 			 * 			return dialogDefinition;
 			 * 		} );
 			 * 	}
 			 * } );
-			 * 
+			 *
 			 * CKEDITOR.replace( 'editor1', { extraPlugins : 'myplugin' } );
 			 */
@@ -1899,4 +1906,9 @@
 		currentCover;
 
+	function cancelEvent( ev )
+	{
+		ev.data.preventDefault(1);
+	}
+
 	function showCover( editor )
 	{
@@ -1958,4 +1970,8 @@
 			coverElement = CKEDITOR.dom.element.createFromHtml( html.join( '' ) );
 			coverElement.setOpacity( backgroundCoverOpacity != undefined ? backgroundCoverOpacity : 0.5 );
+
+			coverElement.on( 'keydown', cancelEvent );
+			coverElement.on( 'keypress', cancelEvent );
+			coverElement.on( 'keyup', cancelEvent );
 
 			coverElement.appendTo( CKEDITOR.document.getBody() );
@@ -3182,9 +3198,11 @@
 /**
  * Fired when a dialog is being resized. The event is fired on
- * the 'CKEDITOR.dialog' object, not a dialog instance.
+ * both the 'CKEDITOR.dialog' object and the dialog instance
+ * since 3.5.3, previously it's available only in the global object.
  * @name CKEDITOR.dialog#resize
  * @since 3.5
  * @event
- * @param {CKEDITOR.dialog} dialog The dialog being resized.
+ * @param {CKEDITOR.dialog} dialog The dialog being resized (if
+ * it's fired on the dialog itself, this parameter isn't sent).
  * @param {String} skin The skin name.
  * @param {Number} width The new width.
Index: /CKEditor/branches/features/bbcode/_source/plugins/domiterator/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/domiterator/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/domiterator/plugin.js	(revision 6781)
@@ -32,5 +32,7 @@
 	var beginWhitespaceRegex = /^[\r\n\t ]+$/,
 		// Ignore bookmark nodes.(#3783)
-		bookmarkGuard = CKEDITOR.dom.walker.bookmark( false, true );
+		bookmarkGuard = CKEDITOR.dom.walker.bookmark( false, true ),
+		whitespacesGuard = CKEDITOR.dom.walker.whitespaces( true ),
+		skipGuard = function( node ) { return bookmarkGuard( node ) && whitespacesGuard( node ); };
 
 	// Get a reference for the next element, bookmark nodes are skipped.
@@ -208,5 +210,5 @@
 				if ( range && !closeRange )
 				{
-					while ( !currentNode.getNext( bookmarkGuard ) && !isLast )
+					while ( !currentNode.getNext( skipGuard ) && !isLast )
 					{
 						var parentNode = currentNode.getParent();
@@ -216,5 +218,8 @@
 						{
 							closeRange = 1;
+							includeNode = 0;
 							isLast = isLast || ( parentNode.equals( lastNode) );
+							// Make sure range includes bookmarks at the end of the block. (#7359)
+							range.setEndAt( parentNode, CKEDITOR.POSITION_BEFORE_END );
 							break;
 						}
Index: /CKEditor/branches/features/bbcode/_source/plugins/elementspath/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/elementspath/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/elementspath/plugin.js	(revision 6781)
@@ -15,4 +15,5 @@
 		toolbarFocus :
 		{
+			editorFocus : false,
 			exec : function( editor )
 			{
Index: /CKEditor/branches/features/bbcode/_source/plugins/enterkey/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/enterkey/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/enterkey/plugin.js	(revision 6781)
@@ -76,5 +76,6 @@
 			{
 				previousBlock.breakParent( node );
-				range.moveToElementEditStart( previousBlock.getNext() );
+				node = previousBlock.getNext();
+				range.moveToElementEditStart( node );
 				previousBlock.move( previousBlock.getPrevious() );
 			}
@@ -111,4 +112,6 @@
 						// Otherwise, duplicate the previous block.
 						newBlock = previousBlock.clone();
+						// Value attribute of list item should not be duplicated (#7330).
+						newBlock.is( 'li' ) && newBlock.removeAttribute( 'value' );
 					}
 				}
@@ -118,7 +121,13 @@
 				if ( !newBlock )
 				{
-					newBlock = doc.createElement( blockTag );
-					if ( previousBlock && ( newBlockDir = previousBlock.getDirection() ) )
-						newBlock.setAttribute( 'dir', newBlockDir );
+					// We have already created a new list item. (#6849)
+					if ( node && node.is( 'li' ) )
+						newBlock = node;
+					else
+					{
+						newBlock = doc.createElement( blockTag );
+						if ( previousBlock && ( newBlockDir = previousBlock.getDirection() ) )
+							newBlock.setAttribute( 'dir', newBlockDir );
+					}
 				}
 				// Force the enter block unless we're talking of a list item.
@@ -151,5 +160,6 @@
 					newBlock.appendBogus();
 
-				range.insertNode( newBlock );
+				if ( !newBlock.getParent() )
+					range.insertNode( newBlock );
 
 				// This is tricky, but to make the new block visible correctly
@@ -266,27 +276,25 @@
 				range.insertNode( lineBreak );
 
-				// A text node is required by Gecko only to make the cursor blink.
-				// We need some text inside of it, so the bogus <br> is properly
-				// created.
-				if ( !CKEDITOR.env.ie )
-					doc.createText( '\ufeff' ).insertAfter( lineBreak );
-
-				// If we are at the end of a block, we must be sure the bogus node is available in that block.
-				if ( isEndOfBlock && !CKEDITOR.env.ie )
-					lineBreak.getParent().appendBogus();
-
-				// Now we can remove the text node contents, so the caret doesn't
-				// stop on it.
-				if ( !CKEDITOR.env.ie )
-					lineBreak.getNext().$.nodeValue = '';
 				// IE has different behavior regarding position.
 				if ( CKEDITOR.env.ie )
 					range.setStartAt( lineBreak, CKEDITOR.POSITION_AFTER_END );
 				else
+				{
+					// A text node is required by Gecko only to make the cursor blink.
+					// We need some text inside of it, so the bogus <br> is properly
+					// created.
+					doc.createText( '\ufeff' ).insertAfter( lineBreak );
+
+					// If we are at the end of a block, we must be sure the bogus node is available in that block.
+					if ( isEndOfBlock )
+						lineBreak.getParent().appendBogus();
+
+					// Now we can remove the text node contents, so the caret doesn't
+					// stop on it.
+					lineBreak.getNext().$.nodeValue = '';
+
 					range.setStartAt( lineBreak.getNext(), CKEDITOR.POSITION_AFTER_START );
 
-				// Scroll into view, for non IE.
-				if ( !CKEDITOR.env.ie )
-				{
+					// Scroll into view, for non IE.
 					var dummy = null;
 
@@ -364,5 +372,4 @@
 	}
 
-
 	function getRange( editor )
 	{
Index: /CKEditor/branches/features/bbcode/_source/plugins/forms/dialogs/hiddenfield.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/forms/dialogs/hiddenfield.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/forms/dialogs/hiddenfield.js	(revision 6781)
@@ -31,5 +31,7 @@
 				value = this.getValueOf( 'info', 'value' ),
 				editor = this.getParentEditor(),
-				element = CKEDITOR.env.ie ? editor.document.createElement( '<input name="' + CKEDITOR.tools.htmlEncode( name ) + '">' ) : editor.document.createElement( 'input' );
+				element = CKEDITOR.env.ie && !( CKEDITOR.document.$.documentMode >= 8 ) ?
+					editor.document.createElement( '<input name="' + CKEDITOR.tools.htmlEncode( name ) + '">' )
+					: editor.document.createElement( 'input' );
 
 			element.setAttribute( 'type', 'hidden' );
Index: /CKEditor/branches/features/bbcode/_source/plugins/htmldataprocessor/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/htmldataprocessor/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/htmldataprocessor/plugin.js	(revision 6781)
@@ -171,5 +171,5 @@
 								   {
 									   return node1.type == CKEDITOR.NODE_ELEMENT && node2.type == node1.type ?
-											tableOrder.indexOf( node1.name ) > tableOrder.indexOf( node2.name ) ? 1 : -1 : 0;
+											CKEDITOR.tools.indexOf( tableOrder, node1.name )  > CKEDITOR.tools.indexOf( tableOrder, node2.name ) ? 1 : -1 : 0;
 								   } );
 				},
@@ -429,5 +429,5 @@
 
 					// Avoid protecting over protected, e.g. /\{.*?\}/
-					return /cke_temp(comment)?/.test( match ) ? match
+					return ( /cke_temp(comment)?/ ).test( match ) ? match
 						: '<!--{cke_temp}' + ( protectedHtml.push( match ) - 1 ) + '-->';
 				});
@@ -449,6 +449,6 @@
 			{
 				store[ store.id ] = decodeURIComponent( data );
-				return '{cke_protected_'+ store.id++  + '}';
-			})
+				return '{cke_protected_'+ ( store.id++ )  + '}';
+			});
 		});
 	}
Index: /CKEditor/branches/features/bbcode/_source/plugins/image/dialogs/image.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/image/dialogs/image.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/image/dialogs/image.js	(revision 6781)
@@ -125,9 +125,8 @@
 				return null;
 
-			var ratioButton = CKEDITOR.document.getById( btnLockSizesId );
-
-			if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
+			// Check image ratio and original image ratio, but respecting user's preference.
+			if ( value == 'check' )
 			{
-				if ( value == 'check' )			// Check image ratio and original image ratio.
+				if ( !dialog.userlockRatio && oImageOriginal.getCustomData( 'isReady' ) == 'true'  )
 				{
 					var width = dialog.getValueOf( 'info', 'txtWidth' ),
@@ -145,12 +144,14 @@
 					}
 				}
-				else if ( value != undefined )
-					dialog.lockRatio = value;
-				else
-					dialog.lockRatio = !dialog.lockRatio;
 			}
-			else if ( value != 'check' )		// I can't lock ratio if ratio is unknown.
-				dialog.lockRatio = false;
-
+			else if ( value != undefined )
+				dialog.lockRatio = value;
+			else
+			{
+				dialog.userlockRatio = 1;
+				dialog.lockRatio = !dialog.lockRatio;
+			}
+
+			var ratioButton = CKEDITOR.document.getById( btnLockSizesId );
 			if ( dialog.lockRatio )
 				ratioButton.removeClass( 'cke_btn_unlocked' );
@@ -202,5 +203,5 @@
 			var dialog = this.getDialog(),
 				value = '',
-				dimension = (( this.id == 'txtWidth' )? 'width' : 'height' ),
+				dimension = this.id == 'txtWidth' ? 'width' : 'height',
 				size = element.getAttribute( dimension );
 
@@ -281,4 +282,5 @@
 
 				this.lockRatio = true;
+				this.userlockRatio = 0;
 				this.dontResetSize = false;
 				this.firstLoad = true;
@@ -341,10 +343,10 @@
 					// Fill out all fields.
 					this.setupContent( IMAGE, this.imageElement );
-
-					// Refresh LockRatio button
-					switchLockRatio ( this, true );
 				}
 				else
 					this.imageElement =  editor.document.createElement( 'img' );
+
+				// Refresh LockRatio button
+				switchLockRatio ( this, true );
 
 				// Dont show preview if no URL given.
@@ -425,9 +427,9 @@
 						if ( !this.linkEditMode )
 						{
-							editor.insertElement(this.linkElement);
-							this.linkElement.append(this.imageElement, false);
+							editor.insertElement( this.linkElement );
+							this.linkElement.append( this.imageElement, false );
 						}
 						else	 //Link already exists, image not.
-							editor.insertElement(this.imageElement );
+							editor.insertElement( this.imageElement );
 					}
 					else
@@ -646,8 +648,9 @@
 															validate : function()
 															{
-																var aMatch  =  this.getValue().match( regexGetSizeOrEmpty );
-																if ( !aMatch )
+																var aMatch  =  this.getValue().match( regexGetSizeOrEmpty ),
+																	isValid = !!( aMatch && parseInt( aMatch[1], 10 ) !== 0 );
+																if ( !isValid )
 																	alert( editor.lang.common.invalidWidth );
-																return !!aMatch;
+																return isValid;
 															},
 															setup : setupDimension,
@@ -659,5 +662,5 @@
 																	if ( value )
 																		element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) );
-																	else if ( !value && this.isChanged( ) )
+																	else
 																		element.removeStyle( 'width' );
 
@@ -695,8 +698,9 @@
 															validate : function()
 															{
-																var aMatch = this.getValue().match( regexGetSizeOrEmpty );
-																if ( !aMatch )
+																var aMatch = this.getValue().match( regexGetSizeOrEmpty ),
+																	isValid = !!( aMatch && parseInt( aMatch[1], 10 ) !== 0 );
+																if ( !isValid )
 																	alert( editor.lang.common.invalidHeight );
-																return !!aMatch;
+																return isValid;
 															},
 															setup : setupDimension,
@@ -708,9 +712,8 @@
 																	if ( value )
 																		element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) );
-																	else if ( !value && this.isChanged( ) )
+																	else
 																		element.removeStyle( 'height' );
 
-																	if ( !internalCommit && type == IMAGE )
-																		element.removeAttribute( 'height' );
+																	!internalCommit && element.removeAttribute( 'height' );
 																}
 																else if ( type == PREVIEW )
@@ -746,8 +749,8 @@
 														if ( resetButton )
 														{
-															resetButton.on( 'click', function(evt)
+															resetButton.on( 'click', function( evt )
 																{
 																	resetSize( this );
-																	evt.data.preventDefault();
+																	evt.data && evt.data.preventDefault();
 																}, this.getDialog() );
 															resetButton.on( 'mouseover', function()
Index: /CKEditor/branches/features/bbcode/_source/plugins/keystrokes/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/keystrokes/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/keystrokes/plugin.js	(revision 6781)
@@ -211,5 +211,5 @@
 	[ CKEDITOR.CTRL + 85 /*U*/, 'underline' ],
 
-	[ CKEDITOR.ALT + 109 /*-*/, 'toolbarCollapse' ],
+	[ CKEDITOR.ALT + ( CKEDITOR.env.ie || CKEDITOR.env.webkit ? 189 : 109 ) /*-*/, 'toolbarCollapse' ],
 	[ CKEDITOR.ALT + 48 /*0*/, 'a11yHelp' ]
 ];
Index: /CKEditor/branches/features/bbcode/_source/plugins/link/dialogs/anchor.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/link/dialogs/anchor.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/link/dialogs/anchor.js	(revision 6781)
@@ -27,5 +27,5 @@
 			// Always create a new anchor, because of IE BUG.
 			var name = this.getValueOf( 'info', 'txtName' ),
-				element = CKEDITOR.env.ie ?
+				element = CKEDITOR.env.ie && !( CKEDITOR.document.$.documentMode >= 8 ) ?
 				editor.document.createElement( '<a name="' + CKEDITOR.tools.htmlEncode( name ) + '">' ) :
 				editor.document.createElement( 'a' );
Index: /CKEditor/branches/features/bbcode/_source/plugins/link/dialogs/link.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/link/dialogs/link.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/link/dialogs/link.js	(revision 6781)
@@ -197,5 +197,6 @@
 					while ( ( featureMatch = popupFeaturesRegex.exec( onclickMatch[2] ) ) )
 					{
-						if ( featureMatch[2] == 'yes' || featureMatch[2] == '1' )
+						// Some values should remain numbers (#7300)
+						if ( ( featureMatch[2] == 'yes' || featureMatch[2] == '1' ) && !( featureMatch[1] in { height:1, width:1, top:1, left:1 } ) )
 							retval.target[ featureMatch[1] ] = true;
 						else if ( isFinite( featureMatch[2] ) )
@@ -1352,5 +1353,5 @@
 				// IE BUG: Setting the name attribute to an existing link doesn't work.
 				// Must re-create the link from weired syntax to workaround.
-				if ( CKEDITOR.env.ie && attributes.name != element.getAttribute( 'name' ) )
+				if ( CKEDITOR.env.ie && !( CKEDITOR.document.$.documentMode >= 8 ) && attributes.name != element.getAttribute( 'name' ) )
 				{
 					var newElement = new CKEDITOR.dom.element( '<a name="' + CKEDITOR.tools.htmlEncode( attributes.name ) + '">',
Index: /CKEditor/branches/features/bbcode/_source/plugins/list/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/list/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/list/plugin.js	(revision 6781)
@@ -38,4 +38,8 @@
 			{
 				var listItem = listNode.getChild( i );
+
+				// Fixing malformed nested lists by moving it into a previous list item. (#6236)
+				if( listItem.type == CKEDITOR.NODE_ELEMENT && listItem.getName() in CKEDITOR.dtd.$list )
+					CKEDITOR.plugins.list.listToArray( listItem, database, baseArray, baseIndentLevel + 1 );
 
 				// It may be a text node or some funny stuff.
@@ -84,4 +88,5 @@
 				indentLevel = Math.max( listArray[ baseIndex ].indent, 0 ),
 				currentListItem = null,
+				itemDir,
 				paragraphName = ( paragraphMode == CKEDITOR.ENTER_P ? 'p' : 'div' );
 			while ( 1 )
@@ -103,5 +108,9 @@
 				else if ( item.indent == Math.max( indentLevel, 0 ) + 1 )
 				{
-					var listData = CKEDITOR.plugins.list.arrayToList( listArray, null, currentIndex, paragraphMode );
+					// Maintain original direction (#6861).
+					var orgDir = item.element.getDirection( 1 ),
+						currDir = listArray[ currentIndex - 1 ].element.getDirection( 1 ),
+						listData = CKEDITOR.plugins.list.arrayToList( listArray, null, currentIndex, paragraphMode,
+						currDir != orgDir ? orgDir: null );
 
 					// If the next block is an <li> with another list tree as the first
@@ -115,7 +124,11 @@
 				else if ( item.indent == -1 && !baseIndex && item.grandparent )
 				{
-					currentListItem;
 					if ( listNodeNames[ item.grandparent.getName() ] )
+					{
 						currentListItem = item.element.clone( false, true );
+						itemDir = item.element.getDirection( 1 );
+						item.grandparent.getDirection( 1 ) != itemDir &&
+							currentListItem.setAttribute( 'dir', itemDir );
+					}
 					else
 					{
@@ -125,5 +138,5 @@
 							currentListItem = doc.createElement( paragraphName );
 							item.element.copyAttributes( currentListItem, { type:1, value:1 } );
-							var itemDir = item.element.getDirection() || dir;
+							itemDir = item.element.getDirection() || dir;
 							itemDir &&
 								currentListItem.setAttribute( 'dir', itemDir );
@@ -445,7 +458,6 @@
 		exec : function( editor )
 		{
-			editor.focus();
-
 			var doc = editor.document,
+				config = editor.config,
 				selection = editor.getSelection(),
 				ranges = selection && selection.getRanges( true );
@@ -461,19 +473,10 @@
 			{
 				var body = doc.getBody();
-				body.trim();
-				if ( !body.getFirst() )
-				{
-					var paragraph = doc.createElement( editor.config.enterMode == CKEDITOR.ENTER_P ? 'p' :
-							( editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'br' ) );
-					paragraph.appendTo( body );
-					ranges = new CKEDITOR.dom.rangeList( [ new CKEDITOR.dom.range( doc ) ] );
-					// IE exception on inserting anything when anchor inside <br>.
-					if ( paragraph.is( 'br' ) )
-					{
-						ranges[ 0 ].setStartBefore( paragraph );
-						ranges[ 0 ].setEndAfter( paragraph );
-					}
-					else
-						ranges[ 0 ].selectNodeContents( paragraph );
+				if ( !body.getFirst( nonEmpty ) )
+				{
+					config.enterMode == CKEDITOR.ENTER_BR ?
+						body.appendBogus() :
+						ranges[ 0 ].fixBlock( 1, config.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' );
+
 					selection.selectRanges( ranges );
 				}
Index: /CKEditor/branches/features/bbcode/_source/plugins/listblock/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/listblock/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/listblock/plugin.js	(revision 6781)
@@ -251,10 +251,4 @@
 								0 );
 						}
-						// Blur any previously focused list item. (#6671)
-						else
-						{
-							var self = this;
-							setTimeout( function() { self.element.focus(); }, 0 );
-						}
 					}
 				}
Index: /CKEditor/branches/features/bbcode/_source/plugins/maximize/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/maximize/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/maximize/plugin.js	(revision 6781)
@@ -204,5 +204,5 @@
 							mainDocument.getDocumentElement().setStyles( styles );
 							!CKEDITOR.env.gecko && mainDocument.getDocumentElement().setStyle( 'position', 'fixed' );
-							mainDocument.getBody().setStyles( styles );
+							!( CKEDITOR.env.gecko && CKEDITOR.env.quirks ) && mainDocument.getBody().setStyles( styles );
 
 							// Scroll to the top left (IE needs some time for it - #4923).
@@ -212,5 +212,6 @@
 
 							// Resize and move to top left.
-							container.setStyle( 'position', 'absolute' );
+							// Special treatment for FF Quirks (#7284)
+							container.setStyle( 'position', CKEDITOR.env.gecko && CKEDITOR.env.quirks ? 'fixed' : 'absolute' );
 							container.$.offsetLeft;			// SAFARI BUG: See #2066.
 							container.setStyles(
Index: /CKEditor/branches/features/bbcode/_source/plugins/newpage/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/newpage/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/newpage/plugin.js	(revision 6781)
@@ -30,4 +30,5 @@
 								command: command
 							} );
+							editor.selectionChange();
 
 						}, 200 );
Index: /CKEditor/branches/features/bbcode/_source/plugins/pastefromword/filter/default.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/pastefromword/filter/default.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/pastefromword/filter/default.js	(revision 6781)
@@ -119,4 +119,54 @@
 	};
 
+	// 1. move consistent list item styles up to list root.
+	// 2. clear out unnecessary list item numbering.
+	function postProcessList( list )
+	{
+		var children = list.children,
+			child,
+			attrs,
+			count = list.children.length,
+			match,
+			mergeStyle,
+			styleTypeRegexp = /list-style-type:(.*?)(?:;|$)/,
+			stylesFilter = CKEDITOR.plugins.pastefromword.filters.stylesFilter;
+
+		attrs = list.attributes;
+		if ( styleTypeRegexp.exec( attrs.style ) )
+			return;
+
+		for ( var i = 0; i < count; i++ )
+		{
+			child = children[ i ];
+
+			if ( child.attributes.value && Number( child.attributes.value ) == i + 1 )
+				delete child.attributes.value;
+
+			match = styleTypeRegexp.exec( child.attributes.style );
+
+			if ( match )
+			{
+				if ( match[ 1 ] == mergeStyle || !mergeStyle )
+					mergeStyle = match[ 1 ];
+				else
+				{
+					mergeStyle = null;
+					break;
+				}
+			}
+		}
+
+		if ( mergeStyle )
+		{
+			for ( i = 0; i < count; i++ )
+			{
+				attrs = children[ i ].attributes;
+				attrs.style && ( attrs.style = stylesFilter( [ [ 'list-style-type'] ] )( attrs.style ) || '' );
+			}
+
+			list.addStyle( 'list-style-type', mergeStyle );
+		}
+	}
+
 	var cssLengthRelativeUnit = /^([.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz){1}?/i;
 	var emptyMarginRegex = /^(?:\b0[^\s]*\s*){1,4}$/;		// e.g. 0px 0pt 0px
@@ -125,62 +175,49 @@
 		upperRomanLiteralRegex = new RegExp( romanLiternalPattern.toUpperCase() );
 
+	var orderedPatterns = { 'decimal' : /\d+/, 'lower-roman': lowerRomanLiteralRegex, 'upper-roman': upperRomanLiteralRegex, 'lower-alpha' : /^[a-z]+$/, 'upper-alpha': /^[A-Z]+$/ },
+		unorderedPatterns = { 'disc' : /[l\u00B7\u2002]/, 'circle' : /[\u006F\u00D8]/,'square' : /[\u006E\u25C6]/},
+		listMarkerPatterns = { 'ol' : orderedPatterns, 'ul' : unorderedPatterns },
+		romans = [ [1000, 'M'], [900, 'CM'], [500, 'D'], [400, 'CD'], [100, 'C'], [90, 'XC'], [50, 'L'], [40, 'XL'], [10, 'X'], [9, 'IX'], [5, 'V'], [4, 'IV'], [1, 'I'] ],
+		alpahbets = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+	// Convert roman numbering back to decimal.
+	function fromRoman( str )
+	 {
+		 str = str.toUpperCase();
+		 var l = romans.length, retVal = 0;
+		 for ( var i = 0; i < l; ++i )
+		 {
+			 for ( var j = romans[i], k = j[1].length; str.substr( 0, k ) == j[1]; str = str.substr( k ) )
+				 retVal += j[ 0 ];
+		 }
+		 return retVal;
+	 }
+
+	// Convert alphabet numbering back to decimal.
+	function fromAlphabet( str )
+	{
+		str = str.toUpperCase();
+		var l = alpahbets.length, retVal = 1;
+		for ( var x = 1; str.length > 0; x *= l )
+		{
+			retVal += alpahbets.indexOf( str.charAt( str.length - 1 ) ) * x;
+			str = str.substr( 0, str.length - 1 );
+		}
+		return retVal;
+	}
+
 	var listBaseIndent = 0,
-		 previousListItemMargin;
-
-	CKEDITOR.plugins.pastefromword =
+		previousListItemMargin = null,
+		previousListId;
+
+	var plugin = ( CKEDITOR.plugins.pastefromword =
 	{
 		utils :
 		{
 			// Create a <cke:listbullet> which indicate an list item type.
-			createListBulletMarker : function ( bulletStyle, bulletText )
+			createListBulletMarker : function ( bullet, bulletText )
 			{
-				var marker = new CKEDITOR.htmlParser.element( 'cke:listbullet' ),
-					listType;
-
-				// TODO: Support more list style type from MS-Word.
-				if ( !bulletStyle )
-				{
-					bulletStyle = 'decimal';
-					listType = 'ol';
-				}
-				else if ( bulletStyle[ 2 ] )
-				{
-					if ( !isNaN( bulletStyle[ 1 ] ) )
-						bulletStyle = 'decimal';
-					else if ( lowerRomanLiteralRegex.test( bulletStyle[ 1 ] ) )
-						bulletStyle = 'lower-roman';
-					else if ( upperRomanLiteralRegex.test( bulletStyle[ 1 ] ) )
-						bulletStyle = 'upper-roman';
-					else if ( /^[a-z]+$/.test( bulletStyle[ 1 ] ) )
-						bulletStyle = 'lower-alpha';
-					else if ( /^[A-Z]+$/.test( bulletStyle[ 1 ] ) )
-						bulletStyle = 'upper-alpha';
-					// Simply use decimal for the rest forms of unrepresentable
-					// numerals, e.g. Chinese...
-					else
-						bulletStyle = 'decimal';
-
-					listType = 'ol';
-				}
-				else
-				{
-					if ( /[l\u00B7\u2002]/.test( bulletStyle[ 1 ] ) )
-						bulletStyle = 'disc';
-					else if ( /[\u006F\u00D8]/.test( bulletStyle[ 1 ] ) )
-						bulletStyle = 'circle';
-					else if ( /[\u006E\u25C6]/.test( bulletStyle[ 1 ] ) )
-						bulletStyle = 'square';
-					else
-						bulletStyle = 'disc';
-
-					listType = 'ul';
-				}
-
-				// Represent list type as CSS style.
-				marker.attributes =
-				{
-					'cke:listtype' : listType,
-					'style' : 'list-style-type:' + bulletStyle + ';'
-				};
+				var marker = new CKEDITOR.htmlParser.element( 'cke:listbullet' );
+				marker.attributes = { 'cke:listsymbol' : bullet[ 0 ] };
 				marker.add( new CKEDITOR.htmlParser.text( bulletText ) );
 				return marker;
@@ -208,6 +245,6 @@
 
 				if ( ( listMarker = element.removeAnyChildWithName( 'cke:listbullet' ) )
-					  && listMarker.length
-					  && ( listMarker = listMarker[ 0 ] ) )
+						&& listMarker.length
+						&& ( listMarker = listMarker[ 0 ] ) )
 				{
 					element.name = 'cke:li';
@@ -215,34 +252,56 @@
 					if ( attrs.style )
 					{
-						attrs.style = CKEDITOR.plugins.pastefromword.filters.stylesFilter(
+						attrs.style = plugin.filters.stylesFilter(
 								[
 									// Text-indent is not representing list item level any more.
 									[ 'text-indent' ],
 									[ 'line-height' ],
-									// Resolve indent level from 'margin-left' value.
+									// First attempt is to resolve indent level from on a constant margin increment.
 									[ ( /^margin(:?-left)?$/ ), null, function( margin )
 									{
-										// Be able to deal with component/short-hand form style.
+										// Deal with component/short-hand form.
 										var values = margin.split( ' ' );
-										margin = CKEDITOR.plugins.pastefromword.utils.convertToPx( values[ 3 ] || values[ 1 ] || values [ 0 ] );
+										margin = plugin.utils.convertToPx( values[ 3 ] || values[ 1 ] || values [ 0 ] );
 										margin = parseInt( margin, 10 );
 
-										// Figure out the indent unit by looking at the first increament.
-										if ( !listBaseIndent && previousListItemMargin && margin > previousListItemMargin )
+										// Figure out the indent unit by checking the first time of incrementation.
+										if ( !listBaseIndent && previousListItemMargin !== null && margin > previousListItemMargin )
 											listBaseIndent = margin - previousListItemMargin;
 
-										attrs[ 'cke:margin' ] = previousListItemMargin = margin;
+										previousListItemMargin = margin;
+
+										attrs[ 'cke:indent' ] = listBaseIndent && ( Math.ceil( margin / listBaseIndent ) + 1 ) || 1;
+									} ],
+									// The best situation: "mso-list:l0 level1 lfo2" tells the belonged list root, list item indentation, etc.
+									[ ( /^mso-list$/ ), null, function( val )
+									{
+										val = val.split( ' ' );
+										var listId = Number( val[ 0 ].match( /\d+/ ) ),
+											indent = Number( val[ 1 ].match( /\d+/ ) );
+
+										listId !== previousListId && ( attrs[ 'cke:reset' ] = 1 );
+										previousListId = listId;
+										attrs[ 'cke:indent' ] = indent;
 									} ]
-							] )( attrs.style, element ) || '' ;
+								] )( attrs.style, element ) || '';
 					}
 
-					// Inherit list-type-style from bullet.
-					var listBulletAttrs = listMarker.attributes,
-						listBulletStyle = listBulletAttrs.style;
-
-					element.addStyle( listBulletStyle );
-					CKEDITOR.tools.extend( attrs, listBulletAttrs );
+					// First level list item might be presented without a margin.
+
+
+					// In case all above doesn't apply.
+					if ( !attrs[ 'cke:indent' ] )
+					{
+						previousListItemMargin = 0;
+						attrs[ 'cke:indent' ] = 1;
+					}
+
+					// Inherit attributes from bullet.
+					CKEDITOR.tools.extend( attrs, listMarker.attributes );
 					return true;
 				}
+				// Current list disconnected.
+				else
+					previousListId = previousListItemMargin = listBaseIndent = null;
 
 				return false;
@@ -310,5 +369,5 @@
 					while ( parent )
 					{
-						parent.attributes && parent.attributes[ 'cke:list'] && indentLevel++;
+						parent.attributes && parent.attributes[ 'cke:list' ] && indentLevel++;
 						parent = parent.parent;
 					}
@@ -349,8 +408,27 @@
 
 							child.name = 'cke:li';
+
+							// Inherit numbering from list root on the first list item.
+							attrs.start && !i && ( attributes.value = attrs.start );
+
+							plugin.filters.stylesFilter(
+								[
+								    [ 'tab-stops', null, function( val )
+									{
+										var margin = val.split( ' ' )[ 1 ].match( cssLengthRelativeUnit );
+										margin && ( previousListItemMargin = parseInt( plugin.utils.convertToPx( margin[ 0 ] ), 10 ) );
+									} ],
+									[ 'mso-list', null, function( val )
+									{
+										val = val.split( ' ' );
+										var listId = Number( val[ 0 ].match( /\d+/ ) );
+										listId !== previousListId && ( attributes[ 'cke:reset' ] = 1 );
+										previousListId = listId;
+									} ]
+								] )( attributes.style );
+
 							attributes[ 'cke:indent' ] = indentLevel;
-							previousListItemMargin = 0;
 							attributes[ 'cke:listtype' ] = element.name;
-							listStyleType && child.addStyle( 'list-style-type', listStyleType, true );
+							attributes[ 'cke:list-style-type' ] = listStyleType;
 						}
 					}
@@ -372,9 +450,17 @@
 							listItem,   // The current processing cke:li element.
 							listItemAttrs,
-							listType,   // Determine the root type of the list.
 							listItemIndent, // Indent level of current list item.
+							lastIndent,
 							lastListItem, // The previous one just been added to the list.
-							list, parentList, // Current staging list and it's parent list if any.
-							indent;
+							list, // Current staging list and it's parent list if any.
+							openedLists = [],
+							previousListStyleType,
+							previousListType;
+
+					// Properties of the list item are to be resolved from the list bullet.
+					var bullet,
+						listType,
+						listStyleType,
+						itemNumeric;
 
 					for ( var i = 0; i < children.length; i++ )
@@ -387,25 +473,110 @@
 							listItem = child;
 							listItemAttrs = listItem.attributes;
-							listType = listItem.attributes[ 'cke:listtype' ];
+							bullet = listItemAttrs[ 'cke:listsymbol' ];
+							bullet = bullet && bullet.match( /^(?:[(]?)([^\s]+?)([.)]?)$/ );
+							listType = listStyleType = itemNumeric = null;
+
+							if ( listItemAttrs[ 'cke:ignored' ] )
+							{
+								children.splice( i--, 1 );
+								continue;
+							}
+
+
+							// This's from a new list root.
+							listItemAttrs[ 'cke:reset' ] && ( list = lastIndent = lastListItem = null );
 
 							// List item indent level might come from a real list indentation or
 							// been resolved from a pseudo list item's margin value, even get
 							// no indentation at all.
-							listItemIndent = parseInt( listItemAttrs[ 'cke:indent' ], 10 )
-													|| listBaseIndent && ( Math.ceil( listItemAttrs[ 'cke:margin' ] / listBaseIndent ) )
-													|| 1;
-
-							// Ignore the 'list-style-type' attribute if it's matched with
-							// the list root element's default style type.
-							listItemAttrs.style && ( listItemAttrs.style =
-							        CKEDITOR.plugins.pastefromword.filters.stylesFilter(
-									[
-										[ 'list-style-type', listType == 'ol' ? 'decimal' : 'disc' ]
-									] )( listItemAttrs.style )
-									|| '' );
-
+							listItemIndent = Number( listItemAttrs[ 'cke:indent' ] );
+
+							// We're moving out of the current list, cleaning up.
+							if ( listItemIndent != lastIndent )
+								previousListType = previousListStyleType = null;
+
+							// List type and item style are already resolved.
+							if ( !bullet )
+							{
+								listType = listItemAttrs[ 'cke:listtype' ] || 'ol';
+								listStyleType = listItemAttrs[ 'cke:list-style-type' ];
+							}
+							else
+							{
+								// Probably share the same list style type with previous list item,
+								// give it priority to avoid ambiguous between C(Alpha) and C.(Roman).
+								if ( previousListType && listMarkerPatterns[ previousListType ] [ previousListStyleType ].test( bullet[ 1 ] ) )
+								{
+									listType = previousListType;
+									listStyleType = previousListStyleType;
+								}
+								else
+								{
+									for ( var type in listMarkerPatterns )
+									{
+										for ( var style in listMarkerPatterns[ type ] )
+										{
+											if ( listMarkerPatterns[ type ][ style ].test( bullet[ 1 ] ) )
+											{
+												// Small numbering has higher priority, when dealing with ambiguous
+												// between C(Alpha) and C.(Roman).
+												if ( type == 'ol' && ( /alpha|roman/ ).test( style ) )
+												{
+													var num = /roman/.test( style ) ? fromRoman( bullet[ 1 ] ) : fromAlphabet( bullet[ 1 ] );
+													if ( !itemNumeric || num < itemNumeric )
+													{
+														itemNumeric = num;
+														listType = type;
+														listStyleType = style;
+													}
+												}
+												else
+												{
+													listType = type;
+													listStyleType = style;
+													break;
+												}
+											}
+										}
+									}
+								}
+
+								// Simply use decimal/disc for the rest forms of unrepresentable
+								// numerals, e.g. Chinese..., but as long as there a second part
+								// included, it has a bigger chance of being a order list ;)
+								!listType && ( listType = bullet[ 2 ] ? 'ol' : 'ul' );
+							}
+
+							previousListType = listType;
+							previousListStyleType = listStyleType || ( listType == 'ol' ? 'decimal' : 'disc' );
+							if ( listStyleType && listStyleType != ( listType == 'ol' ? 'decimal' : 'disc' ) )
+								listItem.addStyle( 'list-style-type', listStyleType );
+
+							// Figure out start numbering.
+							if ( listType == 'ol' && bullet )
+							{
+								switch ( listStyleType )
+								{
+									case 'decimal' :
+										itemNumeric = Number( bullet[ 1 ] );
+										break;
+									case 'lower-roman':
+									case 'upper-roman':
+										itemNumeric = fromRoman( bullet[ 1 ] );
+										break;
+									case 'lower-alpha':
+									case 'upper-alpha':
+										itemNumeric = fromAlphabet( bullet[ 1 ] );
+										break;
+								}
+
+								// Always create the numbering, swipe out unnecessary ones later.
+								listItem.attributes.value = itemNumeric;
+							}
+
+							// Start the list construction.
 							if ( !list )
 							{
-								list = new CKEDITOR.htmlParser.element( listType );
+								openedLists.push( list = new CKEDITOR.htmlParser.element( listType ) );
 								list.add( listItem );
 								children[ i ] = list;
@@ -413,15 +584,15 @@
 							else
 							{
-								if ( listItemIndent > indent )
+								if ( listItemIndent > lastIndent )
 								{
-									list = new CKEDITOR.htmlParser.element( listType );
+									openedLists.push( list = new CKEDITOR.htmlParser.element( listType ) );
 									list.add( listItem );
 									lastListItem.add( list );
 								}
-								else if ( listItemIndent < indent )
+								else if ( listItemIndent < lastIndent )
 								{
 									// There might be a negative gap between two list levels. (#4944)
-									var diff = indent - listItemIndent,
-										parent;
+									var diff = lastIndent - listItemIndent,
+											parent;
 									while ( diff-- && ( parent = list.parent ) )
 										list = parent.parent;
@@ -436,11 +607,14 @@
 
 							lastListItem = listItem;
-							indent = listItemIndent;
-						}
-						else
-							list = null;
+							lastIndent = listItemIndent;
+						}
+						else if ( list )
+							list = lastIndent = lastListItem = null;
 					}
 
-					listBaseIndent = 0;
+					for ( i = 0; i < openedLists.length; i++ )
+						postProcessList( openedLists[ i ] );
+
+					list = lastIndent = lastListItem = previousListId = previousListItemMargin = listBaseIndent = null;
 				},
 
@@ -468,5 +642,5 @@
 						// from MS-Word which confused the following regexp. e.g.
 						//'font-family: &quot;Lucida, Console&quot;'
-						 styleText
+						( styleText || '' )
 							.replace( /&quot;/g, '"' )
 							.replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
@@ -756,4 +930,18 @@
 					'p' : function( element )
 					{
+						// This's a fall-back approach to recognize list item in FF3.6,
+						// as it's not perfect as not all list style (e.g. "heading list") is shipped
+						// with this pattern. (#6662)
+						if ( /MsoListParagraph/.exec( element.attributes[ 'class' ] ) )
+						{
+							var bulletText = element.firstChild( function( node )
+							{
+								return node.type == CKEDITOR.NODE_TEXT && !containsNothingButSpaces( node.parent );
+							});
+							var bullet = bulletText && bulletText.parent,
+								bulletAttrs = bullet && bullet.attributes;
+							bulletAttrs && !bulletAttrs.style && ( bulletAttrs.style = 'mso-list: Ignore;' );
+						}
+
 						element.filterChildren();
 
@@ -808,6 +996,6 @@
 					'font' : function( element )
 					{
-						// IE/Safari: drop the font tag if it comes from list bullet text.
-						if ( !CKEDITOR.env.gecko && isListBulletIndicator( element.parent ) )
+						// Drop the font tag if it comes from list bullet text.
+						if ( isListBulletIndicator( element.parent ) )
 						{
 							delete element.name;
@@ -860,6 +1048,6 @@
 					'span' : function( element )
 					{
-						// IE/Safari: remove the span if it comes from list bullet text.
-						if ( !CKEDITOR.env.gecko && isListBulletIndicator( element.parent ) )
+						// Remove the span if it comes from list bullet text.
+						if ( isListBulletIndicator( element.parent ) )
 							return false;
 
@@ -871,7 +1059,7 @@
 						}
 
-						// For IE/Safari: List item bullet type is supposed to be indicated by
+						// List item bullet type is supposed to be indicated by
 						// the text of a span with style 'mso-list : Ignore' or an image.
-						if ( !CKEDITOR.env.gecko && isListBulletIndicator( element ) )
+						if ( isListBulletIndicator( element ) )
 						{
 							var listSymbolNode = element.firstChild( function( node )
@@ -881,6 +1069,16 @@
 
 							var listSymbol =  listSymbolNode && ( listSymbolNode.value || 'l.' ),
-								listType = listSymbol.match( /^([^\s]+?)([.)]?)$/ );
-							return createListBulletMarker( listType, listSymbol );
+								listType = listSymbol && listSymbol.match( /^(?:[(]?)([^\s]+?)([.)]?)$/ );
+
+							if ( listType )
+							{
+								var marker = createListBulletMarker( listType, listSymbol );
+								// Some non-existed list items might be carried by an inconsequential list, indicate by "mso-hide:all/display:none",
+								// those are to be removed later, now mark it with "cke:ignored".
+								var ancestor = element.getAncestor( 'span' );
+								if ( ancestor && (/ mso-hide:\s*all|display:\s*none /).test( ancestor.attributes.style ) )
+									marker.attributes[ 'cke:ignored' ] = 1;
+								return marker;
+							}
 						}
 
@@ -928,5 +1126,5 @@
 						if ( element.getAncestor( /h\d/ ) && !config.pasteFromWordNumberedHeadingToList )
 							delete element.name;
-						}
+					}
 				},
 
@@ -950,4 +1148,7 @@
 					// be the ones that could later be altered with editor tools.
 					[
+						// Leave list-style-type
+						[ ( /^list-style-type$/ ), null ],
+
 						// Preserve margin-left/right which used as default indent style in the editor.
 						[ ( /^margin$|^margin-(?!bottom|top)/ ), null, function( value, element, name )
@@ -1056,5 +1257,5 @@
 								// Bullet symbol could be either text or an image.
 								var listSymbol = listInfo[ 1 ] || ( imageInfo && 'l.' ),
-									listType = listSymbol && listSymbol.match( />([^\s]+?)([.)]?)</ );
+									listType = listSymbol && listSymbol.match( />(?:[(]?)([^\s]+?)([.)]?)</ );
 								return createListBulletMarker( listType, listSymbol );
 							}
@@ -1079,5 +1280,5 @@
 			};
 		}
-	};
+	});
 
 	// The paste processor here is just a reduced copy of html data processor.
Index: /CKEditor/branches/features/bbcode/_source/plugins/pastefromword/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/pastefromword/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/pastefromword/plugin.js	(revision 6781)
@@ -5,4 +5,6 @@
 (function()
 {
+	function forceHtmlMode( evt ) { evt.data.mode = 'html'; }
+
 	CKEDITOR.plugins.add( 'pastefromword',
 	{
@@ -13,7 +15,9 @@
 			// pasting.
 			var forceFromWord = 0;
-			var resetFromWord = function()
+			var resetFromWord = function( evt )
 				{
-					setTimeout( function() { forceFromWord = 0; }, 0 );
+					evt && evt.removeListener();
+					editor.removeListener( 'beforePaste', forceHtmlMode );
+					forceFromWord && setTimeout( function() { forceFromWord = 0; }, 0 );
 				};
 
@@ -27,15 +31,23 @@
 				exec : function()
 				{
+					// Ensure the received data format is HTML and apply content filtering. (#6718)
 					forceFromWord = 1;
-					if ( editor.execCommand( 'paste' ) === false )
+					editor.on( 'beforePaste', forceHtmlMode );
+
+					if ( editor.execCommand( 'paste', 'html' ) === false )
 					{
-						editor.on( 'dialogHide', function ( evt )
-							{
-								evt.removeListener();
-								resetFromWord();
-							});
+						editor.on( 'dialogShow', function ( evt )
+						{
+							evt.removeListener();
+							evt.data.on( 'cancel', resetFromWord );
+						});
+
+						editor.on( 'dialogHide', function( evt )
+						{
+							evt.data.removeListener( 'cancel', resetFromWord );
+						} );
 					}
-					else
-						resetFromWord();
+
+					editor.on( 'afterPaste', resetFromWord );
 				}
 			});
Index: /CKEditor/branches/features/bbcode/_source/plugins/pastetext/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/pastetext/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/pastetext/plugin.js	(revision 6781)
@@ -59,5 +59,7 @@
 				editor.on( 'beforeCommandExec', function ( evt )
 				{
-					if ( evt.data.name == 'paste' )
+					var mode = evt.data.commandData;
+					// Do NOT overwrite if HTML format is explicitly requested.
+					if ( evt.data.name == 'paste' && mode != 'html' )
 					{
 						editor.execCommand( 'pastetext' );
@@ -65,4 +67,9 @@
 					}
 				}, null, null, 0 );
+
+				editor.on( 'beforePaste', function( evt )
+				{
+					evt.data.mode = 'text';
+				});
 			}
 
@@ -83,4 +90,5 @@
  * editor, loosing any formatting information possibly available in the source
  * text.
+ * <strong>Note:</strong> paste from word is not affected by this configuration.
  * @name CKEDITOR.config.forcePasteAsPlainText
  * @type Boolean
Index: /CKEditor/branches/features/bbcode/_source/plugins/richcombo/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/richcombo/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/richcombo/plugin.js	(revision 6781)
@@ -198,5 +198,5 @@
 							'<span id="' + id + '_text" class="cke_text cke_inline_label">' + this.label + '</span>' +
 						'</span>' +
-						'<span class=cke_openbutton>' + ( CKEDITOR.env.hc ? '<span>&#9660;</span>' : CKEDITOR.env.air ?  '&nbsp;' : '' ) + '</span>' +	// BLACK DOWN-POINTING TRIANGLE
+						'<span class=cke_openbutton><span class=cke_icon>' + ( CKEDITOR.env.hc ? '&#9660;' : CKEDITOR.env.air ?  '&nbsp;' : '' ) + '</span></span>' +	// BLACK DOWN-POINTING TRIANGLE
 					'</a>' +
 				'</span>' +
Index: /CKEditor/branches/features/bbcode/_source/plugins/scayt/dialogs/options.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/scayt/dialogs/options.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/scayt/dialogs/options.js	(revision 6781)
@@ -9,5 +9,6 @@
 		captions,
 		doc = CKEDITOR.document,
-		tags = [],
+		editorName = editor.name,
+		tags = CKEDITOR.plugins.scayt.getUiTabs( editor ),
 		i,
 		contents = [],
@@ -15,7 +16,7 @@
 		dic_buttons = [
 			// [0] contains buttons for creating
-			"dic_create,dic_restore",
+			"dic_create_" + editorName + ",dic_restore_" + editorName,
 			// [1] contains buton for manipulation
-			"dic_rename,dic_delete"
+			"dic_rename_" + editorName + ",dic_delete_" + editorName
 		],
 		optionsIds = [ 'mixedCase', 'mixedWithDigits', 'allCaps', 'ignoreDomainNames' ];
@@ -25,9 +26,13 @@
 	function getBOMAllOptions()
 	{
-		 return document.forms.optionsbar["options"];
+		if (typeof document.forms["optionsbar_" + editorName] != "undefined")
+			return document.forms["optionsbar_" + editorName]["options"];
+		return [];
 	}
 	function getBOMAllLangs()
 	{
-		 return document.forms.languagesbar["scayt_lang"];
+		if (typeof document.forms["languagesbar_" + editorName] != "undefined")
+			return document.forms["languagesbar_" + editorName]["scayt_lang"];
+		return [];
 	}
 
@@ -59,21 +64,21 @@
 							type : 'html',
 							id : 'options',
-							html : 	'<form name="optionsbar"><div class="inner_options">' +
+							html : 	'<form name="optionsbar_' + editorName + '"><div class="inner_options">' +
 									'	<div class="messagebox"></div>' +
 									'	<div style="display:none;">' +
-									'		<input type="checkbox" name="options"  id="allCaps" />' +
-									'		<label for="allCaps" id="label_allCaps"></label>' +
+									'		<input type="checkbox" name="options"  id="allCaps_' + editorName + '" />' +
+									'		<label for="allCaps" id="label_allCaps_' + editorName + '"></label>' +
 									'	</div>' +
 									'	<div style="display:none;">' +
-									'		<input name="options" type="checkbox"  id="ignoreDomainNames" />' +
-									'		<label for="ignoreDomainNames" id="label_ignoreDomainNames"></label>' +
+									'		<input name="options" type="checkbox"  id="ignoreDomainNames_' + editorName + '" />' +
+									'		<label for="ignoreDomainNames" id="label_ignoreDomainNames_' + editorName + '"></label>' +
 									'	</div>' +
 									'	<div style="display:none;">' +
-									'	<input name="options" type="checkbox"  id="mixedCase" />' +
-									'		<label for="mixedCase" id="label_mixedCase"></label>' +
+									'	<input name="options" type="checkbox"  id="mixedCase_' + editorName + '" />' +
+									'		<label for="mixedCase" id="label_mixedCase_' + editorName + '"></label>' +
 									'	</div>' +
 									'	<div style="display:none;">' +
-									'		<input name="options" type="checkbox"  id="mixedWithDigits" />' +
-									'		<label for="mixedWithDigits" id="label_mixedWithDigits"></label>' +
+									'		<input name="options" type="checkbox"  id="mixedWithDigits_' + editorName + '" />' +
+									'		<label for="mixedWithDigits" id="label_mixedWithDigits_' + editorName + '"></label>' +
 									'	</div>' +
 									'</div></form>'
@@ -88,8 +93,8 @@
 							type : 'html',
 							id : 'langs',
-							html : 	'<form name="languagesbar"><div class="inner_langs">' +
+							html : 	'<form name="languagesbar_' + editorName + '"><div class="inner_langs">' +
 									'	<div class="messagebox"></div>	' +
-									'   <div style="float:left;width:45%;margin-left:5px;" id="scayt_lcol" ></div>' +
-									'   <div style="float:left;width:45%;margin-left:15px;" id="scayt_rcol"></div>' +
+									'   <div style="float:left;width:45%;margin-left:5px;" id="scayt_lcol_' + editorName + '" ></div>' +
+									'   <div style="float:left;width:45%;margin-left:15px;" id="scayt_rcol_' + editorName + '"></div>' +
 									'</div></form>'
 						}
@@ -104,23 +109,23 @@
 							style: '',
 							id : 'dictionaries',
-							html : 	'<form name="dictionarybar"><div class="inner_dictionary" style="text-align:left; white-space:normal; width:320px; overflow: hidden;">' +
-									'	<div style="margin:5px auto; width:80%;white-space:normal; overflow:hidden;" id="dic_message"> </div>' +
+							html : 	'<form name="dictionarybar_' + editorName + '"><div class="inner_dictionary" style="text-align:left; white-space:normal; width:320px; overflow: hidden;">' +
+									'	<div style="margin:5px auto; width:80%;white-space:normal; overflow:hidden;" id="dic_message_' + editorName + '"> </div>' +
 									'	<div style="margin:5px auto; width:80%;white-space:normal;"> ' +
 									'       <span class="cke_dialog_ui_labeled_label" >Dictionary name</span><br>'+
 									'		<span class="cke_dialog_ui_labeled_content" >'+
 									'			<div class="cke_dialog_ui_input_text">'+
-									'				<input id="dic_name" type="text" class="cke_dialog_ui_input_text"/>'+
+									'				<input id="dic_name_' + editorName + '" type="text" class="cke_dialog_ui_input_text"/>'+
 									'		</div></span></div>'+
 									'		<div style="margin:5px auto; width:80%;white-space:normal;">'+
-									'			<a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_create">'+
+									'			<a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_create_' + editorName + '">'+
 									'				</a>' +
-									'			<a  style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_delete">'+
+									'			<a  style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_delete_' + editorName + '">'+
 									'				</a>' +
-									'			<a  style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_rename">'+
+									'			<a  style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_rename_' + editorName + '">'+
 									'				</a>' +
-									'			<a  style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_restore">'+
+									'			<a  style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_restore_' + editorName + '">'+
 									'				</a>' +
 									'		</div>' +
-									'	<div style="margin:5px auto; width:95%;white-space:normal;" id="dic_info"></div>' +
+									'	<div style="margin:5px auto; width:95%;white-space:normal;" id="dic_info_' + editorName + '"></div>' +
 									'</div></form>'
 						}
@@ -135,5 +140,5 @@
 							id : 'about',
 							style : 'margin: 5px 5px;',
-							html : '<div id="scayt_about"></div>'
+							html : '<div id="scayt_about_' + editorName + '"></div>'
 						}
 					]
@@ -150,5 +155,5 @@
 			dialog.data = editor.fire( 'scaytDialog', {} );
 			dialog.options = dialog.data.scayt_control.option();
-			dialog.sLang = dialog.data.scayt_control.sLang;
+			dialog.chosed_lang = dialog.sLang = dialog.data.scayt_control.sLang;
 
 			if ( !dialog.data || !dialog.data.scayt || !dialog.data.scayt_control )
@@ -181,5 +186,5 @@
 			var scayt_control =  this.data.scayt_control;
 			scayt_control.option( this.options );
-			// Setup languge if it was changed.
+			// Setup language if it was changed.
 			var csLang = this.chosed_lang;
 			scayt_control.setLang( csLang );
@@ -199,7 +204,5 @@
 	var scayt_control = CKEDITOR.plugins.scayt.getScayt( editor );
 
-	tags = CKEDITOR.plugins.scayt.uiTabs;
-
-	for ( i in tags )
+	for ( i = 0; i < tags.length; i++ )
 	{
 		if ( tags[ i ] == 1 )
@@ -209,10 +212,11 @@
 		userDicActive = 1;
 
-
 	var init_with_captions = function()
 	{
 		var dialog = this,
 			lang_list = dialog.data.scayt.getLangList(),
-			buttons = [ 'dic_create', 'dic_delete', 'dic_rename', 'dic_restore' ],
+			buttonCaptions = [ 'dic_create', 'dic_delete', 'dic_rename', 'dic_restore' ],
+			buttonIds = [],
+			langList = [],
 			labels = optionsIds,
 			i;
@@ -221,12 +225,11 @@
 		if ( userDicActive )
 		{
-			for ( i = 0; i < buttons.length; i++ )
-			{
-				var button = buttons[ i ];
-				doc.getById( button ).setHtml( '<span class="cke_dialog_ui_button">' + captions[ 'button_' + button]  +'</span>' );
-			}
-			doc.getById( 'dic_info' ).setHtml( captions[ 'dic_info' ] );
-		}
-
+			for ( i = 0; i < buttonCaptions.length; i++ )
+			{
+				buttonIds[ i ] = buttonCaptions[ i ] + "_" + editorName;
+				doc.getById( buttonIds[ i ] ).setHtml( '<span class="cke_dialog_ui_button">' + captions[ 'button_' + buttonCaptions[ i ]]  +'</span>' );
+			}
+			doc.getById( 'dic_info_' + editorName ).setHtml( captions[ 'dic_info' ] );
+		}
 
 		// Fill options and dictionary labels.
@@ -235,12 +238,13 @@
 			for ( i in labels )
 			{
-				var label = 'label_' + labels[ i ],
-					labelElement = doc.getById( label );
+				var labelCaption = 'label_' + labels[ i ],
+					labelId = labelCaption + '_' + editorName,
+					labelElement = doc.getById( labelId );
 
 				if (  'undefined' != typeof labelElement
-				   && 'undefined' != typeof captions[ label ]
+				   && 'undefined' != typeof captions[ labelCaption ]
 				   && 'undefined' != typeof dialog.options[labels[ i ]] )
 				{
-					labelElement.setHtml( captions[ label ] );
+					labelElement.setHtml( captions[ labelCaption ] );
 					var labelParent = labelElement.getParent();
 					labelParent.$.style.display = "block";
@@ -253,5 +257,5 @@
 				'<p>' + captions[ 'about_throwt_copy' ] + '</p>';
 
-		doc.getById( 'scayt_about' ).setHtml( about );
+		doc.getById( 'scayt_about_' + editorName ).setHtml( about );
 
 		// Create languages tab.
@@ -287,5 +291,4 @@
 		};
 
-		var langList = [];
 		if ( tags[1] ==1 )
 		{
@@ -301,6 +304,6 @@
 				});
 
-			var fieldL = doc.getById( 'scayt_lcol' ),
-				fieldR = doc.getById( 'scayt_rcol' );
+			var fieldL = doc.getById( 'scayt_lcol_' + editorName ),
+				fieldR = doc.getById( 'scayt_rcol_' + editorName );
 			for ( i=0; i < langList.length; i++ )
 			{
@@ -404,5 +407,5 @@
 		function onDicButtonClick( ev )
 		{
-			var dic_name = doc.getById('dic_name').getValue();
+			var dic_name = doc.getById('dic_name_' + editorName).getValue();
 			if ( !dic_name )
 			{
@@ -411,6 +414,6 @@
 			}
 			try{
-				var el = id = ev.data.getTarget().getParent();
-				var id = el.getId();
+				var el = ev.data.getTarget().getParent();
+				var id = /(dic_\w+)_[\w\d]+/.exec(el.getId())[1];
 				dic[ id ].apply( null, [ el, dic_name, dic_buttons ] );
 			}
@@ -453,5 +456,5 @@
 					opto[k].checked = false;
 					//alert (opto[k].removeAttribute)
-					if ( dialog.options[ i ] == 1 )
+					if ( dialog.options[ i.split("_")[0] ] == 1 )
 					{
 						opto[k].checked = true;
@@ -464,5 +467,5 @@
 						checkbox.on( 'click', function()
 						{
-							dialog.options[ this.getId() ] = this.$.checked ? 1 : 0 ;
+							dialog.options[ this.getId().split("_")[0] ] = this.$.checked ? 1 : 0 ;
 						});
 					}
@@ -488,5 +491,5 @@
 					if ( dic_name )
 					{
-						doc.getById( 'dic_name' ).setValue(dic_name);
+						doc.getById( 'dic_name_' + editorName ).setValue(dic_name);
 						display_dic_buttons( dic_buttons[1] );
 					}
@@ -497,5 +500,5 @@
 				function()
 				{
-					doc.getById( 'dic_name' ).setValue("");
+					doc.getById( 'dic_name_' + editorName ).setValue("");
 				});
 			dic_success_message("");
@@ -506,9 +509,9 @@
 	function dic_error_message( m )
 	{
-		doc.getById('dic_message').setHtml('<span style="color:red;">' + m + '</span>' );
+		doc.getById('dic_message_' + editorName).setHtml('<span style="color:red;">' + m + '</span>' );
 	}
 	function dic_success_message( m )
 	{
-		doc.getById('dic_message').setHtml('<span style="color:blue;">' + m + '</span>') ;
+		doc.getById('dic_message_' + editorName).setHtml('<span style="color:blue;">' + m + '</span>') ;
 	}
 	function display_dic_buttons( sIds )
@@ -528,5 +531,5 @@
 	function set_dic_name( dic_name )
 	{
-		doc.getById('dic_name').$.value= dic_name;
+		doc.getById('dic_name_' + editorName).$.value= dic_name;
 	}
 
Index: /CKEditor/branches/features/bbcode/_source/plugins/scayt/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/scayt/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/scayt/plugin.js	(revision 6781)
@@ -96,13 +96,4 @@
 			plugin.instances[ editor.name ] = scayt_control;
 
-			//window.scayt.uiTags
-			var menuGroup = 'scaytButton';
-			var uiTabs = window.scayt.uiTags;
-			var fTabs  = [];
-
-			for ( var i = 0, l=4; i < l; i++ )
-			    fTabs.push( uiTabs[i] && plugin.uiTabs[i] );
-
-			plugin.uiTabs = fTabs;
 			try {
 				scayt_control.setDisabled( plugin.isPaused( editor ) === false );
@@ -357,4 +348,24 @@
 			return ( scayt_instance ) ? scayt_instance.disabled === false : false;
 		},
+		getUiTabs : function( editor )
+		{
+			var uiTabs = [];
+
+			// read UI tabs value from config
+			var configUiTabs = editor.config.scayt_uiTabs || "1,1,1";
+
+			// convert string to array
+			configUiTabs = configUiTabs.split( ',' );
+
+			// "About us" should be always shown for standard config
+			configUiTabs[3] = "1";
+
+			for ( var i = 0; i < 4; i++ ) {
+				uiTabs[i] = (typeof window.scayt != "undefined" && typeof window.scayt.uiTags != "undefined")
+								? (parseInt(configUiTabs[i],10) && window.scayt.uiTags[i])
+								: parseInt(configUiTabs[i],10);
+			}
+			return uiTabs;
+		},
 		loadEngine : function( editor )
 		{
@@ -505,20 +516,20 @@
 		init : function( editor )
 		{
-			// Delete span[data-scaytid] when text pasting in editor (#6921) 
-			var dataFilter = editor.dataProcessor && editor.dataProcessor.dataFilter; 
-			var dataFilterRules = 
-			{ 
-					elements : 
-					{ 
-							span : function( element ) 
-							{ 
-									var attrs = element.attributes; 
-									if ( attrs && attrs[ 'data-scaytid' ] ) 
-											delete element.name; 
-							} 
-					} 
-			}; 
-			dataFilter && dataFilter.addRules( dataFilterRules ); 
-			
+			// Delete span[data-scaytid] when text pasting in editor (#6921)
+			var dataFilter = editor.dataProcessor && editor.dataProcessor.dataFilter;
+			var dataFilterRules =
+			{
+					elements :
+					{
+							span : function( element )
+							{
+									var attrs = element.attributes;
+									if ( attrs && attrs[ 'data-scaytid' ] )
+											delete element.name;
+							}
+					}
+			};
+			dataFilter && dataFilter.addRules( dataFilterRules );
+
 			var moreSuggestions = {},
 				mainSuggestions = {};
@@ -529,25 +540,16 @@
 			// Add Options dialog.
 			CKEDITOR.dialog.add( commandName, CKEDITOR.getUrl( this.path + 'dialogs/options.js' ) );
-			// read ui tags
-			var confuiTabs = editor.config.scayt_uiTabs || '1,1,1';
-			var uiTabs =[];
-			// string to array convert
-			confuiTabs = confuiTabs.split( ',' );
-			// check array length ! always must be 3 filled with 1 or 0
-			for ( var i=0, l=3; i < l; i++ )
-			{
-				var flag = parseInt( confuiTabs[i] || '1', 10 );
-				uiTabs.push( flag );
-			}
+
+			var uiTabs = plugin.getUiTabs( editor );
 
 			var menuGroup = 'scaytButton';
 			editor.addMenuGroup( menuGroup );
 			// combine menu items to render
-			var uiMuneItems = {};
+			var uiMenuItems = {};
 
 			var lang = editor.lang.scayt;
 
 			// always added
-			uiMuneItems.scaytToggle =
+			uiMenuItems.scaytToggle =
 				{
 					label : lang.enable,
@@ -557,5 +559,5 @@
 
 			if ( uiTabs[0] == 1 )
-				uiMuneItems.scaytOptions =
+				uiMenuItems.scaytOptions =
 				{
 					label : lang.options,
@@ -569,5 +571,5 @@
 
 			if ( uiTabs[1] == 1 )
-				uiMuneItems.scaytLangs =
+				uiMenuItems.scaytLangs =
 				{
 					label : lang.langs,
@@ -580,5 +582,5 @@
 				};
 			if ( uiTabs[2] == 1 )
-				uiMuneItems.scaytDict =
+				uiMenuItems.scaytDict =
 				{
 					label : lang.dictionariesTab,
@@ -591,5 +593,5 @@
 				};
 			// always added
-			uiMuneItems.scaytAbout =
+			uiMenuItems.scaytAbout =
 				{
 					label : editor.lang.scayt.about,
@@ -602,8 +604,5 @@
 				};
 
-			uiTabs[3] = 1; // about us tab is always on
-			plugin.uiTabs = uiTabs;
-
-			editor.addMenuItems( uiMuneItems );
+			editor.addMenuItems( uiMenuItems );
 
 				editor.ui.add( 'Scayt', CKEDITOR.UI_MENUBUTTON,
@@ -627,10 +626,12 @@
 							editor.getMenuItem( 'scaytToggle' ).label = lang[ isEnabled ? 'disable' : 'enable' ];
 
+							var uiTabs = plugin.getUiTabs( editor );
+
 							return {
 								scaytToggle  : CKEDITOR.TRISTATE_OFF,
-								scaytOptions : isEnabled && plugin.uiTabs[0] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
-								scaytLangs   : isEnabled && plugin.uiTabs[1] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
-								scaytDict    : isEnabled && plugin.uiTabs[2] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
-								scaytAbout   : isEnabled && plugin.uiTabs[3] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
+								scaytOptions : isEnabled && uiTabs[0] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
+								scaytLangs   : isEnabled && uiTabs[1] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
+								scaytDict    : isEnabled && uiTabs[2] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
+								scaytAbout   : isEnabled && uiTabs[3] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
 							};
 						}
Index: /CKEditor/branches/features/bbcode/_source/plugins/selection/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/selection/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/selection/plugin.js	(revision 6781)
@@ -70,4 +70,23 @@
 
 	// #### checkSelectionChange : END
+
+	function rangeRequiresFix( range )
+	{
+		function isInlineCt( node )
+		{
+			return node && node.type == CKEDITOR.NODE_ELEMENT
+					&& node.getName() in CKEDITOR.dtd.$removeEmpty;
+		}
+
+		var start = range.startContainer,
+			offset = range.startOffset;
+
+		if ( start.type == CKEDITOR.NODE_TEXT )
+			return false;
+
+		// 1. Empty inline element. <span>^</span>
+		// 2. Adjoin to inline element. <p><strong>text</strong>^</p>
+		return !CKEDITOR.tools.trim( start.getHtml() ) ? isInlineCt( start ) : isInlineCt( start.getChild( offset - 1 ) ) || isInlineCt( start.getChild( offset ) );
+	}
 
 	var selectAllCmd =
@@ -159,4 +178,6 @@
 						switch ( e.data.keyCode )
 						{
+							case 13 :	// ENTER
+							case CKEDITOR.SHIFT + 13 :	// SHIFT-ENTER
 							case 37 :	// LEFT-ARROW
 							case 39 :	// RIGHT-ARROW
@@ -164,17 +185,41 @@
 								removeFillingChar( editor.document );
 						}
-					});
-
-				var fillingCharBefore;
+					}, null, null, 10 );
+
+				var fillingCharBefore,
+					resetSelection;
+
 				function beforeData()
 				{
-					var fillingChar = getFillingChar( editor.document );
-					fillingCharBefore = fillingChar && fillingChar.getText();
-					fillingCharBefore && fillingChar.setText( fillingCharBefore.replace( /\u200B/g, '' ) );
+					var doc = editor.document,
+						fillingChar = getFillingChar( doc );
+
+					if ( fillingChar )
+					{
+						// If cursor is right blinking by side of the filler node, save it for restoring,
+						// as the following text substitution will blind it. (#7437)
+						var sel = doc.$.defaultView.getSelection();
+						if ( sel.type == 'Caret' && sel.anchorNode == fillingChar.$ )
+							resetSelection = 1;
+
+						fillingCharBefore = fillingChar.getText();
+						fillingChar.setText( fillingCharBefore.replace( /\u200B/g, '' ) );
+					}
 				}
 				function afterData()
 				{
-						var fillingChar = getFillingChar( editor.document );
-						fillingChar && fillingChar.setText( fillingCharBefore );
+					var doc = editor.document,
+						fillingChar = getFillingChar( doc );
+
+					if ( fillingChar )
+					{
+						fillingChar.setText( fillingCharBefore );
+
+						if ( resetSelection )
+						{
+							doc.$.defaultView.getSelection().setPosition( fillingChar.$,fillingChar.getLength() );
+							resetSelection = 0;
+						}
+					}
 				}
 				editor.on( 'beforeUndoImage', beforeData );
@@ -523,8 +568,8 @@
 
 	var styleObjectElements =
-	{
-		img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,
-		a:1, input:1, form:1, select:1, textarea:1, button:1, fieldset:1, th:1, thead:1, tfoot:1
-	};
+		{
+			img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,
+			a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1
+		};
 
 	CKEDITOR.dom.selection.prototype =
@@ -657,5 +702,6 @@
 
 						// Gets the element that encloses the range entirely.
-						var parent = range.parentElement();
+						var parent = range.parentElement(),
+							doc = parent.ownerDocument;
 
 						// Empty parent element, e.g. <i>^</i>
@@ -665,4 +711,5 @@
 						var siblings = parent.children,
 							child,
+							sibling,
 							testRange = range.duplicate(),
 							startIndex = 0,
@@ -686,5 +733,19 @@
 								startIndex = index + 1;
 							else
-								return { container : parent, offset : getNodeIndex( child ) };
+							{
+								// IE9 report wrong measurement with compareEndPoints when range anchors between two BRs.
+								// e.g. <p>text<br />^<br /></p> (#7433)
+								if ( CKEDITOR.env.ie9Compat && child.tagName == 'BR' )
+								{
+									var bmId = 'cke_range_marker';
+									range.execCommand( 'CreateBookmark', false, bmId );
+									child = doc.getElementsByName( bmId )[ 0 ];
+									var offset = getNodeIndex( child );
+									parent.removeChild( child );
+									return { container : parent, offset : offset };
+								}
+								else
+									return { container : parent, offset : getNodeIndex( child ) };
+							}
 						}
 
@@ -742,8 +803,9 @@
 							while ( distance > 0 )
 							{
-								child = child[ position > 0 ? 'previousSibling' : 'nextSibling' ];
 								try
 								{
-									distance -= child.nodeValue.length;
+									sibling = child[ position > 0 ? 'previousSibling' : 'nextSibling' ];
+									distance -= sibling.nodeValue.length;
+									child = sibling;
 								}
 								// Measurement in IE could be somtimes wrong because of <select> element. (#4611)
@@ -1150,42 +1212,12 @@
 			}
 
-			if ( CKEDITOR.env.ie )
-			{
-				this.getNative().empty();
-
-				try
-				{
-					// Try to select the node as a control.
-					range = this.document.$.body.createControlRange();
-					range.addElement( element.$ );
-					range.select();
-				}
-				catch( e )
-				{
-					// If failed, select it as a text range.
-					range = this.document.$.body.createTextRange();
-					range.moveToElementText( element.$ );
-					range.select();
-				}
-				finally
-				{
-					this.document.fire( 'selectionchange' );
-				}
-
-				this.reset();
-			}
-			else
-			{
-				// Create the range for the element.
-				range = this.document.$.createRange();
-				range.selectNode( element.$ );
-
-				// Select the range.
-				var sel = this.getNative();
-				sel.removeAllRanges();
-				sel.addRange( range );
-
-				this.reset();
-			}
+			range = new CKEDITOR.dom.range( element.getDocument() );
+			range.setStartBefore( element );
+			range.setEndAfter( element );
+			range.select();
+
+			this.document.fire( 'selectionchange' );
+			this.reset();
+
 		},
 
@@ -1285,5 +1317,7 @@
 					}
 
-					if ( range.collapsed && CKEDITOR.env.webkit )
+					if ( range.collapsed
+							&& CKEDITOR.env.webkit
+							&& rangeRequiresFix( range ) )
 					{
 						// Append a zero-width space so WebKit will not try to
@@ -1408,7 +1442,20 @@
 			function( forceExpand )
 			{
-				var collapsed = this.collapsed;
-				var isStartMarkerAlone;
-				var dummySpan;
+				var collapsed = this.collapsed,
+					isStartMarkerAlone, dummySpan, ieRange;
+
+				// Try to make a object selection.
+				var selected = this.getEnclosedNode();
+				if ( selected )
+				{
+					try
+					{
+						ieRange = this.document.$.body.createControlRange();
+						ieRange.addElement( selected.$ );
+						ieRange.select();
+						return;
+					}
+					catch( er ) {}
+				}
 
 				// IE doesn't support selecting the entire table row/cell, move the selection into cells, e.g.
@@ -1430,5 +1477,5 @@
 
 				// Create the main range which will be used for the selection.
-				var ieRange = this.document.$.body.createTextRange();
+				ieRange = this.document.$.body.createTextRange();
 
 				// Position the range at the start boundary.
Index: /CKEditor/branches/features/bbcode/_source/plugins/styles/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/styles/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/styles/plugin.js	(revision 6781)
@@ -20,9 +20,9 @@
 
 /**
- * Registers a function to be called whenever a style changes its state in the
+ * Registers a function to be called whenever the selection position changes in the
  * editing area. The current state is passed to the function. The possible
  * states are {@link CKEDITOR.TRISTATE_ON} and {@link CKEDITOR.TRISTATE_OFF}.
  * @param {CKEDITOR.style} style The style to be watched.
- * @param {Function} callback The function to be called when the style state changes.
+ * @param {Function} callback The function to be called.
  * @example
  * // Create a style object for the &lt;b&gt; element.
@@ -80,10 +80,12 @@
 (function()
 {
-	var blockElements	= { address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 };
-	var objectElements	= { a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1};
-
-	var semicolonFixRegex = /\s*(?:;\s*|$)/;
-
-	var notBookmark = CKEDITOR.dom.walker.bookmark( 0, 1 );
+	var blockElements	= { address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 },
+		objectElements	= { a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1};
+
+	var semicolonFixRegex = /\s*(?:;\s*|$)/,
+		varRegex = /#\((.+?)\)/g;
+
+	var notBookmark = CKEDITOR.dom.walker.bookmark( 0, 1 ),
+		nonWhitespaces = CKEDITOR.dom.walker.whitespaces( 1 );
 
 	CKEDITOR.style = function( styleDefinition, variablesValues )
@@ -100,5 +102,5 @@
 
 		this.type =
-			( element == '#' || blockElements[ element ] ) ?
+			blockElements[ element ] ?
 				CKEDITOR.STYLE_BLOCK
 			: objectElements[ element ] ?
@@ -808,10 +810,10 @@
 
 		range.moveToBookmark( bookmark );
-}
+	}
 
 	function applyObjectStyle( range )
 	{
 		var root = range.getCommonAncestor( true, true ),
-				element = root.getAscendant( this.element, true );
+			element = root.getAscendant( this.element, true );
 		element && setupElement( element, this );
 	}
@@ -820,12 +822,12 @@
 	{
 		var root = range.getCommonAncestor( true, true ),
-				element = root.getAscendant( this.element, true );
+			element = root.getAscendant( this.element, true );
 
 		if ( !element )
 			return;
 
-		var style = this;
-		var def = style._.definition;
-		var attributes = def.attributes;
+		var style = this,
+			def = style._.definition,
+			attributes = def.attributes;
 		var styles = CKEDITOR.style.getStyleText( def );
 
@@ -951,5 +953,4 @@
 	}
 
-	var nonWhitespaces = CKEDITOR.dom.walker.whitespaces( 1 );
 	/**
 	 * Merge a <pre> block with a previous sibling if available.
@@ -1020,4 +1021,5 @@
 		return headBookmark + str.replace( regexp, replacement ) + tailBookmark;
 	}
+
 	/**
 	 * Converting a list of <pre> into blocks with format well preserved.
@@ -1155,7 +1157,6 @@
 			attribs = def.attributes,
 			styles = def.styles,
-			overrides = getOverrides( style );
-
-		var innerElements = element.getElementsByTag( style.element );
+			overrides = getOverrides( style ),
+			innerElements = element.getElementsByTag( style.element );
 
 		for ( var i = innerElements.count(); --i >= 0 ; )
@@ -1176,5 +1177,4 @@
 			}
 		}
-
 	}
 
@@ -1260,9 +1260,7 @@
 	function getElement( style, targetDocument, element )
 	{
-		var el;
-
-		var def = style._.definition;
-
-		var elementName = style.element;
+		var el,
+			def = style._.definition,
+			elementName = style.element;
 
 		// The "*" element name will always be a span for this function.
@@ -1290,7 +1288,7 @@
 	function setupElement( el, style )
 	{
-		var def = style._.definition;
-		var attributes = def.attributes;
-		var styles = CKEDITOR.style.getStyleText( def );
+		var def = style._.definition,
+			attributes = def.attributes,
+			styles = CKEDITOR.style.getStyleText( def );
 
 		// Assign all defined attributes.
@@ -1310,5 +1308,4 @@
 	}
 
-	var varRegex = /#\((.+?)\)/g;
 	function replaceVariables( list, variablesValues )
 	{
@@ -1321,5 +1318,4 @@
 		}
 	}
-
 
 	// Returns an object that can be used for style matching comparison.
@@ -1551,9 +1547,9 @@
  * 	{ name : 'Blue Title'		, element : 'h3', styles : { 'color' : 'Blue' } },
  * 	{ name : 'Red Title'		, element : 'h3', styles : { 'color' : 'Red' } },
- * 
+ *
  * 	// Inline Styles
  * 	{ name : 'Marker: Yellow'	, element : 'span', styles : { 'background-color' : 'Yellow' } },
  * 	{ name : 'Marker: Green'	, element : 'span', styles : { 'background-color' : 'Lime' } },
- * 
+ *
  * 	// Object Styles
  * 	{
Index: /CKEditor/branches/features/bbcode/_source/plugins/stylescombo/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/stylescombo/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/stylescombo/plugin.js	(revision 6781)
@@ -67,15 +67,18 @@
 						loadStylesSet( function()
 							{
-								var style, styleName;
+								var style,
+									styleName,
+									lastType,
+									type,
+									i,
+									count;
 
 								// Loop over the Array, adding all items to the
 								// combo.
-								var lastType;
-								for ( var i = 0, count = stylesList.length ; i < count ; i++ )
+								for ( i = 0, count = stylesList.length ; i < count ; i++ )
 								{
 									style = stylesList[ i ];
 									styleName = style._name;
-
-									var type = style.type;
+									type = style.type;
 
 									if ( type != lastType )
@@ -103,7 +106,6 @@
 
 						var style = styles[ value ],
-							selection = editor.getSelection();
-
-						var elementPath = new CKEDITOR.dom.elementPath( selection.getStartElement() );
+							selection = editor.getSelection(),
+							elementPath = new CKEDITOR.dom.elementPath( selection.getStartElement() );
 
 						style[ style.checkActive( elementPath ) ? 'remove' : 'apply' ]( editor.document );
@@ -116,7 +118,6 @@
 						editor.on( 'selectionChange', function( ev )
 							{
-								var currentValue = this.getValue();
-
-								var elementPath = ev.data.path,
+								var currentValue = this.getValue(),
+									elementPath = ev.data.path,
 									elements = elementPath.elements;
 
@@ -152,7 +153,7 @@
 						var selection = editor.getSelection(),
 							element = selection.getSelectedElement(),
-							elementPath = new CKEDITOR.dom.elementPath( element || selection.getStartElement() );
-
-						var counter = [ 0, 0, 0, 0 ];
+							elementPath = new CKEDITOR.dom.elementPath( element || selection.getStartElement() ),
+							counter = [ 0, 0, 0, 0 ];
+
 						this.showAll();
 						this.unmarkAll();
Index: /CKEditor/branches/features/bbcode/_source/plugins/tabletools/dialogs/tableCell.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/tabletools/dialogs/tableCell.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/tabletools/dialogs/tableCell.js	(revision 6781)
@@ -74,5 +74,5 @@
 			title : langCell.title,
 			minWidth : CKEDITOR.env.ie && CKEDITOR.env.quirks? 450 : 410,
-			minHeight : CKEDITOR.env.ie && CKEDITOR.env.quirks?  230 : 200,
+			minHeight : CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks )?  230 : 200,
 			contents : [
 				{
Index: /CKEditor/branches/features/bbcode/_source/plugins/tabletools/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/tabletools/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/tabletools/plugin.js	(revision 6781)
@@ -796,16 +796,13 @@
 							return;
 
-						// Maintain the selection point at where the table was deleted.
-						selection.selectElement( table );
-						var range = selection.getRanges()[0];
-						range.collapse();
-						selection.selectRanges( [ range ] );
-
 						// If the table's parent has only one child remove it as well (unless it's the body or a table cell) (#5416, #6289)
 						var parent = table.getParent();
 						if ( parent.getChildCount() == 1 && !parent.is( 'body', 'td', 'th' ) )
-							parent.remove();
-						else
-							table.remove();
+							table = parent;
+
+						var range = new CKEDITOR.dom.range( editor.document );
+						range.moveToPosition( table, CKEDITOR.POSITION_BEFORE_START );
+						table.remove();
+						range.select();
 					}
 				} );
Index: /CKEditor/branches/features/bbcode/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/wysiwygarea/plugin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/plugins/wysiwygarea/plugin.js	(revision 6781)
@@ -11,17 +11,13 @@
 (function()
 {
-	// List of elements in which has no way to move editing focus outside.
-	var nonExitableElementNames = { table:1,pre:1 };
-
 	// Matching an empty paragraph at the end of document.
-	var emptyParagraphRegexp = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;
+	var emptyParagraphRegexp = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;
 
 	var notWhitespaceEval = CKEDITOR.dom.walker.whitespaces( true );
 
-	// Elements that could have empty new line around, including table, pre-formatted block, hr, page-break. (#6554)
-	function nonExitable( element )
+	// Elements that could blink the cursor anchoring beside it, like hr, page-break. (#6554)
+	function nonEditable( element )
 	{
-		return ( element.getName() in nonExitableElementNames )
-				|| element.isBlockBoundary() && CKEDITOR.dtd.$empty[ element.getName() ];
+		return element.isBlockBoundary() && CKEDITOR.dtd.$empty[ element.getName() ];
 	}
 
@@ -367,6 +363,12 @@
 
 			// Ensure bogus br could help to move cursor (out of styles) to the end of block. (#7041)
-			var pathBlock = path.block || path.blockLimit;
-			if ( pathBlock && !pathBlock.getBogus() )
+			var pathBlock = path.block || path.blockLimit,
+				lastNode = pathBlock && pathBlock.getLast( isNotEmpty );
+
+			// In case it's not ended with block element and doesn't have bogus yet. (#7467)
+			if ( pathBlock
+					&& !( lastNode && lastNode.type == CKEDITOR.NODE_ELEMENT && lastNode.isBlockBoundary() )
+					&& !pathBlock.is( 'pre' )
+					&& !pathBlock.getBogus() )
 			{
 				editor.fire( 'updateSnapshot' );
@@ -404,5 +406,5 @@
 				if ( element &&
 					 element.type == CKEDITOR.NODE_ELEMENT &&
-					 !nonExitable( element ) )
+					 !nonEditable( element ) )
 				{
 					range.moveToElementEditStart( element );
@@ -414,5 +416,5 @@
 					if ( element &&
 						 element.type == CKEDITOR.NODE_ELEMENT &&
-						 !nonExitable( element ) )
+						 !nonEditable( element ) )
 					{
 						range.moveToElementEditEnd( element );
@@ -423,29 +425,15 @@
 
 			range.select();
-			// Notify non-IE that selection has changed.
-			if ( !CKEDITOR.env.ie )
-			{
-				// Make sure next selection change is correct.  (#6811)
-				editor.forceNextSelectionCheck();
-				editor.selectionChange();
-			}
+			// Cancel this selection change in favor of the next (correct).  (#6811)
+			evt.cancel();
 		}
 
-		// All browsers are incapable to moving cursor out of certain non-exitable
-		// blocks (e.g. table, list, pre) at the end of document, make this happen by
-		// place a bogus node there, which would be later removed by dataprocessor.
-		var walkerRange = new CKEDITOR.dom.range( editor.document ),
-			walker = new CKEDITOR.dom.walker( walkerRange );
-		walkerRange.selectNodeContents( body );
-		walker.evaluator = function( node )
-		{
-			return node.type == CKEDITOR.NODE_ELEMENT && ( node.getName() in nonExitableElementNames );
-		};
-		walker.guard = function( node, isMoveout )
-		{
-			return !( ( node.type == CKEDITOR.NODE_TEXT && isNotWhitespace( node ) ) || isMoveout );
-		};
-
-		if ( walker.previous() )
+		// Browsers are incapable of moving cursor out of certain block elements (e.g. table, div, pre)
+		// at the end of document, makes it unable to continue adding content, we have to make this
+		// easier by opening an new empty paragraph.
+		var testRange = new CKEDITOR.dom.range( editor.document );
+		testRange.moveToElementEditEnd( editor.document.getBody() );
+		var testPath = new CKEDITOR.dom.elementPath( testRange.startContainer );
+		if ( !testPath.blockLimit.is( 'body') )
 		{
 			editor.fire( 'updateSnapshot' );
@@ -692,4 +680,6 @@
 						if ( CKEDITOR.env.webkit )
 						{
+							// Mark that cursor will right blinking (#7113).
+							domDocument.on( 'mousedown', function() { wasFocused = 1; } );
 							// Prevent from tick checkbox/radiobox/select
 							domDocument.on( 'click', function( ev )
@@ -1274,12 +1264,10 @@
 
 /**
- * Disables the built-in spell checker while typing natively available in the
- * browser (currently Firefox and Safari only).<br /><br />
+ * Disables the built-in words spell checker if browser provides one.<br /><br />
  *
- * Even if word suggestions will not appear in the CKEditor context menu, this
- * feature is useful to help quickly identifying misspelled words.<br /><br />
+ * <strong>Note:</strong> Although word suggestions provided by browsers (natively) will not appear in CKEditor's default context menu,
+ * users can always reach the native context menu by holding the <em>Ctrl</em> key when right-clicking if {@link CKEDITOR.config.browserContextMenuOnCtrl}
+ * is enabled or you're simply not using the context menu plugin.
  *
- * This setting is currently compatible with Firefox only due to limitations in
- * other browsers.
  * @type Boolean
  * @default true
Index: /CKEditor/branches/features/bbcode/_source/plugins/xml/plugin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/xml/plugin.js	(revision 6781)
+++ /CKEditor/branches/features/bbcode/_source/plugins/xml/plugin.js	(revision 6781)
@@ -0,0 +1,170 @@
+﻿/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.xml} class, which represents a
+ *		loaded XML document.
+ */
+
+(function()
+{
+	CKEDITOR.plugins.add( 'xml', {});
+
+	/**
+	 * Represents a loaded XML document.
+	 * @constructor
+	 * @param {object|string} xmlObjectOrData A native XML (DOM document) object or
+	 *		a string containing the XML definition to be loaded.
+	 * @example
+	 * var xml = <b>new CKEDITOR.xml( '<books><book title="My Book" /></books>' )</b>;
+	 */
+	CKEDITOR.xml = function( xmlObjectOrData )
+	{
+		var baseXml = null;
+
+		if ( typeof xmlObjectOrData == 'object' )
+			baseXml = xmlObjectOrData;
+		else
+		{
+			var data = ( xmlObjectOrData || '' ).replace( /&nbsp;/g, '\xA0' );
+			if ( window.DOMParser )
+				baseXml = (new DOMParser()).parseFromString( data, 'text/xml' );
+			else if ( window.ActiveXObject )
+			{
+				try { baseXml = new ActiveXObject( 'MSXML2.DOMDocument' ); }
+				catch(e)
+				{
+					try { baseXml = new ActiveXObject( 'Microsoft.XmlDom' ); } catch(e) {}
+				}
+
+				if ( baseXml )
+				{
+					baseXml.async = false;
+					baseXml.resolveExternals = false;
+					baseXml.validateOnParse = false;
+					baseXml.loadXML( data );
+				}
+			}
+		}
+
+		/**
+		 * The native XML (DOM document) used by the class instance.
+		 * @type object
+		 * @example
+		 */
+		this.baseXml = baseXml;
+	};
+
+	CKEDITOR.xml.prototype =
+	{
+		/**
+		 * Get a single node from the XML document, based on a XPath query.
+		 * @param {String} xpath The XPath query to execute.
+		 * @param {Object} [contextNode] The XML DOM node to be used as the context
+		 *		for the XPath query. The document root is used by default.
+		 * @returns {Object} A XML node element or null if the query has no results.
+		 * @example
+		 * // Create the XML instance.
+		 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
+		 * // Get the first <item> node.
+		 * var itemNode = <b>xml.selectSingleNode( 'list/item' )</b>;
+		 * // Alert "item".
+		 * alert( itemNode.nodeName );
+		 */
+		selectSingleNode : function( xpath, contextNode )
+		{
+			var baseXml = this.baseXml;
+
+			if ( contextNode || ( contextNode = baseXml ) )
+			{
+				if ( CKEDITOR.env.ie || contextNode.selectSingleNode )	// IE
+					return contextNode.selectSingleNode( xpath );
+				else if ( baseXml.evaluate )							// Others
+				{
+					var result = baseXml.evaluate( xpath, contextNode, null, 9, null);
+					return ( result && result.singleNodeValue ) || null;
+				}
+			}
+
+			return null;
+		},
+
+		/**
+		 * Gets a list node from the XML document, based on a XPath query.
+		 * @param {String} xpath The XPath query to execute.
+		 * @param {Object} [contextNode] The XML DOM node to be used as the context
+		 *		for the XPath query. The document root is used by default.
+		 * @returns {ArrayLike} An array containing all matched nodes. The array will
+		 *		be empty if the query has no results.
+		 * @example
+		 * // Create the XML instance.
+		 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
+		 * // Get the first <item> node.
+		 * var itemNodes = xml.selectSingleNode( 'list/item' );
+		 * // Alert "item" twice, one for each <item>.
+		 * for ( var i = 0 ; i < itemNodes.length ; i++ )
+		 *     alert( itemNodes[i].nodeName );
+		 */
+		selectNodes : function( xpath, contextNode )
+		{
+			var baseXml = this.baseXml,
+				nodes = [];
+
+			if ( contextNode || ( contextNode = baseXml ) )
+			{
+				if ( CKEDITOR.env.ie || contextNode.selectNodes )		// IE
+					return contextNode.selectNodes( xpath );
+				else if ( baseXml.evaluate )							// Others
+				{
+					var result = baseXml.evaluate( xpath, contextNode, null, 5, null);
+
+					if ( result )
+					{
+						var node;
+						while ( ( node = result.iterateNext() ) )
+							nodes.push( node );
+					}
+				}
+			}
+
+			return nodes;
+		},
+
+		/**
+		 * Gets the string representation of hte inner contents of a XML node,
+		 * based on a XPath query.
+		 * @param {String} xpath The XPath query to execute.
+		 * @param {Object} [contextNode] The XML DOM node to be used as the context
+		 *		for the XPath query. The document root is used by default.
+		 * @returns {String} The textual representation of the inner contents of
+		 *		the node or null if the query has no results.
+		 * @example
+		 * // Create the XML instance.
+		 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
+		 * // Alert "<item id="test1" /><item id="test2" />".
+		 * alert( xml.getInnerXml( 'list' ) );
+		 */
+		getInnerXml : function( xpath, contextNode )
+		{
+			var node = this.selectSingleNode( xpath, contextNode ),
+				xml = [];
+			if ( node )
+			{
+				node = node.firstChild;
+				while ( node )
+				{
+					if ( node.xml )				// IE
+						xml.push( node.xml );
+					else if ( window.XMLSerializer )	// Others
+						xml.push( ( new XMLSerializer() ).serializeToString( node ) );
+
+					node = node.nextSibling;
+				}
+			}
+
+			return xml.length ? xml.join( '' ) : null;
+		}
+	};
+})();
Index: /CKEditor/branches/features/bbcode/_source/skins/kama/dialog.css
===================================================================
--- /CKEditor/branches/features/bbcode/_source/skins/kama/dialog.css	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/skins/kama/dialog.css	(revision 6781)
@@ -563,4 +563,9 @@
 /* END Firefox2 buttons */
 
+.cke_skin_kama .cke_browser_ie9.cke_rtl .cke_dialog_footer_buttons td
+{
+	padding-left: 2px;
+}
+
 .cke_skin_kama strong
 {
Index: /CKEditor/branches/features/bbcode/_source/skins/kama/richcombo.css
===================================================================
--- /CKEditor/branches/features/bbcode/_source/skins/kama/richcombo.css	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/skins/kama/richcombo.css	(revision 6781)
@@ -124,23 +124,22 @@
 .cke_skin_kama .cke_rcombo .cke_openbutton
 {
+	display: inline-block;
+}
+
+.cke_skin_kama .cke_rcombo .cke_openbutton .cke_icon
+{
+	display: inline-block;
 	background-image: url(images/sprites.png);
 	_background-image: url(images/sprites_ie6.png);
 	background-position: 0 -68px;
 	background-repeat: no-repeat;
-	display: inline-block;
 	width: 17px;
 	height: 19px;
 	margin: 1px 2px;
-	background-repeat: no-repeat;
-}
-
-.cke_skin_kama .cke_rcombo .cke_openbutton span
-{
-	display: none;
-}
-
-.cke_skin_kama .cke_hc .cke_rcombo .cke_openbutton span
-{
-	display	: inline;
+}
+
+.cke_skin_kama .cke_hc .cke_rcombo .cke_openbutton .cke_icon
+{
+	background: none;
 }
 
Index: /CKEditor/branches/features/bbcode/_source/skins/office2003/richcombo.css
===================================================================
--- /CKEditor/branches/features/bbcode/_source/skins/office2003/richcombo.css	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/skins/office2003/richcombo.css	(revision 6781)
@@ -142,12 +142,15 @@
 {
 	display: inline-block;
-
+	border-top: 1px solid #8f8f73;
+	border-bottom: 1px solid #8f8f73;
+}
+
+.cke_skin_office2003 .cke_rcombo .cke_openbutton .cke_icon
+{
+	display: inline-block;
 	background-position: 5px -1002px;
 	background-image: url(images/sprites.png);
 	_background-image: url(images/sprites_ie6.png);
 	background-repeat: no-repeat;
-
-	border-top: 1px solid #8f8f73;
-	border-bottom: 1px solid #8f8f73;
 	width: 14px;
 	height: 22px;
@@ -155,21 +158,16 @@
 
 /* IE with zoom != 100% will distort the icons otherwise #4821 */
-.cke_skin_office2003 .cke_browser_ie .cke_rcombo .cke_openbutton
+.cke_skin_office2003 .cke_browser_ie .cke_rcombo .cke_openbutton .cke_icon
 {
 	filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');
 }
-.cke_skin_office2003 .cke_browser_ie6 .cke_rcombo .cke_openbutton
+.cke_skin_office2003 .cke_browser_ie6 .cke_rcombo .cke_openbutton .cke_icon
 {
 	filter: ;
 }
-
-.cke_skin_office2003 .cke_rcombo .cke_openbutton span
-{
-	display: none;
-}
-
-.cke_skin_office2003 .cke_hc .cke_rcombo .cke_openbutton span
-{
-	display	: inline;
+.cke_skin_office2003 .cke_hc .cke_rcombo .cke_openbutton .cke_icon
+{
+	background: none;
+	filter: ;
 }
 
Index: /CKEditor/branches/features/bbcode/_source/skins/office2003/skin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/skins/office2003/skin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/skins/office2003/skin.js	(revision 6781)
@@ -37,5 +37,5 @@
 					});
 
-				if ( !CKEDITOR.env.ie )
+				if ( !CKEDITOR.env.ie || CKEDITOR.env.ie9Compat )
 					return;
 
Index: /CKEditor/branches/features/bbcode/_source/skins/v2/richcombo.css
===================================================================
--- /CKEditor/branches/features/bbcode/_source/skins/v2/richcombo.css	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/skins/v2/richcombo.css	(revision 6781)
@@ -137,5 +137,11 @@
 {
 	display: inline-block;
-
+	border-top: 1px solid #8f8f73;
+	border-bottom: 1px solid #8f8f73;
+}
+
+.cke_skin_v2 .cke_rcombo .cke_openbutton .cke_icon
+{
+	display: inline-block;
 	background-position: 5px -715px;
 	background-image: url(images/sprites.png);
@@ -143,6 +149,4 @@
 	background-repeat: no-repeat;
 
-	border-top: 1px solid #8f8f73;
-	border-bottom: 1px solid #8f8f73;
 	width: 14px;
 	height: 20px;
@@ -150,21 +154,16 @@
 
 /* IE with zoom != 100% will distort the icons otherwise #4821 */
-.cke_skin_v2 .cke_browser_ie .cke_rcombo .cke_openbutton
+.cke_skin_v2 .cke_browser_ie .cke_rcombo .cke_openbutton .cke_icon
 {
 	filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');
 }
-.cke_skin_v2 .cke_browser_ie6 .cke_rcombo .cke_openbutton
+.cke_skin_v2 .cke_browser_ie6 .cke_rcombo .cke_openbutton .cke_icon
 {
 	filter: ;
 }
-
-.cke_skin_v2 .cke_rcombo .cke_openbutton span
-{
-	display: none;
-}
-
-.cke_skin_v2 .cke_hc .cke_rcombo .cke_openbutton span
-{
-	display	: inline;
+.cke_skin_v2 .cke_hc .cke_rcombo .cke_openbutton .cke_icon
+{
+	background: none;
+	filter: ;
 }
 
Index: /CKEditor/branches/features/bbcode/_source/skins/v2/skin.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/skins/v2/skin.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/skins/v2/skin.js	(revision 6781)
@@ -37,5 +37,5 @@
 					});
 
-				if ( !CKEDITOR.env.ie )
+				if ( !CKEDITOR.env.ie || CKEDITOR.env.ie9Compat )
 					return;
 
Index: /CKEditor/branches/features/bbcode/_source/themes/default/theme.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/themes/default/theme.js	(revision 6780)
+++ /CKEditor/branches/features/bbcode/_source/themes/default/theme.js	(revision 6781)
@@ -11,4 +11,6 @@
 CKEDITOR.themes.add( 'default', (function()
 {
+	var hiddenSkins = {};
+
 	function checkSharedSpace( editor, spaceName )
 	{
@@ -121,4 +123,10 @@
 			sharedTop		&& ( sharedTop.setHtml( topHtml )		, topHtml = '' );
 			sharedBottoms	&& ( sharedBottoms.setHtml( bottomHtml ), bottomHtml = '' );
+
+			var hideSkin = '<style>.' + editor.skinClass + '{visibility:hidden;}</style>';
+			if ( hiddenSkins[ editor.skinClass ] )
+				hideSkin = '';
+			else
+				hiddenSkins[ editor.skinClass ] = 1;
 
 			var container = CKEDITOR.dom.element.createFromHtml( [
@@ -143,5 +151,5 @@
 							'</tbody></table>' +
 							//Hide the container when loading skins, later restored by skin css.
-							'<style>.', editor.skinClass, '{visibility:hidden;}</style>' +
+							hideSkin +
 						'</span>' +
 					'</span>' +
Index: /CKEditor/branches/features/bbcode/ckeditor_php4.php
===================================================================
--- /CKEditor/branches/features/bbcode/ckeditor_php4.php	(revision 6780)
+++ /CKEditor/branches/features/bbcode/ckeditor_php4.php	(revision 6781)
@@ -532,5 +532,4 @@
 	/**
 	 * This little function provides a basic JSON support.
-	 * http://php.net/manual/en/function.json-encode.php
 	 * \private
 	 *
@@ -543,59 +542,30 @@
 			return 'null';
 		}
-		if ($val === false) {
-			return 'false';
-		}
-		if ($val === true) {
-			return 'true';
-		}
-		if (is_scalar($val))
-		{
-			if (is_float($val))
-			{
-				// Always use "." for floats.
-				$val = str_replace(",", ".", strval($val));
-			}
-
-			// Use @@ to not use quotes when outputting string value
-			if (strpos($val, '@@') === 0) {
-				return substr($val, 2);
-			}
-			else {
-				// All scalars are converted to strings to avoid indeterminism.
-				// PHP's "1" and 1 are equal for all PHP operators, but
-				// JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend,
-				// we should get the same result in the JS frontend (string).
-				// Character replacements for JSON.
-				static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'),
-				array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
-
-				$val = str_replace($jsonReplaces[0], $jsonReplaces[1], $val);
-				if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.') {
-					return $val;
-				}
-
-				return '"' . $val . '"';
-			}
-		}
-		$isList = true;
-		for ($i = 0, reset($val); $i < count($val); $i++, next($val))
-		{
-			if (key($val) !== $i)
-			{
-				$isList = false;
-				break;
-			}
-		}
-		$result = array();
-		if ($isList)
-		{
-			foreach ($val as $v) $result[] = $this->jsEncode($v);
-			return '[ ' . join(', ', $result) . ' ]';
-		}
-		else
-		{
-			foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v);
-			return '{ ' . join(', ', $result) . ' }';
-		}
+		if (is_bool($val)) {
+			return $val ? 'true' : 'false';
+		}
+		if (is_int($val)) {
+			return $val;
+		}
+		if (is_float($val)) {
+			return str_replace(',', '.', $val);
+		}
+		if (is_array($val) || is_object($val)) {
+			if (is_array($val) && (array_keys($val) === range(0,count($val)-1))) {
+				return '[' . implode(',', array_map(array($this, 'jsEncode'), $val)) . ']';
+			}
+			$temp = array();
+			foreach ($val as $k => $v){
+				$temp[] = $this->jsEncode("{$k}") . ':' . $this->jsEncode($v);
+			}
+			return '{' . implode(',', $temp) . '}';
+		}
+		// String otherwise
+		if (strpos($val, '@@') === 0)
+			return substr($val, 2);
+		if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.')
+			return $val;
+
+		return '"' . str_replace(array("\\", "/", "\n", "\t", "\r", "\x08", "\x0c", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'), $val) . '"';
 	}
 }
Index: /CKEditor/branches/features/bbcode/ckeditor_php5.php
===================================================================
--- /CKEditor/branches/features/bbcode/ckeditor_php5.php	(revision 6780)
+++ /CKEditor/branches/features/bbcode/ckeditor_php5.php	(revision 6781)
@@ -523,5 +523,4 @@
 	/**
 	 * This little function provides a basic JSON support.
-	 * http://php.net/manual/en/function.json-encode.php
 	 *
 	 * @param mixed $val
@@ -533,59 +532,30 @@
 			return 'null';
 		}
-		if ($val === false) {
-			return 'false';
-		}
-		if ($val === true) {
-			return 'true';
-		}
-		if (is_scalar($val))
-		{
-			if (is_float($val))
-			{
-				// Always use "." for floats.
-				$val = str_replace(",", ".", strval($val));
-			}
-
-			// Use @@ to not use quotes when outputting string value
-			if (strpos($val, '@@') === 0) {
-				return substr($val, 2);
-			}
-			else {
-				// All scalars are converted to strings to avoid indeterminism.
-				// PHP's "1" and 1 are equal for all PHP operators, but
-				// JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend,
-				// we should get the same result in the JS frontend (string).
-				// Character replacements for JSON.
-				static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'),
-				array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
-
-				$val = str_replace($jsonReplaces[0], $jsonReplaces[1], $val);
-				if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.') {
-					return $val;
-				}
-
-				return '"' . $val . '"';
-			}
-		}
-		$isList = true;
-		for ($i = 0, reset($val); $i < count($val); $i++, next($val))
-		{
-			if (key($val) !== $i)
-			{
-				$isList = false;
-				break;
-			}
-		}
-		$result = array();
-		if ($isList)
-		{
-			foreach ($val as $v) $result[] = $this->jsEncode($v);
-			return '[ ' . join(', ', $result) . ' ]';
-		}
-		else
-		{
-			foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v);
-			return '{ ' . join(', ', $result) . ' }';
-		}
+		if (is_bool($val)) {
+			return $val ? 'true' : 'false';
+		}
+		if (is_int($val)) {
+			return $val;
+		}
+		if (is_float($val)) {
+			return str_replace(',', '.', $val);
+		}
+		if (is_array($val) || is_object($val)) {
+			if (is_array($val) && (array_keys($val) === range(0,count($val)-1))) {
+				return '[' . implode(',', array_map(array($this, 'jsEncode'), $val)) . ']';
+			}
+			$temp = array();
+			foreach ($val as $k => $v){
+				$temp[] = $this->jsEncode("{$k}") . ':' . $this->jsEncode($v);
+			}
+			return '{' . implode(',', $temp) . '}';
+		}
+		// String otherwise
+		if (strpos($val, '@@') === 0)
+			return substr($val, 2);
+		if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.')
+			return $val;
+
+		return '"' . str_replace(array("\\", "/", "\n", "\t", "\r", "\x08", "\x0c", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'), $val) . '"';
 	}
 }
