[webkit-changes] [WebKit/WebKit] daa59c: AX: Slot elements referenced with aria-labelledby ...
Tyler Wilcock
noreply at github.com
Wed May 3 12:49:02 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: daa59c39a53b2e66aebea278503cb589fc3d9f47
https://github.com/WebKit/WebKit/commit/daa59c39a53b2e66aebea278503cb589fc3d9f47
Author: Tyler Wilcock <tyler_w at apple.com>
Date: 2023-05-03 (Wed, 03 May 2023)
Changed paths:
A LayoutTests/accessibility/aria-labelledby-targeting-slot-expected.txt
A LayoutTests/accessibility/aria-labelledby-targeting-slot.html
M LayoutTests/platform/ios/TestExpectations
M Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Log Message:
-----------
AX: Slot elements referenced with aria-labelledby have no label
https://bugs.webkit.org/show_bug.cgi?id=254934
rdar://problem/107570512
Reviewed by Chris Fleizach.
With this patch, when a slot is the target of aria-labelledby, we should (and now do)
gather the accessible text of the nodes assigned to the slot.
This patch also fixes a bug in our accessible name computation where
AccessibilityNodeObject::accessibleNameForNode didn't collect the text from a TextNode
as stated here:
https://www.w3.org/TR/accname-1.2/#mapping_additional_nd_te
> G. Otherwise, if the current node is a Text node, return its textual contents.
Prior to this patch, AccessibilityNodeObject::accessibleNameForNode would bail early
if the given node was not an element (and text nodes are not elements).
Without also fixing this bug, we would not behave correctly in the basic added testcase.
* LayoutTests/accessibility/aria-labelledby-targeting-slot-expected.txt: Added.
* LayoutTests/accessibility/aria-labelledby-targeting-slot.html: Added.
* LayoutTests/platform/ios/TestExpectations: Enable new test.
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::accessibleNameForNode):
Canonical link: https://commits.webkit.org/263644@main
More information about the webkit-changes
mailing list