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 uses incorrect mapping for html element #571

Open
aleventhal opened this issue Dec 13, 2024 · 1 comment
Open

html-aam uses incorrect mapping for html element #571

aleventhal opened this issue Dec 13, 2024 · 1 comment

Comments

@aleventhal
Copy link
Collaborator

Was asked this in chat by sideshowbarker:

So I’m noticing that for the html element, Safari and Chrome don’t compute and expose a role for it — and as far as inclusion in the accessibility tree, they ignore it (don’t actually even include in the accessibility tree).
That intuitively to me seems like the right behavior — but I’m not sure how to reconcile it with the spec requirements. I mean, given that at https://w3c.github.io/html-aam/#el-html, the HTML-AAM spec says states that it has the implicit role document.
Thinking about it with respect to user experience for AT users, I guess I don’t understand what the point would be in having any role for the html element, nor for exposing it to the accessibility tree.

The HTML-AAM is wrong here. the #document node, which is not an element at all, but a parent node of the <html> element, is the node that gets the document role.

The #document node is different from the documentElement, and is used for the root <html> element. We only expose it if the author does something that would force us to, such as put tabindex, or aria-live, a role, etc. (obviously not recommended).
In that case, internally for Chrome it would get the role=generic treatment unless overridden by the role attribute.

It seems people get confused all the time that there is a #document node and a documentElement, and that they are different.

@scottaohara
Copy link
Member

yeah.... the spec previously said that body had the document role. here's where the discussion happened to say html had the document role - though we understood that was necessarily 100% accurate - #330

can change this further / add a comment to the html mapping to further clarify that while it's the top most element it is not really the "document" either

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

2 participants