Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 59c54c4d2c51a2160179c04581dbe01793e5a1ea
      
https://github.com/WebKit/WebKit/commit/59c54c4d2c51a2160179c04581dbe01793e5a1ea
  Author: Tyler Wilcock <[email protected]>
  Date:   2026-03-26 (Thu, 26 Mar 2026)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/accname/aria-owns-expected.txt
    M Source/WebCore/accessibility/AccessibilityNodeObject.cpp

  Log Message:
  -----------
  AX: WebKit doesn't respect aria-owns when computing text-under-element for 
accname purposes
https://bugs.webkit.org/show_bug.cgi?id=310639
rdar://173249317

Reviewed by Joshua Hoffman.

textUnderElement() walks the DOM tree via AXChildIterator, which doesn't
reflect aria-owns relocations (unlike the AX tree built by addChildren /
insertChild). This caused three WPT accname/aria-owns.html failures:

1. Elements owned via aria-owns didn't contribute to the owner's accessible 
name.
2. Elements owned by another element via aria-owns still contributed
 to their DOM parent's accessible name.

Fix by adding aria-owns awareness to textUnderElement():

- Skip DOM children that are aria-owned by another non-hidden element,
since they should contribute to the owner's name instead.
- After processing DOM children, append text from aria-owned children
(which live outside the DOM subtree).

Per the ARIA spec, aria-owns is not resolved when the owning element is
excluded from the accessibility tree (hidden or aria-hidden), or when the
target element or a DOM ancestor is hidden from all users (display:none).

* LayoutTests/imported/w3c/web-platform-tests/accname/aria-owns-expected.txt:
Mark 3 new testcases as passing.
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement const):

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



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

Reply via email to