Changeset 13256 in webkit


Ignore:
Timestamp:
Mar 10, 2006 5:35:55 PM (18 years ago)
Author:
justing
Message:

Reviewed by darin, harrison


~3x speedup pasting plain text from the console

  • dom/dom_position.cpp: (WebCore::Position::next): (WebCore::Position::atEnd):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r13255 r13256  
     12006-03-10  Justin Garcia  <justin.garcia@apple.com>
     2       
     3        Reviewed by darin, harrison
     4       
     5        ~3x speedup pasting plain text from the console
     6
     7        * dom/dom_position.cpp:
     8        (WebCore::Position::next):
     9        (WebCore::Position::atEnd):
     10
    1112006-03-10  David Hyatt <hyatt@apple.com>
    212
  • trunk/WebCore/dom/dom_position.cpp

    r13187 r13256  
    145145    assert(o >= 0);
    146146
    147     if (o < maxDeepOffset(n)) {
    148         NodeImpl *child = n->childNode(o);
    149         if (child) {
     147    NodeImpl* child = n->childNode(o);
     148    if (child || !n->hasChildNodes() && o < maxDeepOffset(n)) {
     149        if (child)
    150150            return Position(child, 0);
    151         }
     151           
    152152        // There are two reasons child might be 0:
    153153        //   1) The node is node like a text node that is not an element, and therefore has no children.
     
    180180        return true;
    181181   
    182     return offset() >= maxDeepOffset(n) && n->parent() == 0;
     182    return n->parent() == 0 && offset() >= maxDeepOffset(n);
    183183}
    184184
Note: See TracChangeset for help on using the changeset viewer.