Ticket #6992: 6992.patch

File 6992.patch, 1.0 KB (added by Garry Yao, 12 years ago)
  • _source/plugins/selection/plugin.js

     
    647647                                                        // Start the measuring until distance overflows, meanwhile count the text nodes.
    648648                                                        while ( distance > 0 )
    649649                                                        {
    650                                                                 child = child[ position > 0 ? 'previousSibling' : 'nextSibling' ];
     650                                                                var next = child[ position > 0 ? 'previousSibling' : 'nextSibling' ];
    651651                                                                try
    652652                                                                {
    653                                                                         distance -= child.nodeValue.length;
     653                                                                        distance -= next.nodeValue.length;
    654654                                                                }
    655655                                                                // Measurement in IE could be somtimes wrong because of <select> element. (#4611)
    656656                                                                catch( e )
    657657                                                                {
    658658                                                                        return { container : parent, offset : getNodeIndex( child ) };
    659659                                                                }
     660
     661                                                                child = next;
    660662                                                        }
    661663
    662664                                                        return { container : child, offset : position > 0 ? -distance : child.nodeValue.length + distance };
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy