LibWeb: Compute accessible names for hidden/hidden-but-referenced nodes #2294
+501
−34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change implements full support for the “A. Hidden Not Referenced” step at https://w3c.github.io/accname/#step2A in the “Accessible Name and Description Computation” spec — including handling all hidden nodes that must be ignored, as well as handling hidden nodes that, for the purposes of accessible-name computation, must not be ignored (due to having
aria-labelledby
/aria-describedby
references from other nodes).Otherwise, without this change, not all cases of hidden nodes get ignored as expected, while cases of nodes that are hidden but that have
aria-labelledby
/aria-describedby
references from other nodes get unexpectedly ignored.For the tests at https://wpt.fyi/results/accname/name?product=ladybird, this change gets us passing:
comp_labelledby_hidden_nodes.html
testcomp_hidden_not_referenced.html
testOtherwise, without this change, we fail all those tests.
Additionally, a separate commit here makes us give the value of the aria-label attribute the correct precedence for accessible-name computation required by the “Accessible Name and Description Computation” and HTML-AAM specs and by the corresponding WPT tests.
That gets us passing all 131 subtests in the
comp_label.html
test at https://wpt.fyi/results/accname/name?product=ladybird