Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 38d9120295b679bfe0fea60b075e041fc3efd1d6
      
https://github.com/WebKit/WebKit/commit/38d9120295b679bfe0fea60b075e041fc3efd1d6
  Author: Tyler Wilcock <[email protected]>
  Date:   2026-04-09 (Thu, 09 Apr 2026)

  Changed paths:
    A LayoutTests/accessibility/show-menu-fires-contextmenu-event-expected.txt
    A LayoutTests/accessibility/show-menu-fires-contextmenu-event.html
    A 
LayoutTests/http/tests/site-isolation/accessibility/show-menu-fires-contextmenu-event-in-remote-frame-expected.txt
    A 
LayoutTests/http/tests/site-isolation/accessibility/show-menu-fires-contextmenu-event-in-remote-frame.html
    A 
LayoutTests/http/tests/site-isolation/resources/iframe-with-contextmenu-target.html
    M LayoutTests/platform/glib/TestExpectations
    M Source/WebCore/accessibility/AccessibilityObject.cpp
    M Source/WebCore/accessibility/AccessibilityObject.h
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
    M 
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementClientMac.h
    M 
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementClientMac.mm
    M Tools/WebKitTestRunner/TestController.cpp
    M Tools/WebKitTestRunner/TestController.h

  Log Message:
  -----------
  AX: `contextmenu` event is not fired for either keyboard event or AT event 
(e.g. VoiceOver's VO+Shift+M) in iframes
https://bugs.webkit.org/show_bug.cgi?id=302049
rdar://164128676

Reviewed by Joshua Hoffman.

performShowMenuAction() was calling showContextMenuAt() with the local
main frame. Since sendContextMenuEvent does not dispatch to subframes, it
would hit-test in the main frame and find the <iframe> element itself,
so the contextmenu event never reached the actual target element inside
the iframe.

Fix by using the element's own document frame and contentsToWindow()
for coordinate conversion, so the hit-test runs in the correct local frame.

No special remote frame handling is needed (e.g. IPC), as if the AT is 
initiating
the show-menu action for an element, it does so by directly talking
directly to that element from within the remote frame.

* LayoutTests/accessibility/show-menu-fires-contextmenu-event-expected.txt: 
Added.
* LayoutTests/accessibility/show-menu-fires-contextmenu-event.html: Added.
* 
LayoutTests/http/tests/site-isolation/accessibility/show-menu-fires-contextmenu-event-in-remote-frame-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/accessibility/show-menu-fires-contextmenu-event-in-remote-frame.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/resources/iframe-with-contextmenu-target.html:
 Added.
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::performShowMenuAction):
* Source/WebCore/accessibility/AccessibilityObject.h:
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
(-[WebAccessibilityObjectWrapper _accessibilityPerformShowMenuAction]):
(-[WebAccessibilityObjectWrapper _accessibilityShowContextMenu]): Deleted.
* Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementClientMac.h:
* Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementClientMac.mm:
(WTR::axPerformAction):
(WTR::AccessibilityUIElementClientMac::showMenu):
* Tools/WebKitTestRunner/TestController.cpp:
* Tools/WebKitTestRunner/TestController.h:

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



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

Reply via email to