Skip to content
Permalink
Browse files

Merge branch 't/12735'

  • Loading branch information...
Reinmar committed Dec 15, 2014
2 parents 882e4a1 + fdf8ca4 commit 3f0ab19fd890e10e5e9d19f72bf359891363a2d0
Showing with 34 additions and 9 deletions.
  1. +1 −0 CHANGES.md
  2. +4 −2 core/htmldataprocessor.js
  3. +9 −7 tests/core/htmldataprocessor.js
  4. +11 −0 tests/tickets/12735/1.html
  5. +9 −0 tests/tickets/12735/1.md
@@ -6,6 +6,7 @@ CKEditor 4 Changelog
Fixed Issues:

* [#12747](http://dev.ckeditor.com/ticket/12747): [IE8-10] Fixed: Opening a drop-down for a specific selection when editor is maximized results in incorrect drop-down panel position.
* [#12735](http://dev.ckeditor.com/ticket/12735): Fixed: [`Config.fillEmptyBlocks`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-fillEmptyBlocks) should only apply when outputting data.

## CKEditor 4.4.6

@@ -328,9 +328,11 @@

cleanBogus( block );

var shouldFillBlock = typeof fillEmptyBlock == 'function' ? fillEmptyBlock( block ) : fillEmptyBlock;
// Add fillers to input (always) and to output (if fillEmptyBlock is ok with that).
var shouldFillBlock = !isOutput ||
( typeof fillEmptyBlock == 'function' ? fillEmptyBlock( block ) : fillEmptyBlock ) !== false;

if ( shouldFillBlock !== false && isEmptyBlockNeedFiller( block ) ) {
if ( shouldFillBlock && isEmptyBlockNeedFiller( block ) ) {
block.add( createFiller( isOutput ) );
}
};
@@ -1061,15 +1061,18 @@

bogus = ' ';

assert.areSame( '<p>' + bogus + '</p>', htmlDP.toDataFormat( '<p></p>' ), 'toDF 1' );
assert.areSame( '<p>' + bogus + '</p>', htmlDP.toDataFormat( '<p></p>' ), 'toDF 1' );
assert.areSame( '<div><h1>' + bogus + '</h1></div>', htmlDP.toDataFormat( '<div><h1></h1></div>' ), 'toDF 2' );
},

'test config.fillEmptyBlocks - false': function() {
var htmlDP = this.editor4.dataProcessor;
var htmlDP = this.editor4.dataProcessor,
bogus = CKEDITOR.env.needsBrFiller ? '<br />' : '';

assert.areSame( '<p></p>', htmlDP.toHtml( '<p></p>' ), 'toHtml 1' );
assert.areSame( '<div><h1></h1></div>', htmlDP.toHtml( '<div><h1></h1></div>' ), 'toHtml 1' );
// Even though filler fillEmptyBlocks is set to false, we should still put bogus to HTML,
// which will be displayed in editable. (#12735)
assert.areSame( '<p>' + bogus + '</p>', htmlDP.toHtml( '<p></p>' ), 'toHtml 1' );
assert.areSame( '<div><h1>' + bogus + '</h1></div>', htmlDP.toHtml( '<div><h1></h1></div>' ), 'toHtml 1' );

assert.areSame( '<p></p>', htmlDP.toDataFormat( '<p></p>' ), 'toDF 1' );
assert.areSame( '<div><h1></h1></div>', htmlDP.toDataFormat( '<div><h1></h1></div>' ), 'toDF 2' );
@@ -1080,7 +1083,7 @@
bogus = CKEDITOR.env.needsBrFiller ? '<br />' : '';

assert.areSame( '<p>' + bogus + '</p>', htmlDP.toHtml( '<p></p>' ), 'toHtml 1' );
assert.areSame( '<h1></h1>', htmlDP.toHtml( '<h1></h1>' ), 'toHtml 1' );
assert.areSame( '<h1>' + bogus + '</h1>', htmlDP.toHtml( '<h1></h1>' ), 'toHtml 2' );

bogus = '&nbsp;';

@@ -1148,8 +1151,6 @@
'<p><img onerror="%xss%" src="produce404" /></p>' );

// #11635

bender.test( tcs );
addXssTC( tcs, 'video onerror', '<p><video onerror="%xss%">foo</video></p>' );
addXssTC( tcs, 'video onerror + src', '<p><video onerror="%xss%" src="produce404">foo</video></p>' );
addXssTC( tcs, 'video src + onerror',
@@ -1207,4 +1208,5 @@
'<p><onxxx>foo</onxxx>bar</p>' );
}

bender.test( tcs );
} )();
@@ -0,0 +1,11 @@
<div id="editor1">
<p>x</p>
<p></p>
<p>y</p>
</div>

<script>
CKEDITOR.replace( 'editor1', {
fillEmptyBlocks: false
} );
</script>
@@ -0,0 +1,9 @@
@bender-tags: 4.4.7, tc
@bender-ui: collapsed
@bender-ckeditor-plugins: wysiwygarea, toolbar, clipboard, enterkey, htmlwriter, sourcearea

----

1. Look at the editable.

**Expected:** There should be an empty paragraph between _x_ and _y_.

0 comments on commit 3f0ab19

Please sign in to comment.
You can’t perform that action at this time.