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

Write tests for role="presentation"/"none" treatment for required children #108

Open
rahimabdi opened this issue Feb 21, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@rahimabdi
Copy link

rahimabdi commented Feb 21, 2024

The ARIA spec states the following in Presentational Role Inheritance:

When an explicit or inherited role of none/presentation is applied to an element with the implicit semantic of a WAI-ARIA role that has Allowed Accessibility Child Roles, in addition to the element with the explicit role of none/presentation, the user agent MUST apply an inherited role of none to any accessibility descendants that do not have an explicit role defined. Also, when an explicit or inherited role of none/presentation is applied to a host language element which has specifically allowed children as defined by the host language specification, in addition to the element with the explicit role of none/presentation, the user agent MUST apply an inherited role of none to any specifically allowed children that do not have an explicit role defined.

...

For any element with an explicit or inherited role of none/presentation and which is not focusable, user agents MUST ignore role-specific WAI-ARIA states and properties for that element. For example, in HTML, a ul or ol element with a role of none/presentation will have the implicit native semantics of its li elements removed because the list role to which the ul or ol corresponds has an Allowed Accessibility Child Role of listitem. Likewise, the implicit native semantics of an HTML table element's thead/tbody/tfoot/tr/th/td descendants will also be removed, because the HTML specification indicates that these are required structural descendants of the table element.

If we haven't yet, we should write tests for this; specifically, to ensure that required children descendants of an element with presentation/role inherit properly from their parent element's role. For example, in this code snippet, the children <li> elements should also be rendered presentational:

<ul role="presentation"> <!--Should be the same for role="none"-->
    <li>item 1</li>
    <li>item 1</li>
</ul>

I believe the contextual roles WPT test should provide most of the needed test cases.

@cookiecrook I was unable to find any existing tests for this but if we don't have them, where would you suggest they reside?

@rahimabdi rahimabdi added the good first issue Good for newcomers label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant