Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 99408d01e78e48e5a43c300c1414b6b1d2532481
      
https://github.com/WebKit/WebKit/commit/99408d01e78e48e5a43c300c1414b6b1d2532481
  Author: Zak Ridouh <[email protected]>
  Date:   2026-10-07 (Wed, 07 Oct 2026)

  Changed paths:
    M Source/WebCore/page/mac/ImageOverlayControllerMac.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ImageAnalysisTests.mm

  Log Message:
  -----------
  [macOS] Data detector menu for Live Text in an iframe appears offset by the 
iframe's position
https://bugs.webkit.org/show_bug.cgi?id=325635
rdar://188684274

Reviewed by Tim Nguyen and Ruthvik Konda.

Clicking a data detector in a Live Text image inside an iframe showed its menu 
offset by the iframe's
position, because handleDataDetectorAction() converted a point in main frame 
contents coordinates with
the iframe's view. Convert the click's window location through the iframe's 
view instead, and use
contentsToMainFrameView() for it and for the element bounds so both stay 
relative to the main frame's
view even when the iframe is site-isolated.

This only changes where the menu and its element bounds are positioned. It does 
not make data
detectors in Live Text work in cross-site iframes under site isolation: mouse 
events for an image
overlay there are still dropped before they reach this code, which needs 
separate plumbing.

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

* Source/WebCore/page/mac/ImageOverlayControllerMac.mm:
(WebCore::ImageOverlayController::platformHandleMouseEvent):
(WebCore::ImageOverlayController::handleDataDetectorAction):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ImageAnalysisTests.mm:
(TestWebKitAPI::dataDetectorHighlightButtonLocation):
(TestWebKitAPI::TEST(ImageAnalysisTests, DataDetectorMenuLocationInSubframe)):

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



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

Reply via email to