Title: [267469] trunk/Source/WebCore
Revision
267469
Author
[email protected]
Date
2020-09-23 05:17:59 -0700 (Wed, 23 Sep 2020)

Log Message

Wheel event phases of FrameView are not handled correctly
https://bugs.webkit.org/show_bug.cgi?id=216870

Reviewed by Simon Fraser.

In AsyncScrollingCoordinator::handleWheelEventPhase, the scrollAnimator of a FrameView should be from FrameView itself, not ScrollableArea.
It doesn't call nodeDidHandleEvent to handle wheel event phases when !asyncFrameOrOverflowScrollingEnabled. Should call it after handleWheelEvent.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::handleWheelEventPhase): When nodeID is FrameView, we should use the scrollAnimator of FrameView instead.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent): If wheelEvent is handled, we should call nodeDidHandleEvent to handle the phases.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (267468 => 267469)


--- trunk/Source/WebCore/ChangeLog	2020-09-23 12:03:57 UTC (rev 267468)
+++ trunk/Source/WebCore/ChangeLog	2020-09-23 12:17:59 UTC (rev 267469)
@@ -1,3 +1,18 @@
+2020-09-23  Cathie Chen  <[email protected]>
+
+        Wheel event phases of FrameView are not handled correctly
+        https://bugs.webkit.org/show_bug.cgi?id=216870
+
+        Reviewed by Simon Fraser.
+
+        In AsyncScrollingCoordinator::handleWheelEventPhase, the scrollAnimator of a FrameView should be from FrameView itself, not ScrollableArea.
+        It doesn't call nodeDidHandleEvent to handle wheel event phases when !asyncFrameOrOverflowScrollingEnabled. Should call it after handleWheelEvent.
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::handleWheelEventPhase): When nodeID is FrameView, we should use the scrollAnimator of FrameView instead.
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::handleWheelEvent): If wheelEvent is handled, we should call nodeDidHandleEvent to handle the phases.
+
 2020-09-23  Antti Koivisto  <[email protected]>
 
         [LFC][Integration] Add canUseFor functions

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (267468 => 267469)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2020-09-23 12:03:57 UTC (rev 267468)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2020-09-23 12:17:59 UTC (rev 267469)
@@ -82,6 +82,11 @@
     if (!frameView)
         return;
 
+    if (nodeID == frameView->scrollingNodeID()) {
+        frameView->scrollAnimator().handleWheelEventPhase(phase);
+        return;
+    }
+
     if (auto* scrollableArea = frameView->scrollableAreaForScrollingNodeID(nodeID))
         scrollableArea->scrollAnimator().handleWheelEventPhase(phase);
 }

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (267468 => 267469)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2020-09-23 12:03:57 UTC (rev 267468)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2020-09-23 12:17:59 UTC (rev 267469)
@@ -107,8 +107,12 @@
         if (!m_rootNode)
             return WheelEventHandlingResult::unhandled();
 
-        if (!asyncFrameOrOverflowScrollingEnabled())
-            return m_rootNode->handleWheelEvent(wheelEvent);
+        if (!asyncFrameOrOverflowScrollingEnabled()) {
+            auto result = m_rootNode->handleWheelEvent(wheelEvent);
+            if (result.wasHandled)
+                m_gestureState.nodeDidHandleEvent(m_rootNode->scrollingNodeID(), wheelEvent);
+            return result;
+        }
 
         if (m_gestureState.handleGestureCancel(wheelEvent)) {
             clearNodesWithUserScrollInProgress();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to