Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: Compute accessible names for hidden/hidden-but-referenced nodes #2294

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sideshowbarker
Copy link
Contributor

@sideshowbarker sideshowbarker commented Nov 12, 2024

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:

  • all 27 subtests in the comp_labelledby_hidden_nodes.html test
  • all 5 subtests in the comp_hidden_not_referenced.html test

Otherwise, 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

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.
@sideshowbarker sideshowbarker force-pushed the accname-name-comp_hidden_not_referenced branch from 6cac6d8 to ff18f72 Compare November 16, 2024 18:02
This change makes Ladybird 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.

Otherwise, without this change, Ladybird fails some of the WPT subtests
of the test at https://wpt.fyi/results/accname/name/comp_label.html.
@sideshowbarker sideshowbarker force-pushed the accname-name-comp_hidden_not_referenced branch from 862716e to 4c06624 Compare November 18, 2024 05:06
@ladybird-bot
Copy link
Collaborator

Hello!

One or more of the commit messages in this PR do not match the Ladybird code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants