Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d189118ff4e6356a3e1f3a5ba2893ebf9a1a8248
https://github.com/WebKit/WebKit/commit/d189118ff4e6356a3e1f3a5ba2893ebf9a1a8248
Author: Lily Spiniolas <[email protected]>
Date: 2026-04-07 (Tue, 07 Apr 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/mouse-events/mouse-cursor-custom-images-expected.txt
A
LayoutTests/http/tests/site-isolation/mouse-events/mouse-cursor-custom-images.html
A
LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor-custom-images-iframe.html
A
LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor-custom-images-nested-iframe.html
A
LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor11x11.png
A
LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor12x12.png
A
LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor13x13.png
A
LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor14x14.png
A LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor5x5.png
A LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor7x7.png
A LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor8x8.png
A LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor9x9.png
M Source/WebCore/page/EventHandler.cpp
M Source/WebKit/UIProcess/API/C/WKPage.cpp
M Source/WebKit/UIProcess/API/C/WKPagePrivate.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Tools/WebKitTestRunner/TestController.cpp
M Tools/WebKitTestRunner/TestController.h
Log Message:
-----------
[Site isolation] Custom cursor images don't work in cross-origin subframes
https://bugs.webkit.org/show_bug.cgi?id=311389
rdar://163979120
Reviewed by Aditya Keerthi.
With site isolation enabled,
`RefPtr localMainFrame = dynamicDowncast<LocalFrame>(frame->mainFrame());`
inside
EventHandler::selectCursor fails for cross origin frames because `mainFrame()`
for
a cross origin frame is a remote frame, not a local frame, so the downcast
fails.
Searching for a root frame is actually entirely unnecessary both with SI on and
with SI off because `result.pointInMainFrame()` is not actually the point in
the main frame, it is simply the point in whichever frame the mouse is over.
Therefore,
instead of basing the visible content rect off of the main frame's view, we can
simply
take the view of `m_frame`.
In a later patch, `pointInMainFrame()` should be renamed, and we should audit
existing
usage of it to ensure there are not other coordinate issues.
Test: http/tests/site-isolation/mouse-events/mouse-cursor-custom-images.html
*
LayoutTests/http/tests/site-isolation/mouse-events/mouse-cursor-custom-images-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/mouse-events/mouse-cursor-custom-images.html:
Added.
*
LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor-custom-images-iframe.html:
Added.
*
LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor-custom-images-nested-iframe.html:
Added.
* LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor11x11.png:
Added.
* LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor12x12.png:
Added.
* LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor13x13.png:
Added.
* LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor14x14.png:
Added.
* LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor5x5.png:
Added.
* LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor7x7.png:
Added.
* LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor8x8.png:
Added.
* LayoutTests/http/tests/site-isolation/mouse-events/resources/cursor9x9.png:
Added.
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
* Source/WebKit/UIProcess/API/C/WKPage.cpp:
(WKPageSetCursorDidChangeCallbackForTesting):
* Source/WebKit/UIProcess/API/C/WKPagePrivate.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setCursor):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::cursorDidChangeForTesting):
(WTR::TestController::cursorDidChange):
(WTR::TestController::resetStateToConsistentValues):
* Tools/WebKitTestRunner/TestController.h:
Canonical link: https://commits.webkit.org/310732@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications