Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3e3c9b5f60e2ce934f818039555c2bbf97f8a2dd
https://github.com/WebKit/WebKit/commit/3e3c9b5f60e2ce934f818039555c2bbf97f8a2dd
Author: Sihui Liu <[email protected]>
Date: 2026-09-22 (Tue, 22 Sep 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/ios/long-press-in-cross-origin-iframe-in-scrolled-main-frame-expected.txt
A
LayoutTests/http/tests/site-isolation/ios/long-press-in-cross-origin-iframe-in-scrolled-main-frame.html
A
LayoutTests/http/tests/site-isolation/ios/long-press-in-cross-site-grandchild-of-scrolled-middle-frame-expected.txt
A
LayoutTests/http/tests/site-isolation/ios/long-press-in-cross-site-grandchild-of-scrolled-middle-frame.html
A
LayoutTests/http/tests/site-isolation/resources/scrolled-middle-frame-with-cross-site-grandchild.html
M LayoutTests/platform/ios/TestExpectations
M Source/WebCore/page/RemoteFrameGeometryTransformer.cpp
M Source/WebCore/page/RemoteFrameGeometryTransformer.h
M Source/WebKit/Shared/WebTouchEvent.cpp
M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ios/DragAndDropTestsIOS.mm
Log Message:
-----------
[Site Isolation][iOS] Drag and selection land at the wrong point in a
cross-site iframe nested inside another frame
https://bugs.webkit.org/show_bug.cgi?id=324828
rdar://188086920
Reviewed by Per Arne Vollan and Jessica Cheung.
The callers of
RemoteFrameGeometryTransformer::transformToRemoteFrameCoordinates pass a point
in this process's local
root view, not in m_localView's contents: RemoteUserInputEventData re-bases the
point at every process hop. Rename the
parameter to pointInLocalRootView and drop the contentsToRootView step, which
was adding m_localView's offset and scroll
to the point.
That fixes two cases. Dragging, where EventHandler::tryToBeginDragAtPoint
recurses into local subframes before
constructing the transformer, so m_localView is the remote frame's immediate
parent and a cross-site iframe inside an
offset same-site subframe lifted the element at the wrong point. And selecting
in a process whose local root is not the
main frame, where that local root's own scroll offset was subtracted from the
point.
The remaining body is identical to
transformRootViewPointToRemoteFrameCoordinates, so merge the two and update the
WebTouchEvent call sites to the surviving name. WebPage::potentialTapAtPosition
can drop its rootViewToContents call,
which the removed conversion undid.
m_localView is now unused; removing it will be a separate change given it
requires to update all existing callers.
Tests: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ios/DragAndDropTestsIOS.mm
http/tests/site-isolation/ios/long-press-in-cross-origin-iframe-in-scrolled-main-frame.html
http/tests/site-isolation/ios/long-press-in-cross-site-grandchild-of-scrolled-middle-frame.html
*
LayoutTests/http/tests/site-isolation/ios/long-press-in-cross-origin-iframe-in-scrolled-main-frame-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/ios/long-press-in-cross-origin-iframe-in-scrolled-main-frame.html:
Added.
*
LayoutTests/http/tests/site-isolation/ios/long-press-in-cross-site-grandchild-of-scrolled-middle-frame-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/ios/long-press-in-cross-site-grandchild-of-scrolled-middle-frame.html:
Added.
*
LayoutTests/http/tests/site-isolation/resources/scrolled-middle-frame-with-cross-site-grandchild.html:
Added.
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/page/RemoteFrameGeometryTransformer.cpp:
(WebCore::RemoteFrameGeometryTransformer::transformToRemoteFrameCoordinates
const):
(WebCore::RemoteFrameGeometryTransformer::transformRootViewPointToRemoteFrameCoordinates
const): Deleted.
* Source/WebCore/page/RemoteFrameGeometryTransformer.h:
* Source/WebKit/Shared/WebTouchEvent.cpp:
(WebKit::WebTouchEvent::transformToRemoteFrameCoordinates):
(WebKit::WebPlatformTouchPoint::transformToRemoteFrameCoordinates):
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::potentialTapAtPosition):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::enableSiteIsolation):
(TestWebKitAPI::dragLinkInIframeNestedInOffsetSubframe):
(TestWebKitAPI::TEST(DragAndDropTests,
DragLinkInSameSiteIframeInsideOffsetSameSiteSubframe)):
(TestWebKitAPI::TEST(DragAndDropTests,
DragLinkInCrossOriginIframeInsideOffsetSameSiteSubframe)):
Canonical link: https://commits.webkit.org/321638@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications