-
Notifications
You must be signed in to change notification settings - Fork 22
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
Updated spec text to reflect the processing of hidden elements when c… #137
Conversation
…omputing description to match intent as discussed.
I find this line very difficult to parse:
I tried rewriting it for clarity:
The last line isn't changed as part of this PR, but it could benefit from further clarification too. |
Referencing {{HTMLElement/innerText}} will reference innerText in the HTML spec |
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.
@accdc Assuming you accept my editorial change proposal of your prose, and @aleventhal's suggestion to simplify (keeping this step the same for both name and description), then I will float this proposal further with other WebKit engineers. The accessibility engineers have already reviewed, but there are more stakeholders wrt innerText.
Notes:
- Any remaining differences between the browser implementations of
innerText
should probably be addressed as separate issues. That's part of the value of this change. It replies on the HTML definition of intterText, rather than defining it in the ARIA spec. - I have not addressed the numbering issues (prose "step 2" and ID "step2B.ii.b") because those will be addressed in Permalinks in computations should NOT use specific numbering in the link (because the numbering will change) #139
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 like the change proposal didn't come through the first time.
FWIW, I removed my "approved" review, since I rewrote a significant portion of this change, but if we get two other reviewers, I think it looks okay. |
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 like there might be two places that we need to mention aria-label? There's another place that is adding the innerText language, but it doesn't mention aria-label yet.
Looks good with @cookiecrook 's change. |
I think it's just on Line 274. Where else are you seeing it? |
@jcsteh - can you please take a look at this |
Name/description calculation hurts my head. 🤯 Overall, I agree this simplifies things and makes sense for that reason. One thing that occurs to me: while the differences in output when descendants use different methods of hiding have been discussed, there will also be significant differences when the target node itself uses different methods of hiding. For example:
Button label will be "visible hidden"
Button label will be ""
Button label will be "visible" Currently, Firefox returns the same label for all of these: "visible hidden" That said, I guess this is pretty similar to the "maybe not what authors expect" situation for descendants and consensus seems to be that this is an acceptable compromise. I just thought it worth raising in case it hadn't been considered yet (and is worthy of separate consideration). |
We found something that might be a problem. In this example, only the display:none has an innerText, but I would have expected visibility:hidden innerText to remain intact.
Therefore, this PR will break labels where authors thought that visibility:hidden was an acceptable way to hide a label. |
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.
Removing my approval until we discuss the fact that visibilitity:hidden on the target of an aria-labelledby will lead to an empty name.
Thanks for the heads up. I'm not sure if it is possible to resurrect, we will need to talk it over at the next meeting. I may not be available for the one on the 16th due to a conflict though. |
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.
Would these changes fix the visibility:hidden issue - it uses the same text from HTML to determine if something is rendered so would only use innerText for those usages.
Co-authored-by: James Nurthen <[email protected]>
Co-authored-by: James Nurthen <[email protected]>
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 assume this change means that we still need to handle ARIA attributes, etc. in visibility: hidden targets of aria-labell/describedby? For example:
<div id="l3" hidden>l3</div>
<div id="label" style="visibility: hidden;">
l1
<span aria-hidden="hidden">l2</span>
<span aria-labelledby="l3"></span>
</div>
<button aria-labelledby="label"></button>
If I read this right, the expected label for the button is "l1 l3". in Firefox, that's tricky because visibility: hidden subtrees get removed from the a11y tree. That's not a new bug - we need to fix it to fully comply with the current spec too - but I wanted to clarify the intent here.
On the other hand, if you do this:
<div id="l3" hidden>l3</div>
<div id="label">
<span style="visibility: hidden;">
l1
<span aria-hidden="hidden">l2</span>
<span aria-labelledby="l3"></span>
</span>
</div>
<button aria-labelledby="label"></button>
If I read this right, the expected label for the button will be empty, since we don't differentiate "being rendered" from "hidden" except for direct targets of aria-labell/describedby.
Co-authored-by: James Teh <[email protected]>
@jcsteh I'm not sure if you are expressing a block/concern in there, or if you are just noting potential implementation complexity. |
Sorry. Allow me to clarify:
|
@jcsteh I believe your understanding is correct. The follow up change was proposed by @aleventhal to account for an authoring practice he anticipates may cause breakage if we used innerText without exception. I think both Aaron’s and Jamie’s points have merit, but they are at odds with each other. The HTML Priority of Constituencies urges us to regard Authors over Implementors in this scenario, but at what point does increased implementation complexity outweigh the perceived authoring benefit? Maybe a compromise can be reached. Perhaps this topic is worthy of more follow-up discussion at an upcoming ARIA meeting. Ideally, @accdc, @joanmarie, @jcsteh, and @aleventhal should attend. I’d like to be there too. |
This has been a very informative discussion, but I hope any final solution will error on the side of simplicity and making it easier for authors to understand of how to use |
Is this proposal dead now? |
As we spoke of earlier, I've attached an example that would need to be solvable by whatever we decide for this issue going forward. |
@aleventhal wrote:
No. From the ARIA call (last week IIRC?), we left this with Aaron to make a change suggestion on the PR that either didn't include innerText, or had some more exceptions to the innerText option. |
@aleventhal should this be closed now? |
Discussed in Feb 3 2022 call. Closing as overcome |
…omputing description to match intent as discussed.
Closes #57
Preview | Diff