[Nicosia] ScrollingCoordinatorNicosia should handle wheel events coming from the...
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Sep 2019 10:36:57 +0000 (10:36 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Sep 2019 10:36:57 +0000 (10:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202275

Reviewed by Carlos Garcia Campos.

* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
(WebCore::ScrollingCoordinatorNicosia::handleWheelEvent):
Handle wheel events that get rerouted through the main thread,
dispatching them back to the scrolling thread so that they end up
performing the desired scroll if possible.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250419 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp

index 9b8a66d..9fec8de 100644 (file)
@@ -1,5 +1,18 @@
 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
 
+        [Nicosia] ScrollingCoordinatorNicosia should handle wheel events coming from the main thread
+        https://bugs.webkit.org/show_bug.cgi?id=202275
+
+        Reviewed by Carlos Garcia Campos.
+
+        * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
+        (WebCore::ScrollingCoordinatorNicosia::handleWheelEvent):
+        Handle wheel events that get rerouted through the main thread,
+        dispatching them back to the scrolling thread so that they end up
+        performing the desired scroll if possible.
+
+2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
+
         [CoordinatedGraphics] support bounds origin
         https://bugs.webkit.org/show_bug.cgi?id=198998
 
index 75b6a4c..737963c 100644 (file)
@@ -69,9 +69,16 @@ void ScrollingCoordinatorNicosia::commitTreeStateIfNeeded()
     m_scrollingStateTreeCommitterTimer.stop();
 }
 
-ScrollingEventResult ScrollingCoordinatorNicosia::handleWheelEvent(FrameView&, const PlatformWheelEvent&)
+ScrollingEventResult ScrollingCoordinatorNicosia::handleWheelEvent(FrameView&, const PlatformWheelEvent& wheelEvent)
 {
-    return ScrollingEventResult::DidNotHandleEvent;
+    ASSERT(isMainThread());
+    ASSERT(m_page);
+    ASSERT(scrollingTree());
+
+    ScrollingThread::dispatch([threadedScrollingTree = makeRef(downcast<ThreadedScrollingTree>(*scrollingTree())), wheelEvent] {
+        threadedScrollingTree->handleWheelEvent(wheelEvent);
+    });
+    return ScrollingEventResult::DidHandleEvent;
 }
 
 void ScrollingCoordinatorNicosia::scheduleTreeStateCommit()