Skip to content

Commit

Permalink
Merge branch 't/10879' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Oct 14, 2013
2 parents 4bafac0 + ccc47c4 commit 433e5ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -15,6 +15,7 @@ Fixed Issues:
* [#10835](http://dev.ckeditor.com/ticket/10835): [Enhanced Image](http://ckeditor.com/addon/image2): Improved visibility of the resize handle.
* [#10836](http://dev.ckeditor.com/ticket/10836): [Enhanced Image](http://ckeditor.com/addon/image2): Preserve custom mouse cursor while resizing the image.
* [#10881](http://dev.ckeditor.com/ticket/10881): Various improvements to *Enter* key behaviour in nested editables.
* [#10879](http://dev.ckeditor.com/ticket/10879): Remove format should not leak from nested editable.

## CKEditor 4.3 Beta

Expand Down
14 changes: 12 additions & 2 deletions core/dom/range.js
Expand Up @@ -982,6 +982,9 @@ CKEDITOR.dom.range = function( root ) {
enlargeable = container;
}

// Ensures that enlargeable can be indeed enlarged, if not it will be nulled.
enlargeable = getValidEnlargeable( enlargeable );

while ( enlargeable || sibling ) {
if ( enlargeable && !sibling ) {
// If we reached the common ancestor, mark the flag
Expand Down Expand Up @@ -1094,7 +1097,7 @@ CKEDITOR.dom.range = function( root ) {
}

if ( enlargeable )
enlargeable = enlargeable.getParent();
enlargeable = getValidEnlargeable( enlargeable.getParent() );
}

// Process the end boundary. This is basically the same
Expand Down Expand Up @@ -1225,7 +1228,7 @@ CKEDITOR.dom.range = function( root ) {
}

if ( enlargeable )
enlargeable = enlargeable.getParent();
enlargeable = getValidEnlargeable( enlargeable.getParent() );
}

// If the common ancestor can be enlarged by both boundaries, then include it also.
Expand Down Expand Up @@ -1321,6 +1324,13 @@ CKEDITOR.dom.range = function( root ) {
if ( tailBr )
this.setEndAfter( tailBr );
}

// Ensures that returned element can be enlarged by selection, null otherwise.
// @param {CKEDITOR.dom.element} enlargeable
// @returns {CKEDITOR.dom.element/null}
function getValidEnlargeable( enlargeable ) {
return enlargeable && enlargeable.type == CKEDITOR.NODE_ELEMENT && enlargeable.hasAttribute( 'contenteditable' ) ? null : enlargeable;
}
},

/**
Expand Down

0 comments on commit 433e5ee

Please sign in to comment.