Index: /CKEditor/branches/versions/3.6.x/CHANGES.html
===================================================================
--- /CKEditor/branches/versions/3.6.x/CHANGES.html	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/CHANGES.html	(revision 7060)
@@ -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.
@@ -61,5 +61,4 @@
 		<li><a href="http://dev.ckeditor.com/ticket/6263">#6263</a> : Some table cell context menu options may be incorrectly disabled.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/6247">#6247</a> : Focus is not restored properly after a drop-down menu is closed.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/7173">#7173</a> : Enhancement to the Autogrow plugin makes it more accurate on editor changing size.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/7334">#7334</a> : [IE7] Indentation style does not apply to RTL lists.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/6845">#6845</a> : Spaces inside the URL field in the Link dialog window will now be removed.</li>
@@ -82,5 +81,4 @@
 		<li><a href="http://dev.ckeditor.com/ticket/7801">#7801</a> : [Opera] Pasted paragraphs now split partially selected blocks.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/6663">#6663</a> : Table caption that contains rich text is corrupted after an edit done with the Table Properties dialog window.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/7192">#7192</a> : [IE] Selecting Paragraph Format in an empty editor without focus does not bring focus into the editor body.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/7893">#7893</a> : [WebKit, Opera, IE&lt;8] It is impossible to link to anchors in the document.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/7637">#7637</a> : Cursor position might in some cases cause problems after inserting a page break.</li>
@@ -96,5 +94,4 @@
 		<li><a href="http://dev.ckeditor.com/ticket/7847">#7847</a> : [IE8] Inserting an image with non-secure source in a HTTPS page breaks the dialog window.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/7953">#7953</a> : [IE] Text selection lost after the browser context menu is opened.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/7984">#7984</a> : The Autogrow plugin breaks when the document has a Quirks mode doctype.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/5239">#5239</a> : Inconsistent focus behavior after closing a toolbar drop-down menu.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/6470">#6470</a> : The Start attribute of a Numbered List is rendered incorrectly if the field is left empty.</li>
Index: /CKEditor/branches/versions/3.6.x/_samples/autogrow.html
===================================================================
--- /CKEditor/branches/versions/3.6.x/_samples/autogrow.html	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_samples/autogrow.html	(revision 7060)
@@ -42,5 +42,7 @@
 	{
 		<strong>extraPlugins : 'autogrow',</strong>
-		autoGrow_maxHeight : 800
+		autoGrow_maxHeight : 800,
+		// Remove the resize plugin, as it doesn't make sense to use it in conjunction with the AutoGrow plugin.
+		removePlugins : 'resize'
 	});</pre>
 	<p>
@@ -69,5 +71,6 @@
 
 				CKEDITOR.replace( 'editor1', {
-					extraPlugins : 'autogrow'
+					extraPlugins : 'autogrow',
+					removePlugins : 'resize'
 				});
 
@@ -84,5 +87,6 @@
 				CKEDITOR.replace( 'editor2', {
 					extraPlugins : 'autogrow',
-					autoGrow_maxHeight : 400
+					autoGrow_maxHeight : 400,
+					removePlugins : 'resize'
 				});
 
Index: /CKEditor/branches/versions/3.6.x/_samples/bbcode.html
===================================================================
--- /CKEditor/branches/versions/3.6.x/_samples/bbcode.html	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_samples/bbcode.html	(revision 7060)
@@ -39,5 +39,4 @@
 	{
 		<strong>extraPlugins : 'bbcode',</strong>
-		removePlugins : 'bidi,button,dialogadvtab,div,filebrowser,flash,format,forms,horizontalrule,iframe,indent,justify,liststyle,pagebreak,showborders,stylescombo,table,tabletools,templates',
 		toolbar :
 		[
@@ -50,15 +49,5 @@
 			['TextColor', '-', 'Smiley','SpecialChar', '-', 'Maximize']
 		],
-		smiley_images :
-		[
-			'regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','tounge_smile.gif',
-			'embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angel_smile.gif','shades_smile.gif',
-			'cry_smile.gif','kiss.gif'
-		],
-		smiley_descriptions :
-		[
-			'smiley', 'sad', 'wink', 'laugh', 'cheeky', 'blush', 'surprise',
-			'indecision', 'angel', 'cool', 'crying', 'kiss'
-		]
+		... <i>some other configurations omitted here</i>
 	});	</pre>
 	</div>
Index: /CKEditor/branches/versions/3.6.x/_source/core/dom/element.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/core/dom/element.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/core/dom/element.js	(revision 7060)
@@ -1596,5 +1596,11 @@
 		getDirection : function( useComputed )
 		{
-			return useComputed ? this.getComputedStyle( 'direction' ) : this.getStyle( 'direction' ) || this.getAttribute( 'dir' );
+			return useComputed ?
+				this.getComputedStyle( 'direction' )
+					// Webkit: offline element returns empty direction (#8053).
+					|| this.getDirection()
+					|| this.getDocument().$.dir
+					|| this.getDocument().getBody().getDirection( 1 )
+				: this.getStyle( 'direction' ) || this.getAttribute( 'dir' );
 		},
 
Index: /CKEditor/branches/versions/3.6.x/_source/core/htmlparser/element.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/core/htmlparser/element.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/core/htmlparser/element.js	(revision 7060)
@@ -58,4 +58,59 @@
 		isBlockLike : isBlockLike,
 		hasInlineStarted : isEmpty || !isBlockLike
+	};
+};
+
+/**
+ *  Object presentation of  CSS style declaration text.
+ *  @param {CKEDITOR.htmlParser.element|String} elementOrStyleText A html parser element or the inline style text.
+ */
+CKEDITOR.htmlParser.cssStyle = function()
+{
+	 var styleText,
+		arg = arguments[ 0 ],
+		rules = {};
+
+	styleText = arg instanceof CKEDITOR.htmlParser.element ? arg.attributes.style : arg;
+
+	// html-encoded quote might be introduced by 'font-family'
+	// from MS-Word which confused the following regexp. e.g.
+	//'font-family: &quot;Lucida, Console&quot;'
+	( styleText || '' )
+		.replace( /&quot;/g, '"' )
+		.replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
+			function( match, name, value )
+			{
+				name == 'font-family' && ( value = value.replace( /["']/g, '' ) );
+				rules[ name.toLowerCase() ] = value;
+			});
+
+	return {
+
+		rules : rules,
+
+		/**
+		 *  Apply the styles onto the specified element or object.
+		 * @param {CKEDITOR.htmlParser.element|CKEDITOR.dom.element|Object} obj
+		 */
+		populate : function( obj )
+		{
+			var style = this.toString();
+			if ( style )
+			{
+				obj instanceof CKEDITOR.dom.element ?
+					obj.setAttribute( 'style', style ) :
+					obj instanceof CKEDITOR.htmlParser.element ?
+						obj.attributes.style = style :
+						obj.style = style;
+			}
+		},
+
+		toString : function()
+		{
+			var output = [];
+			for ( var i in rules )
+				rules[ i ] && output.push( i, ':', rules[ i ], ';' );
+			return output.join( '' );
+		}
 	};
 };
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/autogrow/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/autogrow/plugin.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/autogrow/plugin.js	(revision 7060)
@@ -8,90 +8,38 @@
  */
 (function(){
+	var resizeEditor = function( editor )
+	{
+		if ( !editor.window )
+			return;
+		var doc = editor.document,
+			currentHeight = editor.window.getViewPaneSize().height,
+			newHeight;
 
-	var parts = [ "margin-top","margin-bottom","border-top-width", "border-bottom-width", "padding-top",  "padding-bottom" ];
+		// We can not use documentElement to calculate the height for IE (#6061).
+		// It is not good for IE Quirks, yet using offsetHeight would also not work as expected (#6408).
+		// We do the same for FF because of the html height workaround (#6341).
+		if ( CKEDITOR.env.ie || CKEDITOR.env.gecko )
+			newHeight = doc.getBody().$.scrollHeight + ( CKEDITOR.env.ie && CKEDITOR.env.quirks ? 0 : 24 );
+		else
+			newHeight = doc.getDocumentElement().$.offsetHeight;
 
-	function nonContentHeight( element )
-	{
-		var adjustment = 0;
-		for ( var i = 0, len = parts.length; i < len; i++ )
-			adjustment += parseInt( element.getComputedStyle( parts[ i ] ) || 0, 10 ) || 0;
-		return adjustment;
-	}
+		var min = editor.config.autoGrow_minHeight,
+			max = editor.config.autoGrow_maxHeight;
+		( min == undefined ) && ( editor.config.autoGrow_minHeight = min = 200 );
+		if ( min )
+			newHeight = Math.max( newHeight, min );
+		if ( max )
+			newHeight = Math.min( newHeight, max );
 
-	// Count for spaces outside of  the actual content.
-	function extra( element )
-	{
-		var margin = 0;
-		margin += nonContentHeight( element);
-		if ( element.is( 'html' ) )
-			margin += nonContentHeight( element.getDocument().getBody() );
-		return margin;
-	}
-
-	// Actual content height, figured out by simply check the last element's document position.
-	function docContentHeight( doc )
-	{
-		var last = doc.getBody().getLast();
-
-		// Last node is not measurable,  create a temporary marker element.
-		if ( !last || last.type != CKEDITOR.NODE_ELEMENT || last.is( 'br' ) )
+		if ( newHeight != currentHeight )
 		{
-			last = CKEDITOR.dom.element.createFromHtml( '<span>' + ( CKEDITOR.env.webkit ? '&nbsp;' : '' ) + '</span>', doc );
-			doc.getBody().append( last );
-			last.isMarker = 1;
+			newHeight = editor.fire( 'autoGrow', { currentHeight : currentHeight, newHeight : newHeight } ).newHeight;
+			editor.resize( editor.container.getStyle( 'width' ), newHeight, true );
 		}
-
-		var height = last.getDocumentPosition( doc ).y + last.$.offsetHeight;
-		last.isMarker && last.remove();
-		return height;
-	}
-
+	};
 	CKEDITOR.plugins.add( 'autogrow',
 	{
 		init : function( editor )
 		{
-			var contentMargin = 0;
-			var resizeEditor = function( editor )
-			{
-				if ( !editor.window )
-					return;
-
-				var doc = editor.document,
-					resizeable = editor.getResizable( 1 ),
-					body = doc.getBody(),
-					htmlElement = doc.getDocumentElement(),
-					currentHeight = resizeable.$.offsetHeight,
-					newHeight;
-
-				// Quirks mode overflows body except for IE9, standards overflows document element.
-				var scrollable = !CKEDITOR.env.ie9Compat && doc.$.compatMode == 'BackCompat' ? body : htmlElement,
-					contentHeight = docContentHeight( doc ),
-					delta = contentHeight - scrollable.$.clientHeight + extra( scrollable );
-
-				// Delta height from either increasing or decreasing.
-				if ( delta )
-				{
-					newHeight = currentHeight + delta;
-					var min = editor.config.autoGrow_minHeight,
-						max = editor.config.autoGrow_maxHeight;
-
-					( min == undefined ) && ( editor.config.autoGrow_minHeight = min = 200 );
-					if ( min )
-						newHeight = Math.max( newHeight, min );
-					if ( max )
-						newHeight = Math.min( newHeight, max );
-
-					if ( newHeight != currentHeight )
-					{
-						newHeight = editor.fire( 'autoGrow', { currentHeight : currentHeight, newHeight : newHeight } ).newHeight;
-						resizeable.setStyle( 'height', newHeight + 'px' );
-						editor.fire( 'resize' );
-						// Calculate and record now the margin between the actual content size and page size.
-						setTimeout( function() { contentMargin = scrollable.scrollHeight - body.offsetHeight; }, 0 );
-
-					}
-				}
-			};
-
 			for ( var eventName in { contentDom:1, key:1, selectionChange:1, insertElement:1 } )
 			{
@@ -106,6 +54,6 @@
 						setTimeout( function(){ resizeEditor( evt.editor ); }, 100 );
 					}
-			});
-		}
+				});
+			}
 		}
 	});
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/bidi/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/bidi/plugin.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/bidi/plugin.js	(revision 7060)
@@ -39,8 +39,11 @@
 
 		// If we're having BODY here, user probably done CTRL+A, let's try to get the enclosed node, if any.
-		selectedElement.is( 'body' ) &&
-			( selectedElement = editor.getSelection().getRanges()[ 0 ].getEnclosedNode() );
-
-		if ( !selectedElement )
+		if ( selectedElement.is( 'body' ) )
+		{
+			var enclosedNode = editor.getSelection().getRanges()[ 0 ].getEnclosedNode();
+			enclosedNode && enclosedNode.type == CKEDITOR.NODE_ELEMENT && ( selectedElement = enclosedNode );
+		}
+
+		if ( !selectedElement  )
 			return;
 
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/dialog/plugin.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/dialog/plugin.js	(revision 7060)
@@ -103,4 +103,14 @@
 				: input.setAttribute( 'aria-invalid', true );
 		}
+
+		if ( !isValid )
+		{
+			if ( this.select )
+				this.select();
+			else
+				this.focus();
+		}
+
+		msg && alert( msg );
 
 		this.fire( 'validated', { valid : isValid, msg : msg } );
@@ -295,19 +305,14 @@
 						{
 							var retval = item.validate( this ),
-								isValid = retval === true ;
-
-							if ( !isValid )
+								invalid = typeof ( retval ) == 'string' || retval === false;
+
+							if ( invalid )
 							{
-								if ( item.select )
-									item.select();
-								else
-									item.focus();
-
 								evt.data.hide = false;
 								evt.stop();
 							}
-
-							handleFieldValidated.call( item, isValid, typeof retval == 'string' ? retval : undefined );
-							return  !isValid;
+							
+							handleFieldValidated.call( item, !invalid, typeof retval == 'string' ? retval : undefined );
+							return invalid;
 						}
 					});
@@ -2985,20 +2990,5 @@
 					}
 
-					if ( !passed )
-					{
-						if ( msg !== undefined )
-							alert( msg );
-						if ( this.select || this.focus  )
-						{
-							if ( this.select )
-								this.select();
-							else
-								this.focus();
-						}
-
-						return false;
-					}
-
-					return true;
+					return !passed ? msg : true;
 				};
 			},
@@ -3013,18 +3003,5 @@
 				{
 					var value = this && this.getValue ? this.getValue() : arguments[0];
-					if ( !regex.test( value ) )
-					{
-						if ( msg !== undefined )
-							alert( msg );
-						if ( this && ( this.select || this.focus ) )
-						{
-							if ( this.select )
-								this.select();
-							else
-								this.focus();
-						}
-						return false;
-					}
-					return true;
+					return !regex.test( value ) ? msg : true;
 				};
 			},
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/fakeobjects/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/fakeobjects/plugin.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/fakeobjects/plugin.js	(revision 7060)
@@ -6,4 +6,31 @@
 (function()
 {
+	var cssStyle = CKEDITOR.htmlParser.cssStyle,
+			cssLength = CKEDITOR.tools.cssLength;
+
+	var cssLengthRegex = /^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i;
+
+	/*
+	 * Replacing the former CSS length value with the later one, with
+	 * adjustment to the length  unit.
+	 */
+	function replaceCssLength( length1, length2 )
+	{
+		var parts1 = cssLengthRegex.exec( length1 ),
+				parts2 = cssLengthRegex.exec( length2 );
+
+		// Omit pixel length unit when necessary,
+		// e.g. replaceCssLength( 10, '20px' ) -> 20
+		if ( parts1 )
+		{
+			if ( !parts1[ 2 ] && parts2[ 2 ] == 'px' )
+				return parts2[ 1 ];
+			if ( parts1[ 2 ] == 'px' && !parts2[ 2 ] )
+				return parts2[ 1 ] + 'px';
+		}
+
+		return length2;
+	}
+
 	var htmlFilterRules =
 	{
@@ -17,26 +44,14 @@
 					realElement = realFragment && realFragment.children[ 0 ];
 
-				// If we have width/height in the element, we must move it into
-				// the real element.
+				// Width/height in the fake object are subjected to clone into the real element.
 				if ( realElement && element.attributes[ 'data-cke-resizable' ] )
 				{
-					var style = element.attributes.style;
+					var styles = new cssStyle( element ).rules,
+						realAttrs = realElement.attributes,
+						width = styles.width,
+						height = styles.height;
 
-					if ( style )
-					{
-						// Get the width from the style.
-						var match = /(?:^|\s)width\s*:\s*(.*?)(:?;|$)/i.exec( style ),
-							width = match && match[1];
-
-						// Get the height from the style.
-						match = /(?:^|\s)height\s*:\s*(.*?)(:?;|$)/i.exec( style );
-						var height = match && match[1];
-
-						if ( width )
-							realElement.attributes.width = CKEDITOR.tools.convertToPx( width );
-
-						if ( height )
-							realElement.attributes.height = CKEDITOR.tools.convertToPx( height );
-					}
+					width && ( realAttrs.width = replaceCssLength( realAttrs.width, width ) );
+					height && ( realAttrs.height = replaceCssLength( realAttrs.height, height ) );
 				}
 
@@ -59,68 +74,102 @@
 		}
 	});
-})();
 
-CKEDITOR.editor.prototype.createFakeElement = function( realElement, className, realElementType, isResizable )
-{
-	var lang = this.lang.fakeobjects,
-		label = lang[ realElementType ] || lang.unknown;
+	CKEDITOR.editor.prototype.createFakeElement = function( realElement, className, realElementType, isResizable )
+	{
+		var lang = this.lang.fakeobjects,
+			label = lang[ realElementType ] || lang.unknown;
 
-	var attributes =
-	{
-		'class' : className,
-		src : CKEDITOR.getUrl( 'images/spacer.gif' ),
-		'data-cke-realelement' : encodeURIComponent( realElement.getOuterHtml() ),
-		'data-cke-real-node-type' : realElement.type,
-		alt : label,
-		title : label,
-		align : realElement.getAttribute( 'align' ) || ''
+		var attributes =
+		{
+			'class' : className,
+			src : CKEDITOR.getUrl( 'images/spacer.gif' ),
+			'data-cke-realelement' : encodeURIComponent( realElement.getOuterHtml() ),
+			'data-cke-real-node-type' : realElement.type,
+			alt : label,
+			title : label,
+			align : realElement.getAttribute( 'align' ) || ''
+		};
+
+		if ( realElementType )
+			attributes[ 'data-cke-real-element-type' ] = realElementType;
+
+		if ( isResizable )
+		{
+			attributes[ 'data-cke-resizable' ] = isResizable;
+
+			var fakeStyle = new cssStyle();
+
+			var width = realElement.getAttribute( 'width' ),
+				height = realElement.getAttribute( 'height' );
+
+			width && ( fakeStyle.rules.width = cssLength( width ) );
+			height && ( fakeStyle.rules.height = cssLength( height ) );
+			fakeStyle.populate( attributes );
+		}
+
+		return this.document.createElement( 'img', { attributes : attributes } );
 	};
 
-	if ( realElementType )
-		attributes[ 'data-cke-real-element-type' ] = realElementType;
+	CKEDITOR.editor.prototype.createFakeParserElement = function( realElement, className, realElementType, isResizable )
+	{
+		var lang = this.lang.fakeobjects,
+			label = lang[ realElementType ] || lang.unknown,
+			html;
 
-	if ( isResizable )
-		attributes[ 'data-cke-resizable' ] = isResizable;
+		var writer = new CKEDITOR.htmlParser.basicWriter();
+		realElement.writeHtml( writer );
+		html = writer.getHtml();
 
-	return this.document.createElement( 'img', { attributes : attributes } );
-};
+		var attributes =
+		{
+			'class' : className,
+			src : CKEDITOR.getUrl( 'images/spacer.gif' ),
+			'data-cke-realelement' : encodeURIComponent( html ),
+			'data-cke-real-node-type' : realElement.type,
+			alt : label,
+			title : label,
+			align : realElement.attributes.align || ''
+		};
 
-CKEDITOR.editor.prototype.createFakeParserElement = function( realElement, className, realElementType, isResizable )
-{
-	var lang = this.lang.fakeobjects,
-		label = lang[ realElementType ] || lang.unknown,
-		html;
+		if ( realElementType )
+			attributes[ 'data-cke-real-element-type' ] = realElementType;
 
-	var writer = new CKEDITOR.htmlParser.basicWriter();
-	realElement.writeHtml( writer );
-	html = writer.getHtml();
+		if ( isResizable )
+		{
+			attributes[ 'data-cke-resizable' ] = isResizable;
+			var realAttrs = realElement.attributes,
+				fakeStyle = new cssStyle();
 
-	var attributes =
-	{
-		'class' : className,
-		src : CKEDITOR.getUrl( 'images/spacer.gif' ),
-		'data-cke-realelement' : encodeURIComponent( html ),
-		'data-cke-real-node-type' : realElement.type,
-		alt : label,
-		title : label,
-		align : realElement.attributes.align || ''
+			var width = realAttrs.width,
+				height = realAttrs.height;
+
+			width != undefined && ( fakeStyle.rules.width =  cssLength( width ) );
+			height != undefined && ( fakeStyle.rules.height = cssLength ( height ) );
+			fakeStyle.populate( attributes );
+		}
+
+		return new CKEDITOR.htmlParser.element( 'img', attributes );
 	};
 
-	if ( realElementType )
-		attributes[ 'data-cke-real-element-type' ] = realElementType;
+	CKEDITOR.editor.prototype.restoreRealElement = function( fakeElement )
+	{
+		if ( fakeElement.data( 'cke-real-node-type' ) != CKEDITOR.NODE_ELEMENT )
+			return null;
 
-	if ( isResizable )
-		attributes[ 'data-cke-resizable' ] = isResizable;
+		var element = CKEDITOR.dom.element.createFromHtml(
+			decodeURIComponent( fakeElement.data( 'cke-realelement' ) ),
+			this.document );
 
-	return new CKEDITOR.htmlParser.element( 'img', attributes );
-};
+		if ( fakeElement.data( 'cke-resizable') )
+		{
+			var width = fakeElement.getStyle( 'width' ),
+				height = fakeElement.getStyle( 'height' );
 
-CKEDITOR.editor.prototype.restoreRealElement = function( fakeElement )
-{
-	if ( fakeElement.data( 'cke-real-node-type' ) != CKEDITOR.NODE_ELEMENT )
-		return null;
+			width && element.setAttribute( 'width', replaceCssLength( element.getAttribute( 'width' ), width ) );
+			height && element.setAttribute( 'height', replaceCssLength( element.getAttribute( 'height' ), height ) );
+		}
+		
+		return element;
+	}
 
-	return CKEDITOR.dom.element.createFromHtml(
-		decodeURIComponent( fakeElement.data( 'cke-realelement' ) ),
-		this.document );
-};
+})();
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/flash/dialogs/flash.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/flash/dialogs/flash.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/flash/dialogs/flash.js	(revision 7060)
@@ -371,15 +371,6 @@
 									label : editor.lang.common.width,
 									validate : CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength.replace( '%1', editor.lang.common.width ) ),
-									setup : function( objectNode, embedNode, paramMap, fakeImage )
-									{
-										loadValue.apply( this, arguments );
-										fakeImage && this.setValue( fakeImage.getStyle( 'width' ) );
-									},
-									commit : function( objectNode, embedNode, paramMap, extraStyles )
-									{
-										commitValue.apply( this, arguments );
-										var val = this.getValue();
-										val && ( extraStyles.width = defaultToPixel( val ) );
-									}
+									setup : loadValue,
+									commit : commitValue
 								},
 								{
@@ -389,15 +380,6 @@
 									label : editor.lang.common.height,
 									validate : CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength.replace( '%1', editor.lang.common.height ) ),
-									setup : function( objectNode, embedNode, paramMap, fakeImage )
-									{
-										loadValue.apply( this, arguments );
-										fakeImage && this.setValue( fakeImage.getStyle( 'height' ) );
-									},
-									commit : function( objectNode, embedNode, paramMap, extraStyles )
-									{
-										commitValue.apply( this, arguments );
-										var val = this.getValue();
-										val && ( extraStyles.height = defaultToPixel( val ) );
-									}
+									setup : loadValue,
+									commit : commitValue
 								},
 								{
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/flash/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/flash/plugin.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/flash/plugin.js	(revision 7060)
@@ -7,6 +7,4 @@
 {
 	var flashFilenameRegex = /\.swf(?:$|\?)/i;
-
-	var cssifyLength = CKEDITOR.tools.cssLength;
 
 	function isFlashEmbed( element )
@@ -19,17 +17,5 @@
 	function createFakeElement( editor, realElement )
 	{
-		var fakeElement = editor.createFakeParserElement( realElement, 'cke_flash', 'flash', true ),
-			fakeStyle = fakeElement.attributes.style || '';
-
-		var width = realElement.attributes.width,
-			height = realElement.attributes.height;
-
-		if ( typeof width != 'undefined' )
-			fakeStyle = fakeElement.attributes.style = fakeStyle + 'width:' + cssifyLength( width ) + ';';
-
-		if ( typeof height != 'undefined' )
-			fakeStyle = fakeElement.attributes.style = fakeStyle + 'height:' + cssifyLength( height ) + ';';
-
-		return fakeElement;
+		return editor.createFakeParserElement( realElement, 'cke_flash', 'flash', true );
 	}
 
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/format/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/format/plugin.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/format/plugin.js	(revision 7060)
@@ -64,6 +64,4 @@
 					{
 						editor.fire( 'saveSnapshot' );
-						// At this point, focus might be lost (#7192).
-						CKEDITOR.env.ie && editor.focus();
 					}, 0 );
 				},
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/forms/dialogs/select.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/forms/dialogs/select.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/forms/dialogs/select.js	(revision 7060)
@@ -189,5 +189,4 @@
 						'default' : '',
 						accessKey : 'N',
-						align : 'center',
 						style : 'width:350px',
 						setup : function( name, element )
@@ -238,5 +237,4 @@
 						type : 'hbox',
 						widths : [ '175px', '170px' ],
-						align : 'center',
 						children :
 						[
@@ -244,5 +242,4 @@
 								id : 'txtSize',
 								type : 'text',
-								align : 'center',
 								labelLayout : 'horizontal',
 								label : editor.lang.select.size,
@@ -283,5 +280,4 @@
 						type : 'hbox',
 						widths : [ '115px', '115px' ,'100px' ],
-						align : 'top',
 						children :
 						[
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/iframe/dialogs/iframe.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/iframe/dialogs/iframe.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/iframe/dialogs/iframe.js	(revision 7060)
@@ -13,6 +13,4 @@
 		frameborder : { 'true' : '1', 'false' : '0' }
 	};
-
-	var defaultToPixel = CKEDITOR.tools.cssLength;
 
 	function loadValue( iframeNode )
@@ -127,16 +125,6 @@
 									label : commonLang.width,
 									validate : CKEDITOR.dialog.validate.htmlLength( commonLang.invalidHtmlLength.replace( '%1', commonLang.width ) ),
-									getValue : defaultToPixel,
-									setup : function( iframeNode, fakeImage )
-									{
-										loadValue.apply( this, arguments );
-										fakeImage && this.setValue( fakeImage.getStyle( 'width' ) );
-									},
-									commit : function( iframeNode, extraStyles )
-									{
-										commitValue.apply( this, arguments );
-										var val = this.getValue();
-										val && ( extraStyles.width = val );
-									}
+									setup : loadValue,
+									commit : commitValue
 								},
 								{
@@ -147,16 +135,6 @@
 									label : commonLang.height,
 									validate : CKEDITOR.dialog.validate.htmlLength( commonLang.invalidHtmlLength.replace( '%1', commonLang.height ) ),
-									getValue : defaultToPixel,
-									setup : function( iframeNode, fakeImage )
-									{
-										loadValue.apply( this, arguments );
-										fakeImage && this.setValue( fakeImage.getStyle( 'height' ) );
-									},
-									commit : function( iframeNode, extraStyles )
-									{
-										commitValue.apply( this, arguments );
-										var val = this.getValue();
-										val && ( extraStyles.height = val );
-									}
+									setup : loadValue,
+									commit : commitValue
 								},
 								{
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/iframe/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/iframe/plugin.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/iframe/plugin.js	(revision 7060)
@@ -6,23 +6,4 @@
 (function()
 {
-	function createFakeElement( editor, realElement )
-	{
-		var fakeElement = editor.createFakeParserElement( realElement, 'cke_iframe', 'iframe', true ),
-			fakeStyle = fakeElement.attributes.style || '';
-
-		var width = realElement.attributes.width,
-			height = realElement.attributes.height;
-
-		if ( typeof width != 'undefined' )
-			fakeStyle += 'width:' + CKEDITOR.tools.cssLength( width ) + ';';
-
-		if ( typeof height != 'undefined' )
-			fakeStyle += 'height:' + CKEDITOR.tools.cssLength( height ) + ';';
-
-		fakeElement.attributes.style = fakeStyle;
-
-		return fakeElement;
-	}
-
 	CKEDITOR.plugins.add( 'iframe',
 	{
@@ -97,5 +78,5 @@
 						iframe : function( element )
 						{
-							return createFakeElement( editor, element );
+							return editor.createFakeParserElement( element, 'cke_iframe', 'iframe', true );
 						}
 					}
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/list/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/list/plugin.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/list/plugin.js	(revision 7060)
@@ -1,3 +1,3 @@
-﻿/*
+﻿﻿/*
 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -108,4 +108,6 @@
 					if ( orgDir != rootNode.getDirection( 1 ) )
 						currentListItem.setAttribute( 'dir', orgDir );
+					else
+						currentListItem.removeAttribute( 'dir' );
 
 					for ( var i = 0 ; i < item.contents.length ; i++ )
@@ -151,5 +153,7 @@
 
 					if ( item.grandparent.getDirection( 1 ) != orgDir && currentListItem.type == CKEDITOR.NODE_ELEMENT )
-							currentListItem.setAttribute( 'dir', orgDir );
+						currentListItem.setAttribute( 'dir', orgDir );
+					else
+						currentListItem.removeAttribute( 'dir' );
 
 					for ( i = 0 ; i < item.contents.length ; i++ )
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/listblock/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/listblock/plugin.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/listblock/plugin.js	(revision 7060)
@@ -37,5 +37,6 @@
 					keys[ 38 ]	= 'prev';					// ARROW-UP
 					keys[ CKEDITOR.SHIFT + 9 ]	= 'prev';	// SHIFT + TAB
-					keys[ 32 ]	= 'click';					// SPACE
+					keys[ 32 ]	= CKEDITOR.env.ie ? 'mouseup' : 'click';					// SPACE
+					CKEDITOR.env.ie && ( keys[ 13 ] = 'mouseup' );		// Manage ENTER, since onclick is blocked in IE (#8041).
 
 					this._.pendingHtml = [];
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/menu/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/menu/plugin.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/menu/plugin.js	(revision 7060)
@@ -300,6 +300,7 @@
 					keys[ 38 ]	= 'prev';					// ARROW-UP
 					keys[ CKEDITOR.SHIFT + 9 ]	= 'prev';	// SHIFT + TAB
-					keys[ 32 ]	= 'click';					// SPACE
-					keys[ ( editor.lang.dir == 'rtl' ? 37 : 39 ) ]	= 'click';  // ARROW-RIGHT/ARROW-LEFT(rtl)
+					keys[ ( editor.lang.dir == 'rtl' ? 37 : 39 ) ]= CKEDITOR.env.ie ? 'mouseup' : 'click';  // ARROW-RIGHT/ARROW-LEFT(rtl)
+					keys[ 32 ]	= CKEDITOR.env.ie ? 'mouseup' : 'click';					// SPACE
+					CKEDITOR.env.ie && ( keys[ 13 ] = 'mouseup' );		// Manage ENTER, since onclick is blocked in IE (#8041).
 
 					element = this._.element = block.element;
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/panel/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/panel/plugin.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/panel/plugin.js	(revision 7060)
@@ -381,9 +381,10 @@
 
 				case 'click' :
+				case 'mouseup' :
 					index = this._.focusIndex;
 					link = index >= 0 && this.element.getElementsByTag( 'a' ).getItem( index );
 
 					if ( link )
-						link.$.click ? link.$.click() : link.$.onclick();
+						link.$[ keyAction ] ? link.$[ keyAction ]() : link.$[ 'on' + keyAction ]();
 
 					return false;
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/showborders/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/showborders/plugin.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/showborders/plugin.js	(revision 7060)
@@ -19,5 +19,5 @@
 		  [
 			'.%1 table.%2,',
-			 '.%1 table.%2 td, .%1 table.%2 th,',
+			 '.%1 table.%2 td, .%1 table.%2 th',
 			 '{',
 				'border : #d3d3d3 1px dotted',
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/table/dialogs/table.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/table/dialogs/table.js	(revision 7059)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/table/dialogs/table.js	(revision 7060)
@@ -524,11 +524,9 @@
 											var caption = nodeList.getItem( 0 );
 
-											var innerHtml = caption.getHtml().replace(/<br>\s*$/i, ''),
-												innerText = caption.getText();
-
-											if ( innerHtml != innerText )
+											var firstElementChild = caption.getFirst( CKEDITOR.dom.walker.nodeType( CKEDITOR.NODE_ELEMENT ) )
+											if ( firstElementChild && !firstElementChild.equals( caption.getBogus() ) )
 											{
 												this.disable();
-												this.setValue( innerText );
+												this.setValue( caption.getText() );
 												return;
 											}
