Unreviewed, rolling out r105885.
authorleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 19:13:28 +0000 (19:13 +0000)
committerleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 19:13:28 +0000 (19:13 +0000)
http://trac.webkit.org/changeset/105885
https://bugs.webkit.org/show_bug.cgi?id=77027

Causes assertions in Position. (Requested by leviw|gardening
on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-01-25

Source/WebCore:

* dom/Position.cpp:
(WebCore::Position::upstream):
(WebCore::Position::downstream):
* dom/PositionIterator.cpp:
* dom/PositionIterator.h:
(PositionIterator):
* editing/htmlediting.cpp:
(WebCore::nextCandidate):
(WebCore::nextVisuallyDistinctCandidate):
(WebCore::previousCandidate):
(WebCore::previousVisuallyDistinctCandidate):

LayoutTests:

* perf/selection-skip-hidden-node-expected.txt: Removed.
* perf/selection-skip-hidden-node.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105902 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/perf/selection-skip-hidden-node-expected.txt [deleted file]
LayoutTests/perf/selection-skip-hidden-node.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/dom/Position.cpp
Source/WebCore/dom/PositionIterator.cpp
Source/WebCore/dom/PositionIterator.h
Source/WebCore/editing/htmlediting.cpp

index 0a8f6c35b2ac9fac89f0872257586fa9b7fd88cb..bb265847aa259767c5dd7be15aef1aeb86569f73 100644 (file)
@@ -1,3 +1,15 @@
+2012-01-25  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r105885.
+        http://trac.webkit.org/changeset/105885
+        https://bugs.webkit.org/show_bug.cgi?id=77027
+
+        Causes assertions in Position. (Requested by leviw|gardening
+        on #webkit).
+
+        * perf/selection-skip-hidden-node-expected.txt: Removed.
+        * perf/selection-skip-hidden-node.html: Removed.
+
 2012-01-25  Alexis Menard  <alexis.menard@openbossa.org>
 
         border-image should be implemented like a shorthand.
diff --git a/LayoutTests/perf/selection-skip-hidden-node-expected.txt b/LayoutTests/perf/selection-skip-hidden-node-expected.txt
deleted file mode 100644 (file)
index 67c0ec1..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Tests that traversing hidden text nodes is constant time.
-PASS
-
diff --git a/LayoutTests/perf/selection-skip-hidden-node.html b/LayoutTests/perf/selection-skip-hidden-node.html
deleted file mode 100644 (file)
index ead35b4..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<body>
-<script src="../resources/magnitude-perf.js"></script>
-<div id="HiddenText"></div><p id="VisibleText">Visible Text</p>
-<script>
-var hiddenDiv = document.getElementById('HiddenText');
-hiddenDiv.style.display = 'none';
-
-var longText = "super long long text";
-while (longText.length < 16)
-    longText = longText + longText;
-
-function setupFunction(magnitude)
-{
-    while (hiddenDiv.hasChildNodes())
-        hiddenDiv.removeChild(hiddenDiv.lastChild);
-
-    var text = longText;
-    for (var i = 0; i < magnitude; ++i)
-        text += longText;
-
-    var textNode = document.createTextNode(text);
-    hiddenDiv.appendChild(textNode);
-}
-
-function test(magnitude)
-{
-    window.getSelection().setPosition(document.body, 0);
-}
-
-Magnitude.description("Tests that traversing hidden text nodes is constant time.");
-Magnitude.run(setupFunction, test, Magnitude.CONSTANT);
-
-</script>
-</body>
index e01a3293bab682b3a472ee6e5a7e922df073fa2c..13b0e97c478fc85f0b1bee352d96801dd81edeb5 100644 (file)
@@ -1,3 +1,24 @@
+2012-01-25  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r105885.
+        http://trac.webkit.org/changeset/105885
+        https://bugs.webkit.org/show_bug.cgi?id=77027
+
+        Causes assertions in Position. (Requested by leviw|gardening
+        on #webkit).
+
+        * dom/Position.cpp:
+        (WebCore::Position::upstream):
+        (WebCore::Position::downstream):
+        * dom/PositionIterator.cpp:
+        * dom/PositionIterator.h:
+        (PositionIterator):
+        * editing/htmlediting.cpp:
+        (WebCore::nextCandidate):
+        (WebCore::nextVisuallyDistinctCandidate):
+        (WebCore::previousCandidate):
+        (WebCore::previousVisuallyDistinctCandidate):
+
 2012-01-25  Alexis Menard  <alexis.menard@openbossa.org>
 
         border-image should be implemented like a shorthand.
index d7d098891cfca3703b1e1398f9e99a990788053c..fed04947a78b2748df4bb94d3e2f1daeb3ab431f 100644 (file)
@@ -615,10 +615,8 @@ Position Position::upstream(EditingBoundaryCrossingRule rule) const
 
         // skip position in unrendered or invisible node
         RenderObject* renderer = currentNode->renderer();
-        if (!renderer || renderer->style()->visibility() != VISIBLE) {
-            currentPos.moveToLeafNodeStart();
+        if (!renderer || renderer->style()->visibility() != VISIBLE)
             continue;
-        }
                  
         if (rule == CanCrossEditingBoundary && boundaryCrossed) {
             lastVisible = currentPos;
@@ -638,7 +636,6 @@ Position Position::upstream(EditingBoundaryCrossingRule rule) const
         if (editingIgnoresContent(currentNode) || isTableElement(currentNode)) {
             if (currentPos.atEndOfNode())
                 return positionAfterNode(currentNode);
-            currentPos.moveToLeafNodeStart();
             continue;
         }
 
@@ -750,10 +747,8 @@ Position Position::downstream(EditingBoundaryCrossingRule rule) const
 
         // skip position in unrendered or invisible node
         RenderObject* renderer = currentNode->renderer();
-        if (!renderer || renderer->style()->visibility() != VISIBLE) {
-            currentPos.moveToLeafNodeEnd();
+        if (!renderer || renderer->style()->visibility() != VISIBLE)
             continue;
-        }
             
         if (rule == CanCrossEditingBoundary && boundaryCrossed) {
             lastVisible = currentPos;
@@ -768,7 +763,6 @@ Position Position::downstream(EditingBoundaryCrossingRule rule) const
         if (editingIgnoresContent(currentNode) || isTableElement(currentNode)) {
             if (currentPos.offsetInLeafNode() <= renderer->caretMinOffset())
                 return createLegacyEditingPosition(currentNode, renderer->caretMinOffset());
-            currentPos.moveToLeafNodeEnd();
             continue;
         }
 
index fe492b21c4a39a2d3c6ac740821fb35244534d3f..426c90495b164dbbaa275fd5ff4e7d249fecf239 100644 (file)
@@ -177,20 +177,4 @@ bool PositionIterator::isCandidate() const
     return false;
 }
 
-void PositionIterator::moveToLeafNodeStart()
-{
-    if (!m_anchorNode || m_nodeAfterPositionInAnchor || m_anchorNode->hasChildNodes())
-        return;
-
-    m_offsetInAnchor = 0;
-}
-
-void PositionIterator::moveToLeafNodeEnd()
-{
-    if (!m_anchorNode || m_nodeAfterPositionInAnchor || m_anchorNode->hasChildNodes())
-        return;
-
-    m_offsetInAnchor = lastOffsetForEditing(m_anchorNode);
-}
-
 } // namespace WebCore
index a0db113736ce3db1f8b7be0564023c4b989555f8..08329bb15cd3e5210046293588ab7aabd30fe4f6 100644 (file)
@@ -64,9 +64,6 @@ public:
     bool atEndOfNode() const;
     bool isCandidate() const;
 
-    void moveToLeafNodeStart();
-    void moveToLeafNodeEnd();
-
 private:
     Node* m_anchorNode;
     Node* m_nodeAfterPositionInAnchor; // If this is non-null, m_nodeAfterPositionInAnchor->parentNode() == m_anchorNode;
index d19ff2870e1a34327ba411067267a22e6002570b..4e6d528144bc2d98fcaa11bf35dca54b4dde4fe2 100644 (file)
@@ -209,9 +209,6 @@ Position nextCandidate(const Position& position)
         p.increment();
         if (p.isCandidate())
             return p;
-        RenderObject* renderer = p.node() ? p.node()->renderer() : 0;
-        if (!renderer || renderer->style()->visibility() != VISIBLE)
-            p.moveToLeafNodeEnd();
     }
     return Position();
 }
@@ -224,9 +221,6 @@ Position nextVisuallyDistinctCandidate(const Position& position)
         p = p.next(Character);
         if (p.isCandidate() && p.downstream() != downstreamStart)
             return p;
-        RenderObject* renderer = p.deprecatedNode() ? p.deprecatedNode()->renderer() : 0;
-        if (!renderer || renderer->style()->visibility() != VISIBLE)
-            p.moveToOffset(lastOffsetForEditing(p.deprecatedNode()));
     }
     return Position();
 }
@@ -238,9 +232,6 @@ Position previousCandidate(const Position& position)
         p.decrement();
         if (p.isCandidate())
             return p;
-        RenderObject* renderer = p.node() ? p.node()->renderer() : 0;
-        if (!renderer || renderer->style()->visibility() != VISIBLE)
-            p.moveToLeafNodeStart();
     }
     return Position();
 }
@@ -253,9 +244,6 @@ Position previousVisuallyDistinctCandidate(const Position& position)
         p = p.previous(Character);
         if (p.isCandidate() && p.downstream() != downstreamStart)
             return p;
-        RenderObject* renderer = p.deprecatedNode() ? p.deprecatedNode()->renderer() : 0;
-        if (!renderer || renderer->style()->visibility() != VISIBLE)
-            p.moveToOffset(0);
     }
     return Position();
 }