Ticket #5435: 5435.patch

File 5435.patch, 2.3 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/list/plugin.js

     
    438438                        while ( ranges.length > 0 )
    439439                        {
    440440                                range = ranges.shift();
    441 
    442                                 var boundaryNodes = range.getBoundaryNodes(),
    443                                         startNode = boundaryNodes.startNode,
    444                                         endNode = boundaryNodes.endNode;
    445 
    446                                 if ( startNode.type == CKEDITOR.NODE_ELEMENT && startNode.getName() == 'td' )
    447                                         range.setStartAt( boundaryNodes.startNode, CKEDITOR.POSITION_AFTER_START );
    448 
    449                                 if ( endNode.type == CKEDITOR.NODE_ELEMENT && endNode.getName() == 'td' )
    450                                         range.setEndAt( boundaryNodes.endNode, CKEDITOR.POSITION_BEFORE_END );
    451 
    452441                                var iterator = range.createIterator(),
    453442                                        block;
    454443
  • _source/plugins/domiterator/plugin.js

     
    5151                        if ( !this._.lastNode )
    5252                        {
    5353                                range = this.range.clone();
     54
     55                                // Shrink the range to exclude harmful "noises" (#4087, #4450, #5435).
     56                                range.shrink( CKEDITOR.NODE_ELEMENT, true );
     57
    5458                                range.enlarge( this.forceBrBreak || !this.enlargeBr ?
    5559                                                           CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS );
    5660
     
    212216
    213217                                // We have found a block boundary. Let's close the range and move out of the
    214218                                // loop.
    215                                 if ( ( closeRange || isLast ) && range )
    216                                 {
    217                                         var boundaryNodes = range.getBoundaryNodes(),
    218                                                 startPath = new CKEDITOR.dom.elementPath( range.startContainer );
    219 
    220                                         // Drop the range if it only contains bookmark nodes, and is
    221                                         // not because of the original collapsed range. (#4087,#4450)
    222                                         if ( boundaryNodes.startNode.getParent().equals( startPath.blockLimit )
    223                                                  && isBookmark( boundaryNodes.startNode ) && isBookmark( boundaryNodes.endNode ) )
    224                                         {
    225                                                 range = null;
    226                                                 this._.nextNode = null;
    227                                         }
    228                                         else
     219                                if ( isLast || ( closeRange && range ) )
    229220                                                break;
    230                                 }
     221                        }
    231222
    232                                 if ( isLast )
    233                                         break;
    234 
    235                         }
    236 
    237223                        // Now, based on the processed range, look for (or create) the block to be returned.
    238224                        if ( !block )
    239225                        {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy