Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dfd051863e0236fd3e84f4c972152b032f9ae902
      
https://github.com/WebKit/WebKit/commit/dfd051863e0236fd3e84f4c972152b032f9ae902
  Author: Tyler Wilcock <[email protected]>
  Date:   2026-01-20 (Tue, 20 Jan 2026)

  Changed paths:
    A LayoutTests/accessibility/slot-aria-labelledby-expected.txt
    A LayoutTests/accessibility/slot-aria-labelledby.html
    R 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/accname/name/comp_host_language_label-expected.txt
    R 
LayoutTests/platform/gtk/imported/w3c/web-platform-tests/accname/name/comp_host_language_label-expected.txt
    M LayoutTests/resources/accessibility-helper.js
    M Source/WebCore/accessibility/AccessibilityNodeObject.cpp

  Log Message:
  -----------
  AX: Slot elements referenced with aria-labelledby not matching rendered output
https://bugs.webkit.org/show_bug.cgi?id=260772
rdar://114500560

Reviewed by Joshua Hoffman.

When a slot element is referenced by aria-labelledby, we should use
its assigned nodes for the accessible name, not the slot's fallback
content (children). Additionally, hidden assigned nodes (display:none)
should be excluded from the label calculation.

The fix:
1. Moves slot handling in accessibleNameForNode() to occur before
 textUnderElement(), which would otherwise return fallback content.
2. Adds a check to skip hidden assigned nodes.

Test: accessibility/slot-aria-labelledby.html

* LayoutTests/accessibility/slot-aria-labelledby-expected.txt: Added.
* LayoutTests/accessibility/slot-aria-labelledby.html: Added.
* LayoutTests/resources/accessibility-helper.js:
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textForLabelElements const):
(WebCore::accessibleNameForNode):

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



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

Reply via email to