-
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
aria-controls should only point to visible elements #531
Comments
@LJWatson, @MichielBijl, First of all, hidden elements are in the DOM. They may not be in the AX tree in some APIs, but they are definitely in the DOM and idrefs to hidden elements are valid. For good reason, To address @LJWatson's concern, you could either place some additional requirements on the browser regarding what is in the AX tree for aria-controls. Or, or you could very reasonably expect assistive technology developers to avoid providing a function that attempts to helpp users read something they cannot perceive. I vote for NO CHANGE on this. |
What is the purpose of aria-controls pointing to something that can't be navigated to? The attribute is intended to establish a relationship between two things. Those things may be far apart in the DOM, so it is logical that an implementation of aria-controls in a screen reader would provide a way to navigate from the control to the controlled element (as the only known screen reader implementation in fact does). If it is not possible to navigate to the controlled element, this breaks the user interaction completely. I don't think it's unreasonable for developers to sync aria-controls with the visibility of the controlled element. This simple demo does it in a single line of JavaScript. |
Regarding @LJWatson's question:
The specific use case from @MichielBijl's tab example (which would also exist in many other widgets) is that the controlling relationship is about revealing/hiding the linked content. How would you expect that to be indicated, if aria-controls can't point to the element until after it is revealed? I'm assuming that the expanded/collapsed state or toggle button state is indicated by other aria properties. Would it make sense to add The only structure that I could see that makes sense is if |
@LJWatson commented:
I am not sure that the primary purpose is assistive technology navigation; it is expressing the relationship for the benefit of forming an accessibility tree. If assistive technologies wish to piggy-back a navigation function on to the relationship, they can certainly do so. However, they should use common sense when doing so. For example, the relationship between a listbox controlled by a text field that has @LJWatson commented:
Agree. So, it is not logical for an assistive technology to suggest that you can navigate to a hidden element. The fact that one assistive technology has chosen to do so is somewhat bizarre. I think it is just a screen reader bug stemming from a simple oversight.
It is more authoring work with literally no useful purpose. In isolation, and in simple cases, it is certainly trivial. But, it does not live in isolation and it is not always so trivial. Every unnecesary authoring complexity is another nudge in the direction of making accessibility more difficult and expensive. Removing the relationship also removes information that can be useful when doing static analysis of code to verify correct implementation. |
An element's visibility and presence in the DOM are not synonymous. Something can be in the DOM and not be visible, as @mcking65 noted. A relevant case is the On the other hand, it's an author error when @LJWatson's demo hides the controlled object by not adding it to the DOM. Furthermore, the The possibilities are:
|
It seems that this is heading in a “don’t change a thing” direction. For what it’s worth, @LJWatson and I did discuss I did made two examples of the tabs widget during dinner where Tabs With Automatic Activation (roaming Note: these will be removed once this issue is closed. |
I wrote:
Addendum: even if an author does not fix the error, browsers will not expose the controller-for/controlled-by relationship in the accessibility tree, because, well, there is nothing to expose. In constructing the accessibility tree, the browser will attempt to follow the (bogus) |
@asurkov, @aleventhal, @minorninth, @cookiecrook, @melanierichards, Would it be reasonable to add a browser requirement to expose aria-controls in the accessibility tree only when the referenced element is visible? |
If there's a tree in the forest but nobody can perceive it, does it exist? At my work we were mulling around what possible use When newly-revealed stuff turns out to be far away from a control, some kind of navigation system sounds sensible. But it sounds like that's not even this thing's purpose in life. |
@Stommpoes:
|
Closing this and moving aria-controls discussion to #995 |
Implementing the second possibility, that seems very reasonable specially using angular ngIf conditional to show/hide listbox, it is still getting error as some tools as Siteimprove chrome plugin says that is like an missing or invalid aria-controls to the role=combobox element.
|
@adcortes According to https://www.w3.org/WAI/standards-guidelines/act/rules/5c01ea/proposed/#passed-example-7 aria-controls without value is the right solution. I'm not sure that's true. The document is currently under review |
There is currently nothing in the spec[1] that prevents
aria-controls
from pointing to something that is hidden. Léonie said on Twitter:Should
aria-controls
therefore be limited to elements that are visible?[1] ARIA 1.1 specification
The text was updated successfully, but these errors were encountered: