Ticket #4763: 4763.patch

File 4763.patch, 1010 bytes (added by Garry Yao, 14 years ago)
  • _source/core/dom/range.js

     
    742742
    743743                                        startOffset = startContainer.getIndex() + 1;
    744744                                        startContainer = startContainer.getParent();
    745                                         // Check if it is necessary to update the end boundary.
    746                                         if ( !collapsed && this.startContainer.equals( this.endContainer ) )
     745
     746                                        // Check all necessity of updating the end boundary.
     747                                        if( collapsed )
     748                                                this.collapsed( true );
     749                                        else if ( this.startContainer.equals( this.endContainer ) )
    747750                                                this.setEnd( nextText, this.endOffset - this.startOffset );
     751                                        else if ( startContainer.equals( this.endContainer ) )
     752                                                this.endOffset += 1;
    748753                                }
    749754
    750755                                this.setStart( startContainer, startOffset );
    751756
    752757                                if ( collapsed )
    753                                         this.collapse( true );
     758                                        return;
    754759                        }
    755760
    756761                        var endContainer = this.endContainer;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy