Index: /CKEditor/branches/versions/3.5.x/CHANGES.html
===================================================================
--- /CKEditor/branches/versions/3.5.x/CHANGES.html	(revision 6137)
+++ /CKEditor/branches/versions/3.5.x/CHANGES.html	(revision 6138)
@@ -46,4 +46,5 @@
 		<li><a href="http://dev.ckeditor.com/ticket/6334">#6334</a> : CKEditor now uses <a href="http://www.w3.org/TR/2010/WD-html5-20101019/elements.html#embedding-custom-non-visible-data-with-the-data-attributes">HTML5's data-* attributes</a> for its internal attributes.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/6103">#6103</a> : It's now possible to control the styling of inline read-only elements with the disableReadonlyStyling setting. It's also possible to avoid inline-styling any element by setting its data-cke-nostyle attribute to "1".</li>
+		<li><a href="http://dev.ckeditor.com/ticket/5404">#5404</a> : "fillEmptyBlocks" configuration option of v2 is now available.</li>
 	</ul>
 	<p>
Index: /CKEditor/branches/versions/3.5.x/_source/plugins/htmldataprocessor/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.5.x/_source/plugins/htmldataprocessor/plugin.js	(revision 6137)
+++ /CKEditor/branches/versions/3.5.x/_source/plugins/htmldataprocessor/plugin.js	(revision 6138)
@@ -39,6 +39,10 @@
 	}
 
-	function blockNeedsExtension( block, fromSource )
-	{
+	function blockNeedsExtension( block, fromSource, extendEmptyBlock )
+	{
+		if( !extendEmptyBlock ||
+			typeof extendEmptyBlock == 'function' && ( extendEmptyBlock( block ) == false ) )
+			return false;
+
         // 1. For IE version >=8,  empty blocks are displayed correctly themself in wysiwiyg;
         // 2. For the rest, at least table cell and list item need no filler space.
@@ -52,30 +56,25 @@
 		var lastChild = lastNoneSpaceChild( block );
 
-		return !lastChild
-			|| lastChild.type == CKEDITOR.NODE_ELEMENT && lastChild.name == 'br'
-			// Some of the controls in form needs extension too,
-			// to move cursor at the end of the form. (#4791)
-			|| block.name == 'form' && lastChild.name == 'input';
-	}
-
-	function extendBlockForDisplay( block )
-	{
-		trimFillers( block, true );
-
-		if ( blockNeedsExtension( block, true ) )
-		{
-			if ( CKEDITOR.env.ie )
-				block.add( new CKEDITOR.htmlParser.text( '\xa0' ) );
-			else
-				block.add( new CKEDITOR.htmlParser.element( 'br', {} ) );
+		return !lastChild || lastChild &&
+				( lastChild.type == CKEDITOR.NODE_ELEMENT && lastChild.name == 'br'
+				// Some of the controls in form needs extension too,
+				// to move cursor at the end of the form. (#4791)
+				|| block.name == 'form' && lastChild.name == 'input' );
+	}
+
+	function getBlockExtension( isOutput, emptyBlockFiller )
+	{
+		return function( node )
+		{
+			trimFillers( node, !isOutput );
+
+			if ( blockNeedsExtension( node, !isOutput, emptyBlockFiller ) )
+			{
+				if ( isOutput || CKEDITOR.env.ie )
+					node.add( new CKEDITOR.htmlParser.text( '\xa0' ) );
+				else
+					node.add( new CKEDITOR.htmlParser.element( 'br', {} ) );
+			}
 		}
-	}
-
-	function extendBlockForOutput( block )
-	{
-		trimFillers( block );
-
-		if ( blockNeedsExtension( block ) )
-			block.add( new CKEDITOR.htmlParser.text( '\xa0' ) );
 	}
 
@@ -106,5 +105,5 @@
 
 	for ( i in blockLikeTags )
-		defaultDataBlockFilterRules.elements[ i ] = extendBlockForDisplay;
+		defaultDataBlockFilterRules.elements[ i ] = getBlockExtension();
 
 	var defaultHtmlFilterRules =
@@ -242,9 +241,4 @@
 			}
 		};
-
-	var defaultHtmlBlockFilterRules = { elements : {} };
-
-	for ( i in blockLikeTags )
-		defaultHtmlBlockFilterRules.elements[ i ] = extendBlockForOutput;
 
 	if ( CKEDITOR.env.ie )
@@ -413,5 +407,15 @@
 			dataProcessor.dataFilter.addRules( defaultDataBlockFilterRules );
 			dataProcessor.htmlFilter.addRules( defaultHtmlFilterRules );
+
+			var defaultHtmlBlockFilterRules = { elements : {} };
+			for ( i in blockLikeTags )
+				defaultHtmlBlockFilterRules.elements[ i ] = getBlockExtension( true, editor.config.fillEmptyBlocks );
+
 			dataProcessor.htmlFilter.addRules( defaultHtmlBlockFilterRules );
+		},
+		
+		onLoad : function()
+		{
+			! ( 'fillEmptyBlocks' in CKEDITOR.config ) && ( CKEDITOR.config.fillEmptyBlocks = 1 );
 		}
 	});
@@ -511,2 +515,23 @@
  * config.forceSimpleAmpersand = false;
  */
+
+/**
+ * Whether a filler text (non-breaking space entity - &nbsp;) will be inserted into empty block elements in HTML output,
+ * this is used to render block elements properly with line-height; When a function is instead specified,
+ * it'll be passed a {@link CKEDITOR.htmlParser.element} to decide whether adding the filler text
+ * by expecting a boolean return value.
+ * @name CKEDITOR.config.fillEmptyBlocks;
+ * @since 3.5
+ * @type Boolean
+ * @default true
+ * @example
+ * config.fillEmptyBlocks = false;	// Prevent filler nodes in all empty blocks.
+ *
+ * // Prevent filler node only in float cleaners.
+ * config.fillEmptyBlocks = function( element )
+ * {
+ * 	if ( element.attributes[ 'class' ].indexOf ( 'clear-both' ) != -1 )
+ * 		return false;
+ * }
+ */
+
