Changeset 76053 in webkit


Ignore:
Timestamp:
Jan 18, 2011 1:24:04 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-01-18 Benjamin Kalman <kalman@chromium.org>

Reviewed by Ryosuke Niwa.

Tweak style in visible_units.cpp and TextIterator.cpp in preparation for another patch
https://bugs.webkit.org/show_bug.cgi?id=52610

This is a purely aesthetic change.

  • editing/TextIterator.cpp: (WebCore::SimplifiedBackwardsTextIterator::advance):
  • editing/visible_units.cpp: (WebCore::previousBoundary):
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r76048 r76053  
     12011-01-18  Benjamin Kalman  <kalman@chromium.org>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        Tweak style in visible_units.cpp and TextIterator.cpp in preparation for another patch
     6        https://bugs.webkit.org/show_bug.cgi?id=52610
     7
     8        This is a purely aesthetic change.
     9
     10        * editing/TextIterator.cpp:
     11        (WebCore::SimplifiedBackwardsTextIterator::advance):
     12        * editing/visible_units.cpp:
     13        (WebCore::previousBoundary):
     14
    1152011-01-18  Adam Klein  <adamk@chromium.org>
    216
  • trunk/Source/WebCore/editing/TextIterator.cpp

    r73618 r76053  
    11291129            // Exit empty containers as we pass over them or containers
    11301130            // where [container, 0] is where we started iterating.
    1131             if (!m_handledNode &&
    1132                 canHaveChildrenForEditing(m_node) &&
    1133                 m_node->parentNode() &&
    1134                 (!m_node->lastChild() || (m_node == m_endNode && m_endOffset == 0))) {
     1131            if (!m_handledNode
     1132                    && canHaveChildrenForEditing(m_node)
     1133                    && m_node->parentNode()
     1134                    && (!m_node->lastChild() || (m_node == m_endNode && !m_endOffset))) {
    11351135                exitNode();
    11361136                if (m_positionNode) {
  • trunk/Source/WebCore/editing/visible_units.cpp

    r75018 r76053  
    116116    }
    117117
    118     if (it.atEnd() && next == 0) {
    119         pos = it.range()->startPosition();
    120     } else if (next != 0) {
    121         Node *node = it.range()->startContainer(ec);
    122         if ((node->isTextNode() && static_cast<int>(next) <= node->maxCharacterOffset()) || (node->renderer() && node->renderer()->isBR() && !next))
    123             // The next variable contains a usable index into a text node
    124             pos = Position(node, next);
    125         else {
    126             // Use the character iterator to translate the next value into a DOM position.
    127             BackwardsCharacterIterator charIt(searchRange.get(), TextIteratorEndsAtEditingBoundary);
    128             charIt.advance(string.size() - suffixLength - next);
    129             pos = charIt.range()->endPosition();
    130         }
    131     }
    132 
    133     return VisiblePosition(pos, DOWNSTREAM);
     118    if (!next)
     119        return VisiblePosition(it.atEnd() ? it.range()->startPosition() : pos, DOWNSTREAM);
     120
     121    Node* node = it.range()->startContainer(ec);
     122    if ((node->isTextNode() && static_cast<int>(next) <= node->maxCharacterOffset()) || (node->renderer() && node->renderer()->isBR() && !next))
     123        // The next variable contains a usable index into a text node
     124        return VisiblePosition(Position(node, next), DOWNSTREAM);
     125
     126    // Use the character iterator to translate the next value into a DOM position.
     127    BackwardsCharacterIterator charIt(searchRange.get(), TextIteratorEndsAtEditingBoundary);
     128    charIt.advance(string.size() - suffixLength - next);
     129    return VisiblePosition(charIt.range()->endPosition(), DOWNSTREAM);
    134130}
    135131
Note: See TracChangeset for help on using the changeset viewer.