-
Notifications
You must be signed in to change notification settings - Fork 133
Clarify relationship between aria-hidden
and aria-owns
#1839
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
base: main
Are you sure you want to change the base?
Conversation
Two points to mention: I'm encountering a problem similar to #1818 but the other way around, and I'm not sure this PR fully handles it 🤔 The case in #1818 was: <ul aria-owns="li"></ul>
<div aria-hidden="true">
<li id="li">Child node</li>
</div> That is, a not-hidden element What happens in the reverse case: <div aria-hidden="true">
<div id="owner" aria-owns="li" />
</div>
<ul> <li id="li">Item</li> </ul> In that case, a hidden element Second point is that the language in §7.1 Excluding Elements from the Accessibility Tree uses a lot of "descendant" and other tree-related wording, notably for the case concerning this PR:
Should there be a precision that "descendants" here mean "either descendant in the DOM tree, or descendant in the accessibility tree where |
For the second point: #1150 |
Mmm, thanks for poking at this, @Jym77. I hadn’t considered that reverse case. “Owning element” is currently defined as “any DOM ancestor of the element, or any element with an In this reverse scenario, |
@adampage That actually makes sense 😄 <div aria-hidden="true" aria-owns="li"></div>
<ul> <li id="li">Item</li> </ul> In that case, the current behaviour is to expose I guess it's a bit of a question which of Can get weirder with a case like: <div aria-hidden="true" aria-owns="foo"></div>
<div id="foo" aria-owns="bar"></div>
<div id="bar"></div> Now, |
This discussion has been super helpful, @Jym77, thank you. 😁 I think you hit the nail on the head with the question of which attribute “acts faster”. Let’s say that this PR now includes some additional text (somewhere appropriate in the spec) to the effect of: “Changes to ownership are resolved in DOM order. If both Now let’s apply that to the four scenarios that have come up. In the initial #1818 example: <ul aria-owns="li"></ul>
<div aria-hidden="true">
<li id="li">Child node</li>
</div> ...the In the reverse case: <div aria-hidden="true">
<div id="owner" aria-owns="li" />
</div>
<ul> <li id="li">Item</li> </ul> ... In the follow-up simplified case: <div aria-hidden="true" aria-owns="li"></div>
<ul> <li id="li">Item</li> </ul> ... In the follow-up weirder case: <div aria-hidden="true" aria-owns="foo"></div>
<div id="foo" aria-owns="bar"></div>
<div id="bar"></div> ...the previous story is essentially true again. The original intention of this spec clarification was to align with the current Chrome & Firefox behavior, so I built out all four of these scenarios in Codepen and tested them with macOS + VoiceOver + Chrome. Each outcome I described above is correctly demonstrated by that AT combo. Whew. Having said all that, would you agree that the gist of my additional spec proposal is helpful & accurate? And that it would reasonably lead to the interpretations I described for each of those four scenarios? Are there yet other ambiguous scenarios lurking out there? 😅 Thanks again! |
Yes, I think that clarification works. Maybe we need to add that change of ownership is only initiated by non-hidden node (that's more or less the second sentence but making it clear that one should stop looking for This also makes it clear that Great clarification 👍 |
was following along with this until:
this statement has made me wonder if this actually makes sense or not. since display none does modify the a11y tree... and then i'm not sure what case 2 refers to? the second of Adam's examples in his last comment, or the second odd case you brought up, @Jym77 ? |
Yep, poor writing on my side 🙈 and messing up things badly… <ul aria-owns="li"></ul>
<div style="display: none">
<li id="li">Child node</li>
</div> case 1 not 2 in Adam's list with This does not expose That is of course linked to non-interference with the host language ( |
Thanks for the correction/clarification. Yah that makes sense again now. |
3ddc773
to
4d5c3a6
Compare
This reverts commit a3dc2a9.
So, I reacquainted myself with the spec’s definition of “hidden”:
Based on that, I took another pass at the Beyond that, I wordsmithed the clarifications we discussed earlier in this thread and added them to the |
I feel there is still a small clarification needed to say that Owning element states:
Because of the "or", and no mention of unicity, in case 1 above <ul aria-owns="li"></ul>
<div aria-hidden="true">
<li id="li">Child node</li>
</div> Both the So, without disambiguating that, the Should we change the definition of "owning element" to state something like
Otherwise, I think this is correct and expresses what is needed 👍 |
I just want to note that @Jym77's recommended definition of owned is nice, and, that there is also a 1.3-blocking issue related to inconsistent use the term "owned by", just like how hidden was just revisited: The "owned by inconsistencies" can be addressed before of after this PR, but it might also lead to a term change or term update. |
Heya @cookiecrook, I just turned all of these tests into comparable (I hope) WPT tests: PR #44822. Using your latest tip, I’ve marked that file as I’d be grateful for your thoughts on my approach for testing this spec change within WPT’s capabilities. My original Codepen tests weren’t accname-focused; I just rendered a bunch of With WPT, I chose to use the test driver’s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good now, except for the switch from "accessibility parents" to "accessibility ancestors"! I'll mark as approving once that is done :)
Thanks, @spectranaut. I’ve swapped in “accessibility ancestors” for “accessibility parents” and resolved the merge conflict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
✅ Deploy Preview for wai-aria ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@scottaohara and @cookiecrook -- this is another oldie that I think we can land soon. You both have taken a look and provided feedback and Adam responded, can you take another review? |
Heya @cookiecrook / @scottaohara, could I trouble you for a review of this oldie-but-goodie? I also recently overhauled a supporting WPT test: web-platform-tests/wpt#44822, with these latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with everything that's been added for this PR, but I would like the example I created merged in as well.
Co-authored-by: Scott O'Hara <[email protected]>
Thanks very much, @scottaohara! I committed your example and then made a couple follow-on editorial tweaks. Does this read okay to you?:
|
i'm going to approve as is - but i don't think "also" needed to be added. that made me initially think that the sentence was trying to say that the element that was attempting to be reparented was hidden from the a11y tree - and it made me go back to look if that had been changed |
Updated. Thank you, @scottaohara. 🙏🏻 |
Tentatively labeling this "waiting for implementations" since the thread on WPT leaves me wondering if implementation work is needed after all. Please correct me if I'm getting it wrong (e.g., merge the PR). |
Closes #1818.
The definition of Owning Element is already inclusive of both DOM ancestry and ownership via
aria-owns
:Because of this, I’m thinking it’ll be sufficient to swap out “ancestors” for “owning elements” in
aria-hidden
’s description.I also editorially removed what I believe is an unhelpful comma.
Test, Documentation and Implementation tracking
Once this PR has been reviewed and has consensus from the working group, tests should be written and issues should be opened on browsers. Add N/A and check when not applicable.
aria-owns
and hiding techniques in assorted scenarios web-platform-tests/wpt#44822Preview | Diff