Bug 1858046: Ignore aria-label, aria-labelledby for slot elements, r=Jamie

This revision modifies LocalAccessible::ARIAName such that it avoids checking
aria-label or aria-labelledby for HTML slot elements. Gecko should ignore these
attributes in name computation for slots. This revision also removes the
expected failure designations for relevant web platform tests.

Differential Revision: https://phabricator.services.mozilla.com/D203677
This commit is contained in:
Nathan LaPre 2024-03-06 21:38:38 +00:00
parent 273d54d13d
commit 26c564ffad
2 changed files with 4 additions and 6 deletions

View file

@ -2548,6 +2548,10 @@ void LocalAccessible::Shutdown() {
// LocalAccessible protected
void LocalAccessible::ARIAName(nsString& aName) const {
// 'slot' elements should ignore aria-label and aria-labelledby.
if (mContent->IsHTMLElement(nsGkAtoms::slot)) {
return;
}
// aria-labelledby now takes precedence over aria-label
nsresult rv = nsTextEquivUtils::GetTextEquivFromIDRefs(
this, nsGkAtoms::aria_labelledby, aName);

View file

@ -1,6 +0,0 @@
[slot.html]
[aria-labelledby reference to element with slotted text content and aria-label on slot]
expected: FAIL
[aria-labelledby reference to element with default slotted text content and aria-label on slot]
expected: FAIL