Description
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.