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

Fix accessible-name computation for table, fieldset, image input elements, and for “encapsulation” cases #2438

Merged

Conversation

sideshowbarker
Copy link
Contributor

@sideshowbarker sideshowbarker commented Nov 19, 2024

This PR branch contains three commits:

  • e85812a LibWeb: Fix accessible-name computation for “encapsulation” cases

    This change makes Ladybird correctly handle all “encapsulation” tests in the https://wpt.fyi/results/accname/name/comp_host_language_label.html set of tests in WPT.

    Those all test the requirement that when computing the accessible name for a <label>-ed form control, then any content (text content or attribute values) from the control itself that would otherwise be included in the accessible-name computation for it ancestor <label> must instead be skipped and not included.

    The HTML-AAM spec seems to try to achieve that result by expressing specific steps for each particular type of form control. But what all that reduces/optimizes/simplifies down to is just, “skip over self”.

    Otherwise, without this change, Ladybird includes that “self” content from those “encapsulated” elements when doing accessible-name computation for the elements — which results in AT users hearing unexpected extra content in the accessible names for those elements.

    This change causes Ladybird to pass an additional 6 subtests in the comp_host_language_label.html set of tests at https://wpt.fyi/results/accname/name?product=ladybird.

  • 20375dd LibWeb: Fix input@type=button|submit|reset accessible-name computation

    This change makes Ladybird conform to the requirements in the HTML-AAM spec at https://w3c.github.io/html-aam/#accname-computation for the cases of HTML input@type=button, input@type=submit, and input@type=reset elements. Otherwise, without this change, Ladybird fails to expose the expected accessible names for those cases.

    This change causes Ladybird to pass an additional 3 subtests in the comp_host_language_label.html set of tests at https://wpt.fyi/results/accname/name?product=ladybird.

  • 48c639b LibWeb: Fix accessible-name computation for table, fieldset, image input

    This change makes Ladybird conform to the requirements in the HTML-AAM spec at https://w3c.github.io/html-aam/#accname-computation for the cases of HTML <table>, <fieldset>, and <input type=image> elements. Otherwise, without this change, Ladybird fails to expose the expected accessible names for those cases.

    This change causes Ladybird to pass an additional 4 subtests in the comp_host_language_label.html set of tests at https://wpt.fyi/results/accname/name?product=ladybird.

So these two changes together cause Ladybird to pass all 78 tests in the comp_host_language_label.html set of tests at https://wpt.fyi/results/accname/name?product=ladybird.

@sideshowbarker sideshowbarker force-pushed the accname-comp_host_language_label branch 3 times, most recently from 7883aa3 to e85812a Compare November 19, 2024 20:44
@tcl3
Copy link
Member

tcl3 commented Nov 19, 2024

This has conflicts.

@sideshowbarker sideshowbarker force-pushed the accname-comp_host_language_label branch from e85812a to d508d0c Compare November 19, 2024 21:55
@sideshowbarker
Copy link
Contributor Author

This has conflicts.

Thanks for the heads-up — fixed now ✅

@sideshowbarker sideshowbarker force-pushed the accname-comp_host_language_label branch 2 times, most recently from 9281014 to 6c5cfdf Compare November 21, 2024 15:52
Libraries/LibWeb/DOM/Node.cpp Outdated Show resolved Hide resolved
This change makes Ladybird conform to the requirements in the HTML-AAM
spec at https://w3c.github.io/html-aam/#accname-computation for the
cases of HTML table, fieldset, and input@type=image elements. Otherwise,
without this change, Ladybird fails to expose the expected accessible
names for those cases.
This change makes Ladybird conform to the requirements in the HTML-AAM
spec at https://w3c.github.io/html-aam/#accname-computation for the
cases of HTML input@type=button, input@type=submit, and input@type=reset
elements. Otherwise, without this change, Ladybird fails to expose the
expected accessible names for those cases.
This change makes Ladybird correctly handle all “encapsulation” tests in
the https://wpt.fyi/results/accname/name/comp_host_language_label.html
set of tests in WPT.

Those all test the requirement that when computing the accessible name
for a <label>-ed form control, then any content (text content or
attribute values) from the control itself that would otherwise be
included in the accessible-name computation for it ancestor <label> must
instead be skipped and not included.

The HTML-AAM spec seems to try to achieve that result by expressing
specific steps for each particular type of form control. But what all
that reduces/optimizes/simplifies down to is just, “skip over self”.

Otherwise, without this change, Ladybird includes that “self” content
from those “encapsulated” elements when doing accessible-name
computation for the elements — which results in AT users hearing
unexpected extra content in the accessible names for those elements.
@sideshowbarker sideshowbarker force-pushed the accname-comp_host_language_label branch from 6c5cfdf to b9897f1 Compare November 25, 2024 09:24
@gmta gmta merged commit db29d24 into LadybirdBrowser:master Nov 25, 2024
6 checks passed
@sideshowbarker sideshowbarker deleted the accname-comp_host_language_label branch November 25, 2024 11:40
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.

3 participants