-
Notifications
You must be signed in to change notification settings - Fork 344
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
Using aria-label on parent items in trees and menus is not necessary according to spec and Firefox implementation #395
Comments
The name calc does not say anything about excluding groups from the name from content. This is intentional as required by the spec. The bug is related to owned, not contained. |
@mcking65, thanks for looking into this. in my reading of the name calc it covers this case. Here's where: F.iii talks about accumulating text of children. However, to get to F.iii you have to pass through F, which says "Otherwise, if the current node's role allows "Name From: contents", or if the current node is referenced by aria-labelledby, aria-describedby, or is a native host language text alternative element:" Historical note: I actually wrote the initial draft of the name calc to match the initial ARIA implementation in Firefox. The specs, name calc and Firefox implementation were designed to handle this use case. And we had a tree example that took advantage of it. Also, what do you mean by, "The bug is related to owned, not contained." -- I didn't understand that bit. |
@aleventhal see related aria issue w3c/aria#538 and chrome bug https://bugs.chromium.org/p/chromium/issues/detail?id=702811 |
If stopping at a contained group when gathering content for a name is the intention, I like that. I need to read the algorithm again. |
Removed aria-label from menubar examples |
This commit fixes issue #395 for the treeview examples. It removes the `aria-label` attribute from parent `treeitem` elements in all four tree view example html files.
This commit resolves issue #395 for the menubar examples: 1. Removes aria-label from the parent menuitems 2. Updates roles, states, and properties documentation table
Per issue #395, made the following deletions from the menu and tree patterns. Removed following from menu pattern: > A parent menuitem has either aria-label or aria-labelledby set to specify a label. > Warning: parent menuitems missing a label are labeled by all child elements, > causing screen readers to announce every child menuitem and often making a menu so verbose that it is unusable. Removed the following from the treeview pattern: > Each element with role treeitem that serves as a parent node has either aria-label r aria-labelledby set to specify a label. > Warning: parent nodes missing a label are labeled by all child elements, > causing screen readers to announce every child and often making a tree so verbose that it is unusable.
@aleventhal, thank you for raising this issue. With the above listed commits, we have made appropriate updates to the menu and tree patterns and examples. Guidance to add aria-label to parent nodes is removed and the code is updated. |
Regarding this example:
https://rawgit.com/w3c/aria-practices/master/examples/treeview/treeview-1/treeview-1a.html
Quick version: the aria-label is extraneous and is hiding a bug in Chrome.
Long version:
The example says that using this tree allows the browser to compute the level, setsize and posinset automatically for you. However, this type of tree should also auto compute the treeitem names.
The treeitem names should be computed from descendants that have nameFrom: contents.
Indeed, if you take the aria-label attributes out, the example still works in Firefox, which gets the name calculation correct. However, in Chrome, there is a bug, and the name of tree items includes descendant treeitem text. The name calc is not supposed to walk into those descendants where nameFrom != contents. Therefore, anything inside the role="group" element is supposed to be ignored when computing the name.
Was the aria-label included to work around current user agent bugs?
The text was updated successfully, but these errors were encountered: