Skip to content
Permalink
Browse files

Merge branch 't/12148' into major

  • Loading branch information...
Reinmar committed Sep 29, 2014
2 parents aec5cb6 + 8b385eb commit 8969f979086b6efed213806aea0f6a51affef0df
Showing with 26 additions and 0 deletions.
  1. +1 −0 CHANGES.md
  2. +1 −0 core/dom/element.js
  3. +24 −0 tests/core/dom/element/element.js
@@ -20,6 +20,7 @@ Fixed Issues:
* [#12024](http://dev.ckeditor.com/ticket/12024): [Nested widgets][FF] Fixed: Outline is extended to the left by unpositioned drag handlers.
* [#12006](http://dev.ckeditor.com/ticket/12006): [Nested widgets] Fixed: Drag and drop of nested block widgets.
* [#12008](http://dev.ckeditor.com/ticket/12008): Fixed various cases of inserting single non-editable element using [`editor.insertHtml()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertHtml) method. Fixes pasting widget with nested editable inside other widget's nested editable.
* [#12148](http://dev.ckeditor.com/ticket/12148): Fixed: [`dom.element.getChild()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-getChild) should not modify passed array.

## CKEditor 4.4.6

@@ -1769,6 +1769,7 @@ CKEDITOR.dom.element.clearMarkers = function( database, element, removeFromDatab
if ( !indices.slice )
rawNode = getChild( rawNode, indices );
else {
indices = indices.slice();
while ( indices.length > 0 && rawNode )
rawNode = getChild( rawNode, indices.shift() );
}
@@ -83,6 +83,30 @@ bender.test( appendDomObjectTests(
assert.areSame( 'figure', element.getName( 'figure' ) );
},

'test getChild - single index': function() {
var element = CKEDITOR.dom.element.createFromHtml( '<ul><li>zero</li><li>one</li></ul>' );

assert.areSame( 'zero', element.getChild( 0 ).getHtml() );
assert.areSame( 'one', element.getChild( 1 ).getHtml() );
},

'test getChild - array selector': function() {
var element = CKEDITOR.dom.element.createFromHtml( '<div><ul><li>zero</li><li>one</li></ul></div>' );

assert.areSame( 'ul', element.getChild( [ 0 ] ).getName() );
assert.areSame( 'one', element.getChild( [ 0, 1 ] ).getHtml() );
assert.isNull( element.getChild( [ 0, 2 ] ) );
assert.isNull( element.getChild( [ 1, 0 ] ) );
},

'test getChild does not modify array': function() {
var selector = [ 1, 0 ],
element = CKEDITOR.dom.element.createFromHtml( '<div><ul><li>zero</li><li>one</li></ul></div>' );

element.getChild( selector );
assert.areSame( 2, selector.length );
},

test_append1 : function() {
var element = newElement( document.getElementById( 'append' ) );
element.append( newElement( 'b' ) );

0 comments on commit 8969f97

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