[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

commit-queue at webkit.org commit-queue at webkit.org
Sun Feb 20 23:11:36 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit b487e332de924119f051f825b6df0132d470b01b
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 18 21:24:04 2011 +0000

    2011-01-18  Benjamin Kalman  <kalman at 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):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76053 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 192fc29..12de0e5 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-18  Benjamin Kalman  <kalman at 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):
+
 2011-01-18  Adam Klein  <adamk at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/Source/WebCore/editing/TextIterator.cpp b/Source/WebCore/editing/TextIterator.cpp
index 7e41420..c24bcb2 100644
--- a/Source/WebCore/editing/TextIterator.cpp
+++ b/Source/WebCore/editing/TextIterator.cpp
@@ -1128,10 +1128,10 @@ void SimplifiedBackwardsTextIterator::advance()
         if (!next) {
             // Exit empty containers as we pass over them or containers
             // where [container, 0] is where we started iterating.
-            if (!m_handledNode &&
-                canHaveChildrenForEditing(m_node) && 
-                m_node->parentNode() && 
-                (!m_node->lastChild() || (m_node == m_endNode && m_endOffset == 0))) {
+            if (!m_handledNode
+                    && canHaveChildrenForEditing(m_node)
+                    && m_node->parentNode()
+                    && (!m_node->lastChild() || (m_node == m_endNode && !m_endOffset))) {
                 exitNode();
                 if (m_positionNode) {
                     m_handledNode = true;
diff --git a/Source/WebCore/editing/visible_units.cpp b/Source/WebCore/editing/visible_units.cpp
index 7bb1515..1a554b7 100644
--- a/Source/WebCore/editing/visible_units.cpp
+++ b/Source/WebCore/editing/visible_units.cpp
@@ -115,22 +115,18 @@ static VisiblePosition previousBoundary(const VisiblePosition& c, BoundarySearch
         ASSERT(!needMoreContext);
     }
 
-    if (it.atEnd() && next == 0) {
-        pos = it.range()->startPosition();
-    } else if (next != 0) {
-        Node *node = it.range()->startContainer(ec);
-        if ((node->isTextNode() && static_cast<int>(next) <= node->maxCharacterOffset()) || (node->renderer() && node->renderer()->isBR() && !next))
-            // The next variable contains a usable index into a text node
-            pos = Position(node, next);
-        else {
-            // Use the character iterator to translate the next value into a DOM position.
-            BackwardsCharacterIterator charIt(searchRange.get(), TextIteratorEndsAtEditingBoundary);
-            charIt.advance(string.size() - suffixLength - next);
-            pos = charIt.range()->endPosition();
-        }
-    }
-
-    return VisiblePosition(pos, DOWNSTREAM);
+    if (!next)
+        return VisiblePosition(it.atEnd() ? it.range()->startPosition() : pos, DOWNSTREAM);
+
+    Node* node = it.range()->startContainer(ec);
+    if ((node->isTextNode() && static_cast<int>(next) <= node->maxCharacterOffset()) || (node->renderer() && node->renderer()->isBR() && !next))
+        // The next variable contains a usable index into a text node
+        return VisiblePosition(Position(node, next), DOWNSTREAM);
+
+    // Use the character iterator to translate the next value into a DOM position.
+    BackwardsCharacterIterator charIt(searchRange.get(), TextIteratorEndsAtEditingBoundary);
+    charIt.advance(string.size() - suffixLength - next);
+    return VisiblePosition(charIt.range()->endPosition(), DOWNSTREAM);
 }
 
 static VisiblePosition nextBoundary(const VisiblePosition& c, BoundarySearchFunction searchFunction)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list