-
Notifications
You must be signed in to change notification settings - Fork 125
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
Does aria-hidden obey DOM or AX tree ancestors? #1714
Comments
Note that there is a Chrome CL out for review that depends on getting an answer to this (hopefully soon): |
been thinking about this for the last half hour or so, and i think i agree that this is correct – that i'm just trying to think if there may be any sort of responsive layout gotcha that i'm just not thinking of.... where some component is cobbled together via an |
Also, we should check to see if Firefox/Chrome/Safari all act the same. And, "ancestor" should go into important terms. We should make sure it always means the same thing throughout the doc. |
Added to https://github.com/w3c/aria/projects/16 since that seems like a good fit. |
We discussed having a test case to see how hidden for the parent is currently handled across all the browsers/platforms, does this capture all the scenarios you wanted clarification on, @aleventhal? About the browsers:
|
Thanks @spectranaut, the test case is good. Regarding Chrome, I'm testing here on Canary/Mac, and here's what I see:
Is this what you're seeing? I wasn't sure what your comment was saying, because "children" is slightly ambiguous. Also, I was surprised to learn Safari does not implement aria-owns, To be fair, getting it right has been an absolute nightmare. Very long tail of edge cases and bugs. |
I think it should obey the accessibility hierarchy, since it's an accessibility property. |
Following up from the discussion in the meeting today It seems that the consensus is that @cookiecrook, what is the priority of |
I'm really confused. In Chrome Canary on Windows, just as was noted in #1714 (comment), I'm seeing all the owned nodes in the test case; none of them are hidden. The behaviour seems identical to Firefox. I guess I follow the argument that aria-hidden is an accessibility property, so it should impact other accessibility properties. On the other hand, aria-hidden effectively removes the subtree from the a11y tree altogether. It could be interpreted that aria-hidden causes a subtree to be ignored, so we should also ignore any properties set anywhere in that subtree. From an implementation standpoint, in Firefox, we actually remove aria-hidden subtrees altogether internally. If the subtree doesn't exist, we can't respect properties set on nodes inside that subtree. Fixing that would probably require that we internally render the a11y tree for aria-hidden but not expose it to clients, which seems to be what Chrome does. That's a pretty massive change for us. If that's where we need to go, I can look into the feasibility of that... but at this point, Chrome doesn't seem to be handling this anyway. |
I can buy that. Makes things simpler to keep the same as that argument
works. We should clarify in the spec.
…On Thu, May 26, 2022, 9:01 PM James Teh ***@***.***> wrote:
I'm really confused. In Chrome Canary on Windows, just as was noted in #1714
(comment)
<#1714 (comment)>, I'm
seeing all the owned nodes in the test case; none of them are hidden. The
behaviour seems identical to Firefox.
I guess I follow the argument that aria-hidden is an accessibility
property, so it should impact other accessibility properties. On the other
hand, aria-hidden effectively removes the subtree from the a11y tree
altogether. It could be interpreted that aria-hidden causes a subtree to be
ignored, so we should also ignore any properties set anywhere in that
subtree.
From an implementation standpoint, in Firefox, we actually remove
aria-hidden subtrees altogether internally. If the subtree doesn't exist,
we can't respect properties set on nodes inside that subtree. Fixing that
would probably require that we internally render the a11y tree for
aria-hidden but not expose it to clients, which seems to be what Chrome
does. That's a pretty massive change for us. If that's where we need to go,
I can look into the feasibility of that... but at this point, Chrome
doesn't seem to be handling this anyway.
—
Reply to this email directly, view it on GitHub
<#1714 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKQAZS6SDLWOVWPNZDE27TVMANGJANCNFSM5RRLM6KA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@jcsteh Did you look at the accessibility tree? In the Chrome accessibility tree "child c" is missing, and in the Firefox accessibility tree "child c" exists. Though I do see your reasoning, and we will revisit in the ARIA working group meeting today! |
What is the use case for putting aria-owns and aria-hidden on the same element? Is this primarily an author error, and we're talking about a repair strategy, or is it an author intent that needs to be expressed? Are there performance trade-offs for not pruning aria-hidden elements before doing other accessibility tree calculations? If so, does the use-case outweigh them? Does having a spec inconsistency outweigh them? |
Its not just the same element we need to consider - aria-owns could end up being on a child of the hidden element. |
Yes.
For me, in latest Chrome Canary, it is definitely present:
|
I would have thought aria-hidden propagated down the DOM tree (not the AX tree like Chrome) but I don't have a strong opinion on the cases where aria-owns blurs that boundary. @spectranaut wrote:
@aleventhal wrote:
These comments (and more from the IRC thread) seem demonstrably incorrect. There is implementation of aria-owns in WebKit on Mac and iOS, but it creates a reference from the owning element to the owned element (AXOwns: AXElementRef, IIRC on Mac), rather than reordering the tree. IIRC, all the original browser implementations of aria-owns all did this, because of implementation concerns. I don't know enough about Chromium's changes to know where Chrome versus WebKit is no longer in alignment on aria-owns, or if reordering the tree is now possible in all implementations, if that's what is being suggested here. |
Much of the WebKit implementation of aria-owns was from 2010. I do see a source update from as recently as January of this year. |
It's the reordering / 'expected' behavior that doesn't appear to be implemented in Safari. an example: https://codepen.io/scottohara/pen/VwQdyRN with latest macOS/iOS Safari, VoiceOver only treats the tablist as if it has 1 tab within, though the second tab is referenced by aria-owns. VoiceOver with Chrome and Firefox however both treat that second tab as if it was within the tablist, and if using VO navigation, the second tab is in the reading order after the first tab and before the paragraph of content with these browsers. |
Wow @jcsteh thanks you are right, chrome doesn't implement propagating aria-hidden through Also thanks for the history/context on aria-owns in webkit, @cookiecrook ! |
@cookiecrook I'd still like to get your thoughts on Scott's comment. This comes up a lot. |
@aleventhal wrote:
Discussed in the call this morning and raised https://webkit.org/b/241694 |
I wrote up a doc describing how Blink handles aria-owns, and while looking at Chrome's code, I realized that we handle the aria-hidden issue described here pretty well. |
We discussed this in a meeting a few weeks back and ultimately agreed with @jcsteh: https://www.w3.org/2022/06/09-aria-minutes#t05 In conclusion, aria-hidden obeys DOM ancestor only. In other words, There is no change to implementations for this. However, the work to do now is add the ability within the spec to differential between "DOM hierarchy" and "AX hierarchy", and make sure that hidden definition uses the correct language to indicate "DOM hierarchy": https://w3c.github.io/aria/#dfn-hidden @smhigley or @pkra, do you think the work in this issue will clarify this difference? #1150 If ancestor and hierarchy ultimately always refer to the accessibility tree, then we might want to consider Aaron's suggestion:
|
Spec says: "An element is considered hidden if it, or any of its ancestors are not rendered or have their aria-hidden attribute value set to true."
In Chrome, aria-hidden propagates down the AX tree, meaning that it follows aria-owns relationships.
Therefore, something might not be a DOM ancestor of something aria-hidden, but still become aria-hidden because it's within the AX hierarchy. This differs from using CSS to hide subtree (e.g. display:none), which only follows the DOM hierarchy.
Is Chrome correct? The spec refers to "ancestors", but I did not see ancestors defined in the "Important Terms" section: https://w3c.github.io/aria/#terms
The text was updated successfully, but these errors were encountered: