Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7c1d2dd42a40208c8952ba0c9c6cab2ea5e2bdd8
https://github.com/WebKit/WebKit/commit/7c1d2dd42a40208c8952ba0c9c6cab2ea5e2bdd8
Author: Zak Ridouh <[email protected]>
Date: 2026-10-04 (Sun, 04 Oct 2026)
Changed paths:
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration+Extras.swift
M Source/WebKit/UIProcess/API/Swift/WebPage+Configuration.swift
M Source/WebKit/UIProcess/API/mac/WKWebViewPrivateForTestingMac.h
M Source/WebKit/UIProcess/API/mac/WKWebViewTestingMac.mm
M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
M Tools/TestWebKitAPI/Helpers/cocoa/WebPage+JavaScriptExpression.swift
M Tools/TestWebKitAPI/PlatformCocoa.cmake
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation-1.mm
A Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture
Tests/SiteIsolationAppKitGesturesTests.swift
Log Message:
-----------
[Site Isolation] [macOS] Selected text in cross-site iframes can't be dragged
with AppKit gestures
https://bugs.webkit.org/show_bug.cgi?id=325693
rdar://188758824
Reviewed by Abrar Rahman Protyasha, Wenson Hsieh, and Ryosuke Niwa.
With AppKit gestures, the text selection controller hit-tests the selection and
places the insertion
cursor using the editor state's caret rects and selection geometries. These
were computed with
contentsToRootView(), which stops at the local root, so for a selection in a
cross-site iframe they
were relative to the iframe. Compute them with contentsToMainFrameView()
instead, and stop converting
them again in the iOS-only fixup.
Tests: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation-1.mm
Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture
Tests/SiteIsolationAppKitGesturesTests.swift
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration+Extras.swift:
* Source/WebKit/UIProcess/API/Swift/WebPage+Configuration.swift:
(Configuration.siteIsolationEnabled):
* Source/WebKit/UIProcess/API/mac/WKWebViewPrivateForTestingMac.h:
* Source/WebKit/UIProcess/API/mac/WKWebViewTestingMac.mm:
(-[WKWebView _caretRectForTesting]):
(-[WKWebView _selectionRectsForTesting]):
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::convertContentToMainFrameView):
(WebKit::WebPage::getPlatformEditorStateCommon const):
(WebKit::convertContentToRootView): Deleted.
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPlatformEditorState const):
* Tools/TestWebKitAPI/Helpers/cocoa/WebPage+JavaScriptExpression.swift:
(WebPage.callJavaScript(_:in:)):
* Tools/TestWebKitAPI/PlatformCocoa.cmake:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation-1.mm:
(TestWebKitAPI::TEST(SiteIsolation,
SelectionGeometryInCrossOriginIframeUsesMainFrameCoordinates)):
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture
Tests/SiteIsolationAppKitGesturesTests.swift: Added.
(AppKitGesturesTests.SiteIsolation.clickingOnSelectedWordInCrossSiteIframeKeepsTextSelected):
(AppKitGesturesTests.SiteIsolation.screenBoundsOfTextInIframe(_:in:)):
Canonical link: https://commits.webkit.org/322633@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications