Title: [240837] trunk/Source/WebCore
Revision
240837
Author
[email protected]
Date
2019-02-01 00:43:33 -0800 (Fri, 01 Feb 2019)

Log Message

Use ScrollingNodeID in more places, and improve the name of a ScrollableArea function that returns a ScrollingNodeID
https://bugs.webkit.org/show_bug.cgi?id=194126

Reviewed by Frédéric Wang.

Change uint64_t ScrollableArea::scrollLayerID() to ScrollingNodeID ScrollableArea::scrollingNodeID()
and fix callers.

* page/FrameView.cpp:
(WebCore::FrameView::scrollingNodeID const):
(WebCore::FrameView::scrollLayerID const): Deleted.
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
(WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
(WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
(WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):
* page/scrolling/ScrollingCoordinatorTypes.h:
* platform/ScrollTypes.h:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::scrollingNodeID const):
(WebCore::ScrollableArea::scrollLayerID const): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::detachRootLayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240836 => 240837)


--- trunk/Source/WebCore/ChangeLog	2019-02-01 07:09:22 UTC (rev 240836)
+++ trunk/Source/WebCore/ChangeLog	2019-02-01 08:43:33 UTC (rev 240837)
@@ -1,3 +1,39 @@
+2019-02-01  Simon Fraser  <[email protected]>
+
+        Use ScrollingNodeID in more places, and improve the name of a ScrollableArea function that returns a ScrollingNodeID
+        https://bugs.webkit.org/show_bug.cgi?id=194126
+
+        Reviewed by Frédéric Wang.
+        
+        Change uint64_t ScrollableArea::scrollLayerID() to ScrollingNodeID ScrollableArea::scrollingNodeID()
+        and fix callers.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollingNodeID const):
+        (WebCore::FrameView::scrollLayerID const): Deleted.
+        * page/FrameView.h:
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
+        (WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
+        (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
+        (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
+        (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
+        (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+        (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
+        (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
+        (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
+        (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
+        (WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
+        (WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):
+        * page/scrolling/ScrollingCoordinatorTypes.h:
+        * platform/ScrollTypes.h:
+        * platform/ScrollableArea.h:
+        (WebCore::ScrollableArea::scrollingNodeID const):
+        (WebCore::ScrollableArea::scrollLayerID const): Deleted.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::parentFrameContentLayers):
+        (WebCore::RenderLayerCompositor::detachRootLayer):
+
 2019-01-31  Myles C. Maxfield  <[email protected]>
 
         [WHLSL] Expressions can't be copyable

Modified: trunk/Source/WebCore/page/FrameView.cpp (240836 => 240837)


--- trunk/Source/WebCore/page/FrameView.cpp	2019-02-01 07:09:22 UTC (rev 240836)
+++ trunk/Source/WebCore/page/FrameView.cpp	2019-02-01 08:43:33 UTC (rev 240837)
@@ -893,7 +893,7 @@
     return backing->tiledBacking();
 }
 
-uint64_t FrameView::scrollLayerID() const
+ScrollingNodeID FrameView::scrollingNodeID() const
 {
     RenderView* renderView = this->renderView();
     if (!renderView)

Modified: trunk/Source/WebCore/page/FrameView.h (240836 => 240837)


--- trunk/Source/WebCore/page/FrameView.h	2019-02-01 07:09:22 UTC (rev 240836)
+++ trunk/Source/WebCore/page/FrameView.h	2019-02-01 08:43:33 UTC (rev 240837)
@@ -152,7 +152,7 @@
 
     WEBCORE_EXPORT TiledBacking* tiledBacking() const final;
 
-    uint64_t scrollLayerID() const override;
+    ScrollingNodeID scrollingNodeID() const override;
     ScrollableArea* scrollableAreaForScrollLayerID(uint64_t) const;
     bool usesAsyncScrolling() const final;
 

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (240836 => 240837)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2019-02-01 07:09:22 UTC (rev 240836)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2019-02-01 08:43:33 UTC (rev 240837)
@@ -130,7 +130,7 @@
     if (!coordinatesScrollingForFrameView(frameView))
         return;
 
-    auto* node = m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID());
+    auto* node = m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID());
     if (!node || !is<ScrollingStateFrameScrollingNode>(*node))
         return;
 
@@ -190,7 +190,7 @@
     if (!page)
         return;
 
-    auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
+    auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID()));
     if (!node)
         return;
 
@@ -216,16 +216,16 @@
     
     // FIXME: In some navigation scenarios, the FrameView has no RenderView or that RenderView has not been composited.
     // This needs cleaning up: https://bugs.webkit.org/show_bug.cgi?id=132724
-    if (!frameView.scrollLayerID())
+    if (!frameView.scrollingNodeID())
         return;
     
     // If the root layer does not have a ScrollingStateNode, then we should create one.
     ensureRootStateNodeForFrameView(frameView);
-    ASSERT(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
+    ASSERT(m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID()));
 
     ScrollingCoordinator::frameViewRootLayerDidChange(frameView);
 
-    auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
+    auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID()));
     node->setLayer(scrollLayerForFrameView(frameView));
     node->setRootContentsLayer(rootContentsLayerForFrameView(frameView));
     node->setCounterScrollingLayer(counterScrollingLayerForFrameView(frameView));
@@ -248,7 +248,7 @@
 
     bool isProgrammaticScroll = frameView.inProgrammaticScroll();
     if (isProgrammaticScroll || frameView.frame().document()->pageCacheState() != Document::NotInPageCache)
-        updateScrollPositionAfterAsyncScroll(frameView.scrollLayerID(), scrollPosition, WTF::nullopt, isProgrammaticScroll, ScrollingLayerPositionAction::Set);
+        updateScrollPositionAfterAsyncScroll(frameView.scrollingNodeID(), scrollPosition, WTF::nullopt, isProgrammaticScroll, ScrollingLayerPositionAction::Set);
 
     // If this frame view's document is being put into the page cache, we don't want to update our
     // main frame scroll position. Just let the FrameView think that we did.
@@ -255,7 +255,7 @@
     if (frameView.frame().document()->pageCacheState() != Document::NotInPageCache)
         return true;
 
-    auto* stateNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
+    auto* stateNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID()));
     if (!stateNode)
         return false;
 
@@ -318,7 +318,7 @@
     // from ScrollingTreeStateNodes.
     for (Frame* frame = &m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (auto* view = frame->view()) {
-            if (view->scrollLayerID() == parentNode->scrollingNodeID())
+            if (view->scrollingNodeID() == parentNode->scrollingNodeID())
                 return view;
         }
     }
@@ -341,7 +341,7 @@
 
     auto& frameView = *frameViewPtr;
 
-    if (scrollingNodeID == frameView.scrollLayerID()) {
+    if (scrollingNodeID == frameView.scrollingNodeID()) {
         reconcileScrollingState(frameView, scrollPosition, layoutViewportOrigin, programmaticScroll, ViewportRectStability::Stable, scrollingLayerPositionAction);
 
 #if PLATFORM(COCOA)
@@ -406,7 +406,7 @@
     frameView.setInProgrammaticScroll(oldProgrammaticScroll);
 
     if (!programmaticScroll && scrollingLayerPositionAction != ScrollingLayerPositionAction::Set) {
-        auto scrollingNodeID = frameView.scrollLayerID();
+        auto scrollingNodeID = frameView.scrollingNodeID();
         if (viewportRectStability == ViewportRectStability::Stable)
             reconcileViewportConstrainedLayerPositions(scrollingNodeID, frameView.rectForFixedPositionLayout(), scrollingLayerPositionAction);
         else if (layoutViewportRect)
@@ -473,7 +473,7 @@
     ASSERT(isMainThread());
     ASSERT(m_page);
 
-    auto* node = m_scrollingStateTree->stateNodeForID(scrollableArea.scrollLayerID());
+    auto* node = m_scrollingStateTree->stateNodeForID(scrollableArea.scrollingNodeID());
     if (is<ScrollingStateFrameScrollingNode>(node)) {
         auto& scrollingNode = downcast<ScrollingStateFrameScrollingNode>(*node);
         if (orientation == VerticalScrollbar)
@@ -563,14 +563,14 @@
 
 void AsyncScrollingCoordinator::ensureRootStateNodeForFrameView(FrameView& frameView)
 {
-    ASSERT(frameView.scrollLayerID());
-    if (m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()))
+    ASSERT(frameView.scrollingNodeID());
+    if (m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID()))
         return;
 
     // 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());
-    insertNode(ScrollingNodeType::MainFrame, frameView.scrollLayerID(), 0, 0);
+    insertNode(ScrollingNodeType::MainFrame, frameView.scrollingNodeID(), 0, 0);
 }
 
 void AsyncScrollingCoordinator::setNodeLayers(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, GraphicsLayer* rootContentsLayer)
@@ -651,7 +651,7 @@
 
 void AsyncScrollingCoordinator::setSynchronousScrollingReasons(FrameView& frameView, SynchronousScrollingReasons reasons)
 {
-    auto* scrollingStateNode = static_cast<ScrollingStateFrameScrollingNode*>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
+    auto* scrollingStateNode = static_cast<ScrollingStateFrameScrollingNode*>(m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID()));
     if (!scrollingStateNode)
         return;
 
@@ -714,7 +714,7 @@
     if (!frameView)
         return;
     
-    if (scrollingNodeID == frameView->scrollLayerID()) {
+    if (scrollingNodeID == frameView->scrollingNodeID()) {
         frameView->setCurrentHorizontalSnapPointIndex(horizontalIndex);
         frameView->setCurrentVerticalSnapPointIndex(verticalIndex);
         return;
@@ -760,7 +760,7 @@
 
 void AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView(const FrameView& frameView)
 {
-    if (auto node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()))) {
+    if (auto node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID()))) {
         setStateScrollingNodeSnapOffsetsAsFloat(*node, ScrollEventAxis::Horizontal, frameView.horizontalSnapOffsets(), frameView.horizontalSnapOffsetRanges(), m_page->deviceScaleFactor());
         setStateScrollingNodeSnapOffsetsAsFloat(*node, ScrollEventAxis::Vertical, frameView.verticalSnapOffsets(), frameView.verticalSnapOffsetRanges(), m_page->deviceScaleFactor());
         node->setCurrentHorizontalSnapPointIndex(frameView.currentHorizontalSnapPointIndex());

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h (240836 => 240837)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h	2019-02-01 07:09:22 UTC (rev 240836)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h	2019-02-01 08:43:33 UTC (rev 240837)
@@ -30,7 +30,6 @@
 namespace WebCore {
 
 typedef unsigned SynchronousScrollingReasons;
-typedef uint64_t ScrollingNodeID;
 
 enum class ScrollingNodeType : uint8_t {
     MainFrame,

Modified: trunk/Source/WebCore/platform/ScrollTypes.h (240836 => 240837)


--- trunk/Source/WebCore/platform/ScrollTypes.h	2019-02-01 07:09:22 UTC (rev 240836)
+++ trunk/Source/WebCore/platform/ScrollTypes.h	2019-02-01 08:43:33 UTC (rev 240837)
@@ -193,6 +193,8 @@
     Scroll
 };
 
+using ScrollingNodeID = uint64_t;
+
 }
 
 #endif

Modified: trunk/Source/WebCore/platform/ScrollableArea.h (240836 => 240837)


--- trunk/Source/WebCore/platform/ScrollableArea.h	2019-02-01 07:09:22 UTC (rev 240836)
+++ trunk/Source/WebCore/platform/ScrollableArea.h	2019-02-01 08:43:33 UTC (rev 240837)
@@ -143,7 +143,7 @@
     ScrollbarOverlayStyle scrollbarOverlayStyle() const { return static_cast<ScrollbarOverlayStyle>(m_scrollbarOverlayStyle); }
     bool useDarkAppearanceForScrollbars() const;
 
-    virtual uint64_t scrollLayerID() const { return 0; }
+    virtual ScrollingNodeID scrollingNodeID() const { return 0; }
 
     // This getter will create a ScrollAnimator if it doesn't already exist.
     WEBCORE_EXPORT ScrollAnimator& scrollAnimator() const;

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (240836 => 240837)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2019-02-01 07:09:22 UTC (rev 240836)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2019-02-01 08:43:33 UTC (rev 240837)
@@ -1966,7 +1966,7 @@
 
     if (auto frameHostingNodeID = backing->scrollingNodeIDForRole(ScrollCoordinationRole::FrameHosting)) {
         auto* contentsRenderView = frameContentsRenderView(renderer);
-        if (auto frameRootScrollingNodeID = contentsRenderView->frameView().scrollLayerID()) {
+        if (auto frameRootScrollingNodeID = contentsRenderView->frameView().scrollingNodeID()) {
             if (auto* scrollingCoordinator = this->scrollingCoordinator())
                 scrollingCoordinator->insertNode(ScrollingNodeType::Subframe, frameRootScrollingNodeID, frameHostingNodeID, 0);
         }
@@ -3579,7 +3579,7 @@
         if (auto* ownerElement = m_renderView.document().ownerElement())
             ownerElement->scheduleInvalidateStyleAndLayerComposition();
 
-        if (auto frameRootScrollingNodeID = m_renderView.frameView().scrollLayerID()) {
+        if (auto frameRootScrollingNodeID = m_renderView.frameView().scrollingNodeID()) {
             if (auto* scrollingCoordinator = this->scrollingCoordinator())
                 scrollingCoordinator->unparentNode(frameRootScrollingNodeID);
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to