Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e505e7f1c203bf380dd18140c0dbb834f970b76c
      
https://github.com/WebKit/WebKit/commit/e505e7f1c203bf380dd18140c0dbb834f970b76c
  Author: Simon Fraser <[email protected]>
  Date:   2022-12-16 (Fri, 16 Dec 2022)

  Changed paths:
    M Source/WebCore/page/scrolling/ScrollingTree.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm
    M 
Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Tools/WebKitTestRunner/EventSenderProxy.h
    M Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
    M Tools/WebKitTestRunner/InjectedBundle/ios/EventSenderProxyIOS.mm
    M Tools/WebKitTestRunner/TestController.cpp
    M Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp
    M Tools/WebKitTestRunner/libwpe/EventSenderProxyLibWPE.cpp
    M Tools/WebKitTestRunner/mac/EventSenderProxy.mm
    M Tools/WebKitTestRunner/win/EventSenderProxyWin.cpp

  Log Message:
  -----------
  Send "isMonitoringWheelEvents" to the UI process
https://bugs.webkit.org/show_bug.cgi?id=249450
rdar://103434051

Reviewed by Brent Fulgham.

A test can do:
    eventSender.monitorWheelEvents();
    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');

which means that we need to be able to start monitoring wheel events (in the
UI process if UI-side compositing is enabled) before the IPC to synthesize the
first wheel event is received.

Code exists to update the "isMonitoringWheelEvents" state on ScrollingTree via
scrolling tree commits (which reach the UI process after each rendering update),
but that's too late for this case; we need a direct IPC call.

So when EventSender::monitorWheelEvents() is called in the web process, post
an "EventSender" message which is handled by 
TestController::didReceiveMessageFromInjectedBundle()
and passed to EventSenderProxy, which gets it to 
RemoteScrollingCoordinatorProxy via
WKWebView testing SPI, and WebPageProxy. RemoteScrollingCoordinatorProxy can 
then set
state on the ScrollingTree in the UI process.

* Source/WebCore/page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setIsMonitoringWheelEvents):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _startMonitoringWheelEvents]):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::startMonitoringWheelEventsForTesting):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::startMonitoringWheelEventsForTesting):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Tools/WebKitTestRunner/EventSenderProxy.h:
* Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::monitorWheelEvents):
* Tools/WebKitTestRunner/InjectedBundle/ios/EventSenderProxyIOS.mm:
(WTR::EventSenderProxy::monitorWheelEvents):
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::TestController::didReceiveMessageFromInjectedBundle):
* Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::EventSenderProxy::monitorWheelEvents):
* Tools/WebKitTestRunner/libwpe/EventSenderProxyLibWPE.cpp:
(WTR::EventSenderProxy::monitorWheelEvents):
* Tools/WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::monitorWheelEvents):
* Tools/WebKitTestRunner/win/EventSenderProxyWin.cpp:
(WTR::EventSenderProxy::monitorWheelEvents):

Canonical link: https://commits.webkit.org/258002@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to