Title: [258098] trunk/Source
Revision
258098
Author
simon.fra...@apple.com
Date
2020-03-07 20:35:42 -0800 (Sat, 07 Mar 2020)

Log Message

Generalize setSynchronousScrollingReasons() to take a ScrollingNodeID
https://bugs.webkit.org/show_bug.cgi?id=208774

Reviewed by Zalan Bujtas.

Source/WebCore:

We'll be calling setSynchronousScrollingReasons() for overflow nodes at some point,
so change the argument from FrameView to ScrollingNodeID.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setSynchronousScrollingReasons):

Source/WebKit:

Whitespace.

* WebProcess/WebPage/EventDispatcher.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (258097 => 258098)


--- trunk/Source/WebCore/ChangeLog	2020-03-08 04:20:23 UTC (rev 258097)
+++ trunk/Source/WebCore/ChangeLog	2020-03-08 04:35:42 UTC (rev 258098)
@@ -1,3 +1,21 @@
+2020-03-07  Simon Fraser  <simon.fra...@apple.com>
+
+        Generalize setSynchronousScrollingReasons() to take a ScrollingNodeID
+        https://bugs.webkit.org/show_bug.cgi?id=208774
+
+        Reviewed by Zalan Bujtas.
+
+        We'll be calling setSynchronousScrollingReasons() for overflow nodes at some point,
+        so change the argument from FrameView to ScrollingNodeID.
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
+        * page/scrolling/ScrollingCoordinator.h:
+        (WebCore::ScrollingCoordinator::setSynchronousScrollingReasons):
+
 2020-03-07  Andres Gonzalez  <andresg...@apple.com>
 
         REGRESSION: (r257760?) [ Mac wk2 Debug ] ASSERTION FAILED: child->parentObject() == this in WebCore::AccessibilityObject::insertChild

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (258097 => 258098)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2020-03-08 04:20:23 UTC (rev 258097)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2020-03-08 04:35:42 UTC (rev 258098)
@@ -732,17 +732,19 @@
         ASSERT_NOT_REACHED();
 }
 
-void AsyncScrollingCoordinator::setSynchronousScrollingReasons(FrameView& frameView, OptionSet<SynchronousScrollingReason> reasons)
+void AsyncScrollingCoordinator::setSynchronousScrollingReasons(ScrollingNodeID nodeID, OptionSet<SynchronousScrollingReason> reasons)
 {
-    auto* scrollingStateNode = static_cast<ScrollingStateFrameScrollingNode*>(m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID()));
+    auto* scrollingStateNode = static_cast<ScrollingStateScrollingNode*>(m_scrollingStateTree->stateNodeForID(nodeID));
     if (!scrollingStateNode)
         return;
 
-    // The FrameView's GraphicsLayer is likely to be out-of-synch with the PlatformLayer
-    // at this point. So we'll update it before we switch back to main thread scrolling
-    // in order to avoid layer positioning bugs.
-    if (reasons)
-        reconcileScrollPosition(frameView, ScrollingLayerPositionAction::Set);
+    if (reasons && is<ScrollingStateFrameScrollingNode>(scrollingStateNode)) {
+        // The FrameView's GraphicsLayer is likely to be out-of-synch with the PlatformLayer
+        // at this point. So we'll update it before we switch back to main thread scrolling
+        // in order to avoid layer positioning bugs.
+        if (auto* frameView = frameViewForScrollingNode(nodeID))
+            reconcileScrollPosition(*frameView, ScrollingLayerPositionAction::Set);
+    }
 
     // FIXME: Ideally all the "synchronousScrollingReasons" functions should be #ifdeffed.
 #if ENABLE(SCROLLING_THREAD)

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (258097 => 258098)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h	2020-03-08 04:20:23 UTC (rev 258097)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h	2020-03-08 04:35:42 UTC (rev 258098)
@@ -133,7 +133,7 @@
     WEBCORE_EXPORT void reconcileViewportConstrainedLayerPositions(ScrollingNodeID, const LayoutRect& viewportRect, ScrollingLayerPositionAction) override;
     WEBCORE_EXPORT void scrollableAreaScrollbarLayerDidChange(ScrollableArea&, ScrollbarOrientation) override;
 
-    WEBCORE_EXPORT void setSynchronousScrollingReasons(FrameView&, OptionSet<SynchronousScrollingReason>) final;
+    WEBCORE_EXPORT void setSynchronousScrollingReasons(ScrollingNodeID, OptionSet<SynchronousScrollingReason>) final;
 
     virtual void scheduleTreeStateCommit() = 0;
 

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (258097 => 258098)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2020-03-08 04:20:23 UTC (rev 258097)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2020-03-08 04:35:42 UTC (rev 258098)
@@ -346,7 +346,7 @@
 void ScrollingCoordinator::updateSynchronousScrollingReasons(FrameView& frameView)
 {
     ASSERT(coordinatesScrollingForFrameView(frameView));
-    setSynchronousScrollingReasons(frameView, synchronousScrollingReasons(frameView));
+    setSynchronousScrollingReasons(frameView.scrollingNodeID(), synchronousScrollingReasons(frameView));
 }
 
 void ScrollingCoordinator::updateSynchronousScrollingReasonsForAllFrames()

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (258097 => 258098)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2020-03-08 04:20:23 UTC (rev 258097)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2020-03-08 04:35:42 UTC (rev 258098)
@@ -197,7 +197,7 @@
     Page* m_page; // FIXME: ideally this would be a reference but it gets nulled on async teardown.
 
 private:
-    virtual void setSynchronousScrollingReasons(FrameView&, OptionSet<SynchronousScrollingReason>) { }
+    virtual void setSynchronousScrollingReasons(ScrollingNodeID, OptionSet<SynchronousScrollingReason>) { }
 
     virtual bool hasVisibleSlowRepaintViewportConstrainedObjects(const FrameView&) const;
     void updateSynchronousScrollingReasons(FrameView&);

Modified: trunk/Source/WebKit/ChangeLog (258097 => 258098)


--- trunk/Source/WebKit/ChangeLog	2020-03-08 04:20:23 UTC (rev 258097)
+++ trunk/Source/WebKit/ChangeLog	2020-03-08 04:35:42 UTC (rev 258098)
@@ -1,3 +1,14 @@
+2020-03-07  Simon Fraser  <simon.fra...@apple.com>
+
+        Generalize setSynchronousScrollingReasons() to take a ScrollingNodeID
+        https://bugs.webkit.org/show_bug.cgi?id=208774
+
+        Reviewed by Zalan Bujtas.
+
+        Whitespace.
+
+        * WebProcess/WebPage/EventDispatcher.h:
+
 2020-03-07  Brady Eidson  <beid...@apple.com>
 
         Make PDF range requests to the network.

Modified: trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.h (258097 => 258098)


--- trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.h	2020-03-08 04:20:23 UTC (rev 258097)
+++ trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.h	2020-03-08 04:35:42 UTC (rev 258098)
@@ -84,7 +84,6 @@
     void gestureEvent(WebCore::PageIdentifier, const WebGestureEvent&);
 #endif
 
-
     // This is called on the main thread.
     void dispatchWheelEvent(WebCore::PageIdentifier, const WebWheelEvent&);
 #if ENABLE(IOS_TOUCH_EVENTS)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to