Skip to content

Commit

Permalink
Merge branch 't/12148' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Sep 29, 2014
2 parents aec5cb6 + 8b385eb commit 8969f97
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions core/dom/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
Expand Down
24 changes: 24 additions & 0 deletions tests/core/dom/element/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );
Expand Down

0 comments on commit 8969f97

Please sign in to comment.