Changeset 239042 in webkit
- Timestamp:
- Dec 10, 2018, 12:43:40 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r239040 r239042 11 11 * http/tests/xmlhttprequest/supported-xml-content-types.html: 12 12 13 2018-12-09 Commit Queue <commit-queue@webkit.org> 14 15 Unreviewed, rolling out r239010. 16 https://bugs.webkit.org/show_bug.cgi?id=192537 17 18 Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed- 19 scrolling-layers-state.html again (Requested by ap on 20 #webkit). 21 22 Reverted changeset: 23 24 "Allow control over child order when adding nodes to the 25 scrolling tree" 13 2018-12-10 Simon Fraser <simon.fraser@apple.com> 14 15 Allow control over child order when adding nodes to the scrolling tree 26 16 https://bugs.webkit.org/show_bug.cgi?id=176914 27 https://trac.webkit.org/changeset/239010 17 <rdar://problem/46542237> 18 19 Re-land r239010 after over-zealous rollout. 20 21 * platform/mac-wk2/TestExpectations: 28 22 29 23 2018-12-08 Eric Carlson <eric.carlson@apple.com> -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r239018 r239042 322 322 webkit.org/b/148408 tiled-drawing/scrolling/root-overflow-with-mousewheel.html [ Pass Failure Timeout ] 323 323 324 webkit.org/b/192529 fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state.html [ Pass Failure ] 325 324 326 webkit.org/b/139820 fast/frames/lots-of-objects.html [ Pass Timeout ] 325 327 webkit.org/b/139820 fast/frames/lots-of-iframes.html [ Pass Timeout ] -
trunk/Source/WebCore/ChangeLog
r239041 r239042 1 2018-12-10 Simon Fraser <simon.fraser@apple.com> 2 3 Allow control over child order when adding nodes to the scrolling tree 4 https://bugs.webkit.org/show_bug.cgi?id=176914 5 <rdar://problem/46542237> 6 7 Re-land r239010 after over-zealous rollout. 8 9 * page/scrolling/AsyncScrollingCoordinator.cpp: 10 (WebCore::AsyncScrollingCoordinator::attachToStateTree): 11 (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): 12 * page/scrolling/AsyncScrollingCoordinator.h: 13 * page/scrolling/ScrollingCoordinator.h: 14 (WebCore::ScrollingCoordinator::attachToStateTree): 15 * page/scrolling/ScrollingStateNode.cpp: 16 (WebCore::ScrollingStateNode::insertChild): 17 (WebCore::ScrollingStateNode::indexOfChild const): 18 * page/scrolling/ScrollingStateNode.h: 19 * page/scrolling/ScrollingStateTree.cpp: 20 (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const): 21 (WebCore::ScrollingStateTree::attachNode): 22 * page/scrolling/ScrollingStateTree.h: 23 1 24 2018-12-10 Antti Koivisto <antti@apple.com> 2 25 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r239018 r239042 475 475 } 476 476 477 ScrollingNodeID AsyncScrollingCoordinator::attachToStateTree(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID) 478 { 479 return m_scrollingStateTree->attachNode(nodeType, newNodeID, parentID); 477 ScrollingNodeID AsyncScrollingCoordinator::attachToStateTree(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID, size_t childIndex) 478 { 479 LOG_WITH_STREAM(Scrolling, stream << "AsyncScrollingCoordinator::attachToStateTree " << nodeType << " node " << newNodeID << " parent " << parentID << " index " << childIndex); 480 return m_scrollingStateTree->attachNode(nodeType, newNodeID, parentID, childIndex); 480 481 } 481 482 … … 510 511 // RenderLayerCompositor::updateBacking where the node has already been created. 511 512 ASSERT(frameView.frame().isMainFrame()); 512 attachToStateTree(MainFrameScrollingNode, frameView.scrollLayerID(), 0 );513 attachToStateTree(MainFrameScrollingNode, frameView.scrollLayerID(), 0, 0); 513 514 } 514 515 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
r239018 r239042 98 98 WEBCORE_EXPORT bool requestScrollPositionUpdate(FrameView&, const IntPoint&) override; 99 99 100 WEBCORE_EXPORT ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID ) override;100 WEBCORE_EXPORT ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID, size_t childIndex) override; 101 101 WEBCORE_EXPORT void detachFromStateTree(ScrollingNodeID) override; 102 102 WEBCORE_EXPORT void clearStateTree() override; -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r239018 r239042 165 165 virtual bool requestScrollPositionUpdate(FrameView&, const IntPoint&) { return false; } 166 166 virtual bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) { return true; } 167 virtual ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID /*parentID*/) { return newNodeID; } 167 virtual ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID /*parentID*/, size_t /*childIndex*/ = notFound) { return newNodeID; } 168 168 169 virtual void detachFromStateTree(ScrollingNodeID) { } 169 170 virtual void clearStateTree() { } -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp
r239018 r239042 98 98 } 99 99 100 void ScrollingStateNode::insertChild(Ref<ScrollingStateNode>&& childNode, size_t index) 101 { 102 childNode->setParent(this); 103 104 if (!m_children) { 105 ASSERT(!index); 106 m_children = std::make_unique<Vector<RefPtr<ScrollingStateNode>>>(); 107 } 108 109 m_children->insert(index, WTFMove(childNode)); 110 } 111 112 size_t ScrollingStateNode::indexOfChild(ScrollingStateNode& childNode) const 113 { 114 if (!m_children) 115 return notFound; 116 117 return m_children->find(&childNode); 118 } 119 100 120 void ScrollingStateNode::reconcileLayerPositionForViewportRect(const LayoutRect& viewportRect, ScrollingLayerPositionAction action) 101 121 { -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h
r239018 r239042 237 237 238 238 void appendChild(Ref<ScrollingStateNode>&&); 239 void insertChild(Ref<ScrollingStateNode>&&, size_t index); 240 241 size_t indexOfChild(ScrollingStateNode&) const; 239 242 240 243 String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const; -
trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp
r239018 r239042 83 83 } 84 84 85 bool ScrollingStateTree::nodeTypeAndParentMatch(ScrollingStateNode& node, ScrollingNodeType nodeType, Scrolling NodeID parentID) const85 bool ScrollingStateTree::nodeTypeAndParentMatch(ScrollingStateNode& node, ScrollingNodeType nodeType, ScrollingStateNode* parentNode) const 86 86 { 87 87 if (node.nodeType() != nodeType) 88 88 return false; 89 89 90 auto* parent = stateNodeForID(parentID); 91 if (!parent) 92 return true; 93 94 return node.parent() == parent; 95 } 96 97 ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID) 90 return node.parent() == parentNode; 91 } 92 93 ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID, size_t childIndex) 98 94 { 99 95 ASSERT(newNodeID); 100 96 101 97 if (auto* node = stateNodeForID(newNodeID)) { 102 if (nodeTypeAndParentMatch(*node, nodeType, parentID)) 98 auto* parent = stateNodeForID(parentID); 99 if (nodeTypeAndParentMatch(*node, nodeType, parent)) { 100 if (!parentID) 101 return newNodeID; 102 103 size_t currentIndex = parent->indexOfChild(*node); 104 if (currentIndex == childIndex) 105 return newNodeID; 106 107 ASSERT(currentIndex != notFound); 108 Ref<ScrollingStateNode> protectedNode(*node); 109 parent->children()->remove(currentIndex); 110 111 if (childIndex == notFound) 112 parent->appendChild(WTFMove(protectedNode)); 113 else 114 parent->insertChild(WTFMove(protectedNode), childIndex); 115 103 116 return newNodeID; 117 } 104 118 105 119 #if ENABLE(ASYNC_SCROLLING) … … 115 129 ScrollingStateNode* newNode = nullptr; 116 130 if (!parentID) { 131 ASSERT(!childIndex || childIndex == notFound); 117 132 // If we're resetting the root node, we should clear the HashMap and destroy the current children. 118 133 clear(); … … 123 138 } else { 124 139 auto* parent = stateNodeForID(parentID); 125 if (!parent) 140 if (!parent) { 141 ASSERT_NOT_REACHED(); 126 142 return 0; 143 } 127 144 128 145 if (nodeType == SubframeScrollingNode && parentID) { 129 146 if (auto orphanedNode = m_orphanedSubframeNodes.take(newNodeID)) { 130 147 newNode = orphanedNode.get(); 131 parent->appendChild(orphanedNode.releaseNonNull()); 148 if (childIndex == notFound) 149 parent->appendChild(orphanedNode.releaseNonNull()); 150 else 151 parent->insertChild(orphanedNode.releaseNonNull(), childIndex); 132 152 } 133 153 } … … 136 156 auto stateNode = createNode(nodeType, newNodeID); 137 157 newNode = stateNode.ptr(); 138 parent->appendChild(WTFMove(stateNode)); 139 } 140 } 141 142 m_stateNodeMap.set(newNodeID, newNode); 158 if (childIndex == notFound) 159 parent->appendChild(WTFMove(stateNode)); 160 else 161 parent->insertChild(WTFMove(stateNode), childIndex); 162 } 163 } 164 165 addNode(*newNode); 143 166 m_nodesRemovedSinceLastCommit.remove(newNodeID); 144 167 return newNodeID; -
trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h
r239018 r239042 52 52 WEBCORE_EXPORT ScrollingStateNode* stateNodeForID(ScrollingNodeID) const; 53 53 54 WEBCORE_EXPORT ScrollingNodeID attachNode(ScrollingNodeType, ScrollingNodeID, ScrollingNodeID parentID );54 WEBCORE_EXPORT ScrollingNodeID attachNode(ScrollingNodeType, ScrollingNodeID, ScrollingNodeID parentID, size_t childIndex); 55 55 void detachNode(ScrollingNodeID); 56 56 void clear(); … … 82 82 Ref<ScrollingStateNode> createNode(ScrollingNodeType, ScrollingNodeID); 83 83 84 bool nodeTypeAndParentMatch(ScrollingStateNode&, ScrollingNodeType, Scrolling NodeID parentID) const;84 bool nodeTypeAndParentMatch(ScrollingStateNode&, ScrollingNodeType, ScrollingStateNode* parentNode) const; 85 85 86 86 enum class SubframeNodeRemoval { Delete, Orphan }; -
trunk/Source/WebKit/ChangeLog
r239039 r239042 1 2018-12-10 Simon Fraser <simon.fraser@apple.com> 2 3 Allow control over child order when adding nodes to the scrolling tree 4 https://bugs.webkit.org/show_bug.cgi?id=176914 5 <rdar://problem/46542237> 6 7 Re-land r239010 after over-zealous rollout. 8 9 * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: 10 (WebKit::RemoteScrollingCoordinatorTransaction::decode): 11 1 12 2018-12-10 Wenson Hsieh <wenson_hsieh@apple.com> 2 13 -
trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp
r239029 r239042 413 413 return false; 414 414 415 m_scrollingStateTree->attachNode(nodeType, nodeID, parentNodeID );415 m_scrollingStateTree->attachNode(nodeType, nodeID, parentNodeID, notFound); // Append new node. 416 416 ScrollingStateNode* newNode = m_scrollingStateTree->stateNodeForID(nodeID); 417 417 ASSERT(newNode);
Note:
See TracChangeset
for help on using the changeset viewer.