Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 31eb0baafdee9f427762f3fe7fbd8049663c6882
https://github.com/WebKit/WebKit/commit/31eb0baafdee9f427762f3fe7fbd8049663c6882
Author: Charlie Wolfe <[email protected]>
Date: 2023-09-13 (Wed, 13 Sep 2023)
Changed paths:
M Source/WebCore/Headers.cmake
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/page/AutoscrollController.cpp
M Source/WebCore/page/ContextMenuController.cpp
M Source/WebCore/page/EventHandler.cpp
M Source/WebCore/page/EventHandler.h
M Source/WebCore/page/FrameView.h
A Source/WebCore/page/HandleMouseEventResult.h
M Source/WebCore/page/LocalFrameView.h
M Source/WebCore/page/RemoteFrameView.h
A Source/WebCore/page/RemoteMouseEventData.h
M Source/WebCore/page/ios/EventHandlerIOS.mm
M Source/WebCore/page/mac/EventHandlerMac.mm
M Source/WebCore/page/win/EventHandlerWin.cpp
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
M Source/WebKit/Shared/WebMouseEvent.h
M Source/WebKit/UIProcess/RemotePageProxy.cpp
M Source/WebKit/UIProcess/RemotePageProxy.h
M Source/WebKit/UIProcess/WebFrameProxy.cpp
M Source/WebKit/UIProcess/WebFrameProxy.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/WebProcess/WebPage/WebFrame.cpp
M Source/WebKit/WebProcess/WebPage/WebFrame.h
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.h
M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm
Log Message:
-----------
Propagate mouse events to site-isolated frames
https://bugs.webkit.org/show_bug.cgi?id=260875
rdar://114656583
Reviewed by Alex Christensen.
This patch makes changes to propagate mouse down, up, and move events to
site-isolated frames.
When a hit test leads to a remote frame, the web process will send IPC to the
UI process
containing the target frame ID and the transformed coordinates relative to the
remote frame’s
parent. The UI process then sends the mouse event with the corrected
coordinates to the specified
frame.
* Source/WebCore/Headers.cmake:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::subframeForHitTestResult):
(WebCore::EventHandler::subframeForTargetNode):
Change these functions to return a `Frame` so we can later check if the target
subframe is a
remote frame.
(WebCore::documentPointForWindowPoint):
`documentPointForWindowPoint()` should take a Frame so we can use it to
transform mouse coordinates
to be sent to a remote frame.
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::passMouseMovedEventToScrollbars):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
Update these functions to check when a remote frame is the target frame. If so,
return
`RemoteMouseEventData`.
* Source/WebCore/page/HandleMouseEventResult.h: Added.
(WebCore::HandleMouseEventResult::HandleMouseEventResult):
(WebCore::HandleMouseEventResult::wasHandled):
(WebCore::HandleMouseEventResult::setHandled):
(WebCore::HandleMouseEventResult::remoteMouseEventData):
Add `HandleMouseEventResult` to replace to bool used as the return type for
mouse events.
* Source/WebCore/page/FrameView.h:
* Source/WebCore/page/LocalFrameView.h:
* Source/WebCore/page/RemoteFrameView.h:
Create a virtual `frame()` function on FrameView.
* Source/WebCore/page/RemoteMouseEventData.h: Added.
Add `RemoteMouseEventData` to store the target remote frame and the transformed
coordinates that is
sent to the UI process.
* Source/WebKit/Shared/WebMouseEvent.h:
(WebKit::WebMouseEvent::setPosition):
Add a `setPosition()` function that is used to correct the position of the
propagated mouse event.
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::remotePageProxy):
* Source/WebKit/UIProcess/WebFrameProxy.h:
Add an accessor for a RemotePageProxy.
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleMouseEventReply):
(WebKit::WebPageProxy::sendMouseEvent):
(WebKit::WebPageProxy::processNextQueuedMouseEvent):
* Source/WebKit/UIProcess/WebPageProxy.h:
Add functions to propagate the mouse event to the frame specified in the
completion handler in
`RemoteMouseEventData`.
* Source/WebCore/page/AutoscrollController.cpp:
(WebCore::AutoscrollController::stopAutoscrollTimer):
* Source/WebCore/page/ContextMenuController.cpp:
* Source/WebCore/page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseDown):
(WebCore::EventHandler::mouseUp):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::tryToBeginDragAtPoint):
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::handleMouseEvent):
* Source/WebKit/WebProcess/WebPage/WebFrame.h:
(WebKit::WebPage::mouseEvent):
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::completeSyntheticClick):
Update these to use the new return type on the handle mouse event functions.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm:
(TestWebKitAPI::TEST):
Add an API test to verify mouse up, down, and move events are sent to
cross-origin frames when
site isolation is enabled. Also check that the mouse coordinates are correctly
transformed.
Canonical link: https://commits.webkit.org/267964@main
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes