Title: [238958] trunk/Source
Revision
238958
Author
[email protected]
Date
2018-12-07 10:51:36 -0800 (Fri, 07 Dec 2018)

Log Message

Unreviewed, rolling out r238947.

Revision caused fast/visual-viewport/tiled-drawing/zoomed-
fixed-scrolling-layers-state.html to constantly fail

Reverted changeset:

"Allow control over child order when adding nodes to the
scrolling tree"
https://bugs.webkit.org/show_bug.cgi?id=176914
https://trac.webkit.org/changeset/238947

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (238957 => 238958)


--- trunk/Source/WebCore/ChangeLog	2018-12-07 18:51:06 UTC (rev 238957)
+++ trunk/Source/WebCore/ChangeLog	2018-12-07 18:51:36 UTC (rev 238958)
@@ -1,3 +1,17 @@
+2018-12-07  Truitt Savell  <[email protected]>
+
+        Unreviewed, rolling out r238947.
+
+        Revision caused fast/visual-viewport/tiled-drawing/zoomed-
+        fixed-scrolling-layers-state.html to constantly fail
+
+        Reverted changeset:
+
+        "Allow control over child order when adding nodes to the
+        scrolling tree"
+        https://bugs.webkit.org/show_bug.cgi?id=176914
+        https://trac.webkit.org/changeset/238947
+
 2018-12-07  Wenson Hsieh  <[email protected]>
 
         [Attachment Support] Cloned attachment elements lose their unique identifiers

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (238957 => 238958)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2018-12-07 18:51:06 UTC (rev 238957)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2018-12-07 18:51:36 UTC (rev 238958)
@@ -474,9 +474,9 @@
         scrollableArea.horizontalScrollbarLayerDidChange();
 }
 
-ScrollingNodeID AsyncScrollingCoordinator::attachToStateTree(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID, size_t childIndex)
+ScrollingNodeID AsyncScrollingCoordinator::attachToStateTree(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID)
 {
-    return m_scrollingStateTree->attachNode(nodeType, newNodeID, parentID, childIndex);
+    return m_scrollingStateTree->attachNode(nodeType, newNodeID, parentID);
 }
 
 void AsyncScrollingCoordinator::detachFromStateTree(ScrollingNodeID nodeID)
@@ -509,7 +509,7 @@
     // For non-main frames, it is only possible to arrive in this function from
     // RenderLayerCompositor::updateBacking where the node has already been created.
     ASSERT(frameView.frame().isMainFrame());
-    attachToStateTree(MainFrameScrollingNode, frameView.scrollLayerID(), 0, 0);
+    attachToStateTree(MainFrameScrollingNode, frameView.scrollLayerID(), 0);
 }
 
 void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry& scrollingGeometry)

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (238957 => 238958)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h	2018-12-07 18:51:06 UTC (rev 238957)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h	2018-12-07 18:51:36 UTC (rev 238958)
@@ -97,7 +97,7 @@
 
     WEBCORE_EXPORT bool requestScrollPositionUpdate(FrameView&, const IntPoint&) override;
 
-    WEBCORE_EXPORT ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID, size_t childIndex) override;
+    WEBCORE_EXPORT ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID) override;
     WEBCORE_EXPORT void detachFromStateTree(ScrollingNodeID) override;
     WEBCORE_EXPORT void clearStateTree() override;
     

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (238957 => 238958)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2018-12-07 18:51:06 UTC (rev 238957)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2018-12-07 18:51:36 UTC (rev 238958)
@@ -164,8 +164,7 @@
     virtual void commitTreeStateIfNeeded() { }
     virtual bool requestScrollPositionUpdate(FrameView&, const IntPoint&) { return false; }
     virtual bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) { return true; }
-    virtual ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID /*parentID*/, size_t /*childIndex*/ = notFound) { return newNodeID; }
-
+    virtual ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID /*parentID*/) { return newNodeID; }
     virtual void detachFromStateTree(ScrollingNodeID) { }
     virtual void clearStateTree() { }
 

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp (238957 => 238958)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp	2018-12-07 18:51:06 UTC (rev 238957)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp	2018-12-07 18:51:36 UTC (rev 238958)
@@ -97,26 +97,6 @@
     m_children->append(WTFMove(childNode));
 }
 
-void ScrollingStateNode::insertChild(Ref<ScrollingStateNode>&& childNode, size_t index)
-{
-    childNode->setParent(this);
-
-    if (!m_children) {
-        ASSERT(!index);
-        m_children = std::make_unique<Vector<RefPtr<ScrollingStateNode>>>();
-    }
-
-    m_children->insert(index, WTFMove(childNode));
-}
-
-size_t ScrollingStateNode::indexOfChild(ScrollingStateNode& childNode) const
-{
-    if (!m_children)
-        return notFound;
-
-    return m_children->find(&childNode);
-}
-
 void ScrollingStateNode::reconcileLayerPositionForViewportRect(const LayoutRect& viewportRect, ScrollingLayerPositionAction action)
 {
     if (!m_children)

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h (238957 => 238958)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h	2018-12-07 18:51:06 UTC (rev 238957)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h	2018-12-07 18:51:36 UTC (rev 238958)
@@ -236,10 +236,7 @@
     Vector<RefPtr<ScrollingStateNode>>* children() const { return m_children.get(); }
 
     void appendChild(Ref<ScrollingStateNode>&&);
-    void insertChild(Ref<ScrollingStateNode>&&, size_t index);
 
-    size_t indexOfChild(ScrollingStateNode&) const;
-
     String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const;
 
 protected:

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp (238957 => 238958)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp	2018-12-07 18:51:06 UTC (rev 238957)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp	2018-12-07 18:51:36 UTC (rev 238958)
@@ -82,39 +82,25 @@
     return ScrollingStateFixedNode::create(*this, nodeID);
 }
 
-bool ScrollingStateTree::nodeTypeAndParentMatch(ScrollingStateNode& node, ScrollingNodeType nodeType, ScrollingStateNode* parentNode) const
+bool ScrollingStateTree::nodeTypeAndParentMatch(ScrollingStateNode& node, ScrollingNodeType nodeType, ScrollingNodeID parentID) const
 {
     if (node.nodeType() != nodeType)
         return false;
 
-    return node.parent() == parentNode;
+    auto* parent = stateNodeForID(parentID);
+    if (!parent)
+        return true;
+
+    return node.parent() == parent;
 }
 
-ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID, size_t childIndex)
+ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID)
 {
     ASSERT(newNodeID);
 
     if (auto* node = stateNodeForID(newNodeID)) {
-        auto* parent = stateNodeForID(parentID);
-        if (nodeTypeAndParentMatch(*node, nodeType, parent)) {
-            if (!parentID)
-                return newNodeID;
-
-            size_t currentIndex = parent->indexOfChild(*node);
-            if (currentIndex == childIndex)
-                return newNodeID;
-
-            ASSERT(currentIndex != notFound);
-            Ref<ScrollingStateNode> protectedNode(*node);
-            parent->children()->remove(currentIndex);
-
-            if (childIndex == notFound)
-                parent->appendChild(WTFMove(protectedNode));
-            else
-                parent->insertChild(WTFMove(protectedNode), childIndex);
-
+        if (nodeTypeAndParentMatch(*node, nodeType, parentID))
             return newNodeID;
-        }
 
 #if ENABLE(ASYNC_SCROLLING)
         // If the type has changed, we need to destroy and recreate the node with a new ID.
@@ -128,7 +114,6 @@
 
     ScrollingStateNode* newNode = nullptr;
     if (!parentID) {
-        ASSERT(!childIndex || childIndex == notFound);
         // If we're resetting the root node, we should clear the HashMap and destroy the current children.
         clear();
 
@@ -137,18 +122,13 @@
         m_hasNewRootStateNode = true;
     } else {
         auto* parent = stateNodeForID(parentID);
-        if (!parent) {
-            ASSERT_NOT_REACHED();
+        if (!parent)
             return 0;
-        }
 
         if (nodeType == SubframeScrollingNode && parentID) {
             if (auto orphanedNode = m_orphanedSubframeNodes.take(newNodeID)) {
                 newNode = orphanedNode.get();
-                if (childIndex == notFound)
-                    parent->appendChild(orphanedNode.releaseNonNull());
-                else
-                    parent->insertChild(orphanedNode.releaseNonNull(), childIndex);
+                parent->appendChild(orphanedNode.releaseNonNull());
             }
         }
 
@@ -155,14 +135,11 @@
         if (!newNode) {
             auto stateNode = createNode(nodeType, newNodeID);
             newNode = stateNode.ptr();
-            if (childIndex == notFound)
-                parent->appendChild(WTFMove(stateNode));
-            else
-                parent->insertChild(WTFMove(stateNode), childIndex);
+            parent->appendChild(WTFMove(stateNode));
         }
     }
 
-    addNode(*newNode);
+    m_stateNodeMap.set(newNodeID, newNode);
     m_nodesRemovedSinceLastCommit.remove(newNodeID);
     return newNodeID;
 }

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h (238957 => 238958)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h	2018-12-07 18:51:06 UTC (rev 238957)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h	2018-12-07 18:51:36 UTC (rev 238958)
@@ -51,7 +51,7 @@
     ScrollingStateFrameScrollingNode* rootStateNode() const { return m_rootStateNode.get(); }
     WEBCORE_EXPORT ScrollingStateNode* stateNodeForID(ScrollingNodeID) const;
 
-    WEBCORE_EXPORT ScrollingNodeID attachNode(ScrollingNodeType, ScrollingNodeID, ScrollingNodeID parentID, size_t childIndex);
+    WEBCORE_EXPORT ScrollingNodeID attachNode(ScrollingNodeType, ScrollingNodeID, ScrollingNodeID parentID);
     void detachNode(ScrollingNodeID);
     void clear();
     
@@ -81,7 +81,7 @@
 
     Ref<ScrollingStateNode> createNode(ScrollingNodeType, ScrollingNodeID);
 
-    bool nodeTypeAndParentMatch(ScrollingStateNode&, ScrollingNodeType, ScrollingStateNode* parentNode) const;
+    bool nodeTypeAndParentMatch(ScrollingStateNode&, ScrollingNodeType, ScrollingNodeID parentID) const;
 
     enum class SubframeNodeRemoval { Delete, Orphan };
     void removeNodeAndAllDescendants(ScrollingStateNode*, SubframeNodeRemoval = SubframeNodeRemoval::Delete);

Modified: trunk/Source/WebKit/ChangeLog (238957 => 238958)


--- trunk/Source/WebKit/ChangeLog	2018-12-07 18:51:06 UTC (rev 238957)
+++ trunk/Source/WebKit/ChangeLog	2018-12-07 18:51:36 UTC (rev 238958)
@@ -1,3 +1,17 @@
+2018-12-07  Truitt Savell  <[email protected]>
+
+        Unreviewed, rolling out r238947.
+
+        Revision caused fast/visual-viewport/tiled-drawing/zoomed-
+        fixed-scrolling-layers-state.html to constantly fail
+
+        Reverted changeset:
+
+        "Allow control over child order when adding nodes to the
+        scrolling tree"
+        https://bugs.webkit.org/show_bug.cgi?id=176914
+        https://trac.webkit.org/changeset/238947
+
 2018-12-06  David Kilzer  <[email protected]>
 
         Injected bundle for WebKitTestRunner leaks WKTypeRef objects

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp (238957 => 238958)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp	2018-12-07 18:51:06 UTC (rev 238957)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp	2018-12-07 18:51:36 UTC (rev 238958)
@@ -413,7 +413,7 @@
         if (!decoder.decode(parentNodeID))
             return false;
 
-        m_scrollingStateTree->attachNode(nodeType, nodeID, parentNodeID, notFound); // Append new node.
+        m_scrollingStateTree->attachNode(nodeType, nodeID, parentNodeID);
         ScrollingStateNode* newNode = m_scrollingStateTree->stateNodeForID(nodeID);
         ASSERT(newNode);
         ASSERT(!parentNodeID || newNode->parent());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to