Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 59c6b9895dec345d61ac05b9c89a8419a437200a
      
https://github.com/WebKit/WebKit/commit/59c6b9895dec345d61ac05b9c89a8419a437200a
  Author: Zak Ridouh <[email protected]>
  Date:   2026-07-18 (Sat, 18 Jul 2026)

  Changed paths:
    M Source/WebKit/Shared/EditorState.h
    M Source/WebKit/Shared/EditorState.serialization.in
    M Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    M Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm

  Log Message:
  -----------
  [Site Isolation] Fix many selection popovers that are mispositioned in 
cross-origin iframes
https://bugs.webkit.org/show_bug.cgi?id=317454
rdar://180075330

Reviewed by Alex Christensen.

Look Up, Translate, Share, and Add to Dictionary anchor their popovers to the
selection's bounding rect from the editor state. That rect is in the selected
frame's root-view coordinates, which for a cross-origin iframe is offset from
the main frame, so the popovers appeared in the wrong place.

Record the selection's local root frame on EditorState::VisualData and convert
the rect to main-frame coordinates before presenting each popover.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm

* Source/WebKit/Shared/EditorState.h:
* Source/WebKit/Shared/EditorState.serialization.in:
* Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm:
(-[WKWebView _selectionBoundingRectInMainFrameCoordinatesForTesting:]):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView lookupForWebView:]):
(-[WKContentView shareForWebView:]):
(-[WKContentView translateForWebView:]):
(-[WKContentView addShortcutForWebView:]):
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::convertEditorStateSelectionRectToMainFrameCoordinates):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::platformPopulateEditorStateIfNeeded const):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState const):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::(SiteIsolation, 
SelectionBoundingRectInCrossOriginIframeUsesMainFrameCoordinates)):
(TestWebKitAPI::(SiteIsolation, 
SelectionBoundingRectInNestedCrossOriginIframesUsesMainFrameCoordinates)):
(TestWebKitAPI::(SiteIsolation, SelectionBoundingRectInMainFrameIsNotOffset)):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to