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

  Changed paths:
    M Source/WebKit/Shared/ContextMenuContextData.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm

  Log Message:
  -----------
  [Site Isolation] Context menu controlledImageBounds not converted to 
main-frame coordinates for cross-origin iframes
https://bugs.webkit.org/show_bug.cgi?id=311885
rdar://174452222

Reviewed by Alex Christensen.

When an image service click (image controls button) is triggered on an image
inside a site-isolated cross-origin iframe, the controlledImageBounds in
ContextMenuContextData contains coordinates relative to the subframe's content
area. In setupServicesMenu(), this rect is treated as if it were in main-frame
coordinates, causing the NSSharingServicePicker source frame to be wrong — the
sharing/markup popover appears at the wrong position.

The menuLocation point was already being converted to main-frame coordinates.
This patch converts the menuLocation and controlledImageBounds together in a
single convertRectsToMainFrameCoordinates roundtrip, staging the menuLocation as
a zero-size rect and appending controlledImageBounds when it is non-empty (like
for image service clicks).

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

* Source/WebKit/Shared/ContextMenuContextData.h:
(WebKit::ContextMenuContextData::setControlledImageBounds):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showContextMenuFromFrame):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::(SiteIsolation, 
ImageServiceControlledImageBoundsInCrossOriginIframe)):

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



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

Reply via email to