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

Tentative: match new PR about 2E "unless the element is marked as presentational" #50002

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

Conversation

giacomo-petri
Copy link
Contributor

@giacomo-petri giacomo-petri commented Jan 9, 2025

Closes: web-platform-tests/interop-accessibility#167

Relates and match: w3c/aria#2405

Ambiguity: https://www.w3.org/TR/accname-1.2/#comp_host_language_label

This PR adds tests for:

  • elements receiving the accessible name from host language label elements (both explicit and implicit) with role="presentation";
  • elements with role=presentation that do not receive the accessible name from host language label elements (both explicit and implicit)
  • elements with role=presentation that receives the accessible name from host language label elements (both explicit and implicit) due to presentational roles conflict resolution

Note: since I created tests for acc name related to presentational roles conflict resolution, I have also included tests to verify that the computed role aligns with the expected result.

@giacomo-petri giacomo-petri changed the title input elements receiving the accessible name from label elements (both explicit and implicit) with role="presentation" Tentative: match new PR about 2E "unless the element is marked as presentational" Jan 11, 2025
@lolaodelola
Copy link

Hi @giacomo-petri, I'm coming from the review of PR 2405. This looks good to me for the most part, Scott's addressed some of the initial confusion. I noted some semantic confusion in the naming of the test sections vs what is being tested. While role="presentation" and role="none" do the same thing, it's confusing to have the test refer to testing role="none" on an input but the actual test setup has role="presentation" on the input. In most cases where you mention testing for none, you're testing for presentation, I didn't want to litter your inbox with every instance of this but I've noted two above.

Unless there's something I'm missing, the heading and test setup should match to avoid confusion for folks when reading.

Thank you for this work!

@giacomo-petri
Copy link
Contributor Author

Done

@lolaodelola
Copy link

Thanks @giacomo-petri! You have some lint errors, once you've addressed those I'll be happy to approve this.

@giacomo-petri
Copy link
Contributor Author

Thanks all:

  • replaced .ex with .ex-label (and added where missing)
  • replaced all role="presentation" with role="none"

Copy link
Contributor

@cookiecrook cookiecrook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates! Almost ready!

accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
wai-aria/role/role_none_conflict_resolution.tentative.html Outdated Show resolved Hide resolved
wai-aria/role/role_none_conflict_resolution.tentative.html Outdated Show resolved Hide resolved
giacomo-petri and others added 7 commits January 17, 2025 08:56
- added readonly testcases with and w/o disabled
- replaced [role none] witg [role=none] in data-testname
replaced role none with role=none
added cross reference comment
expectations moved from svg to circle
table fix (added THs and TDs)
@cookiecrook
Copy link
Contributor

Fix the lint errors and the bots will kick off another attempt to get that last CI result.

@giacomo-petri
Copy link
Contributor Author

Lint errors fixed!

accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
accname/name/comp_host_language_label.tentative.html Outdated Show resolved Hide resolved
Comment on lines 76 to 77
<table data-expectedlabel="caption" data-testname="html: table wrapping caption[role=none]" class="ex-label">
<caption role="none">caption</caption>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scottaohara Do you concur with this test expectation?

Copy link
Contributor

@cookiecrook cookiecrook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The label tests for invalidated role none should stay in this PR. Thanks for adding those comments.

However, any label test where the same element has an expected role of none should be removed from this PR entirely, and added to a new issue (keyword "blocked by testability") in the interop-accessibility repo. We can't commit these into WPT yet, because there is no reliable way to get a label from a non-existent accessibility object (role none/generic/etc). The test would be exposing implementation details, but not failures.

To my knowledge, no engines compute the label on a non-existent accessibility object... I think Chrome just returns the empty string when there is no backing object, but that's an implementation detail, not a test.

<fieldset role="none" data-expectedlabel="" data-testname="html: fieldset[role=none]>legend (role none set on fieldset affects fieldset acc name)" class="ex-label"><legend>legend</legend></fieldset>

<h2>HTML fieldset role="none" wrapping legend with role="none"</h2>
<fieldset role="none" data-expectedlabel="" data-testname="html: fieldset[role=none]>legend[role=none] (role none set on fieldset affects fieldset acc name)" class="ex-label"><legend role="none">legend</legend></fieldset>
Copy link
Contributor

@cookiecrook cookiecrook Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of the tests that should be moved to a new "blocked by testability" issue. You can't validly (yet) expect to be able to test computedlabel on an element with no role...

<fieldset data-expectedlabel="legend" data-testname="html: fieldset>legend[role=none] (role none set on legend doesn't affect fieldset acc name)" class="ex-label"><legend role="none">legend</legend></fieldset>

<h2>HTML fieldset with role="none" wrapping legend</h2>
<fieldset role="none" data-expectedlabel="" data-testname="html: fieldset[role=none]>legend (role none set on fieldset affects fieldset acc name)" class="ex-label"><legend>legend</legend></fieldset>
Copy link
Contributor

@cookiecrook cookiecrook Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of the tests that should be moved to a new "blocked by testability" issue. You can't validly (yet) expect to be able to test computedlabel on an element with no role...

</label>

<h2>HTML img with role="none" and non empty alt</h2>
<img src="https://www.w3.org/assets/logos/w3c/w3c-no-bars.svg" role="none" alt="w3c logo" data-expectedlabel="" data-testname="html: img[role=none][alt]:not([alt='']) (role none takes precedence over empty alt)" class="ex-label">
Copy link
Contributor

@cookiecrook cookiecrook Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of the tests that should be moved to a new "blocked by testability" issue. You can't validly (yet) expect to be able to test computedlabel on an element with no role...

<h3>HTML label encapsulation</h3>
<label>
<span>input label</span>
<input type="text" data-expectedlabel="" data-testname="html: label>input[role=none][disabled] (with label encapsulation, role none applied due to disabled input)" class="ex-label" role="none" disabled>
Copy link
Contributor

@cookiecrook cookiecrook Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of the tests that should be moved to a new "blocked by testability" issue. You can't validly (yet) expect to be able to test computedlabel on an element with no role...

</table>

<h2>HTML table with role="none" wrapping caption</h2>
<table role="none" data-expectedlabel="" data-testname="html: table[role=none]>caption (role none set on table affects fieldset acc name)" class="ex-label">
Copy link
Contributor

@cookiecrook cookiecrook Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of the tests that should be moved to a new "blocked by testability" issue. You can't validly (yet) expect to be able to test computedlabel on an element with no role...

</table>

<h2>HTML table role="none" wrapping caption with role="none"</h2>
<table role="none" data-expectedlabel="" data-testname="html: table[role=none]>caption[role=none] (role none set on table affects fieldset acc name)" class="ex-label">
Copy link
Contributor

@cookiecrook cookiecrook Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of the tests that should be moved to a new "blocked by testability" issue. You can't validly (yet) expect to be able to test computedlabel on an element with no role...

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

Successfully merging this pull request may close these issues.

Label element with role presentation and accname Host Language Label
4 participants