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

[html-aam] Computing a role for a “aside” or “section” element creates an infinite loop #570

Open
sideshowbarker opened this issue Dec 5, 2024 · 3 comments
Assignees

Comments

@sideshowbarker
Copy link

sideshowbarker commented Dec 5, 2024

Consider these two things:

A. Computing a role for an aside or section element. The conditions at https://w3c.github.io/html-aam/#el-aside and https://w3c.github.io/html-aam/#el-section for computing a role for an aside element or section element in turn require computing an accessible name for the aside element or section element.

B. Computing an accessible name for an element. Multiple steps in the algorithm at https://w3c.github.io/accname/#computation-steps for computing an accessible name for an element in turn require computing a role for that element.

That is: In order to implement A. Computing a role for an aside or section element in my code, I need to have that code call my implementation of B. Computing an accessible name for an element. But in order to implement B. Computing an accessible name for an element in my code, I need to have that code call my implementation of A. Computing a role for an aside or section element.

In other words, my code gets into an infinite loop if I implement the requirements as specified.

See also Siteimprove/alfa#298

Link to documentation: https://w3c.github.io/html-aam/#el-aside

Does the issue exists in the editors draft is the most recent draft of the specification? Yes

@sideshowbarker sideshowbarker changed the title [html-aam] Computing a role for the “aside” element creates an infinite loop [html-aam] Computing a role for a “aside” or “section” element creates an infinite loop Dec 5, 2024
@smockle
Copy link

smockle commented Dec 5, 2024

B.…computing an accessible name for an element in turn require computing a role for that element.

aside has either a complementary or generic role. Since generic can’t be named, when checking whether aside has an accessible name, its role can be assumed to be complementary, right? By assuming that, actual role computation would be unnecessary, avoiding the infinite loop.

@scottaohara
Copy link
Member

would this make more sense if the spec indicated the default roles to be complementary / region - and THEN have a condition to change those roles based on ancestral checks (for aside) or if the elements are named (for both elements) - rather than separating these out so the elements each had two tables?

@annevk
Copy link
Member

annevk commented Dec 5, 2024

I think you should resolve the loop in the algorithms somehow. E.g., give "computing an accessible name" a boolean that indicates it's invoked for role computing purposes in which case it uses fallback roles for certain elements might do the trick?

@jnurthen jnurthen transferred this issue from w3c/aria Dec 5, 2024
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

No branches or pull requests

4 participants