Ticket #6992: 6992_2.patch
File 6992_2.patch, 1.4 KB (added by , 12 years ago) |
---|
-
_source/plugins/selection/plugin.js
599 599 return { container : parent, offset : getNodeIndex( child ) }; 600 600 } 601 601 602 // All childs are text nodes. 603 if ( index == -1 ) 602 // All childs are text nodes, 603 // or to the right hand of test range are all text nodes. (#6992) 604 if ( index == -1 || index == siblings.length - 1 && position < 0 ) 604 605 { 605 606 // Adapt test range to embrace the entire parent contents. 606 607 testRange.moveToElementText( parent ); … … 613 614 614 615 siblings = parent.childNodes; 615 616 616 // Actual range anchor right beside test range at the innerboundary of text node.617 // Actual range anchor right beside test range at the boundary of text node. 617 618 if ( !distance ) 618 619 { 619 620 child = siblings[ siblings.length - 1 ]; 620 return { container : child, offset : child.nodeValue.length }; 621 622 if ( child.nodeType == CKEDITOR.NODE_ELEMENT ) 623 return { container : parent, offset : siblings.length }; 624 else 625 return { container : child, offset : child.nodeValue.length }; 621 626 } 622 627 623 628 // Start the measuring until distance overflows, meanwhile count the text nodes.