Skip to content
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

Closed
aleventhal opened this issue May 7, 2017 · 6 comments
Labels
Example Page Related to a page containing an example implementation of a pattern Feedback Issue raised by or for collecting input from people outside APG task force Pattern Page Related to a page documenting a Pattern question Issue asking a question

Comments

@aleventhal
Copy link

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?

@mcking65
Copy link
Contributor

mcking65 commented May 8, 2017

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.

@aleventhal
Copy link
Author

aleventhal commented May 8, 2017

@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:"
A <div role="group"> is none of those things, because it is NameFrom: auth. Therefore it would pass over this step and not accumulate text from the group's children.

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.

@mcking65 mcking65 added this to the Jan 2017 Clean Up milestone May 8, 2017
@jnurthen
Copy link
Member

jnurthen commented May 8, 2017

@aleventhal see related aria issue w3c/aria#538 and chrome bug https://bugs.chromium.org/p/chromium/issues/detail?id=702811
I think your input would be very valuable in both of those.

@mcking65 mcking65 added Example Page Related to a page containing an example implementation of a pattern documentation Pattern Page Related to a page documenting a Pattern question Issue asking a question labels May 8, 2017
@mcking65
Copy link
Contributor

mcking65 commented May 8, 2017

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.

@jongund
Copy link
Contributor

jongund commented Jun 13, 2017

Removed aria-label from menubar examples

mcking65 pushed a commit that referenced this issue Jun 18, 2017
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.
mcking65 pushed a commit that referenced this issue Jun 18, 2017
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
mcking65 added a commit that referenced this issue Jun 18, 2017
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.
@mcking65
Copy link
Contributor

@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.

@mcking65 mcking65 changed the title Using aria-label in treeview-1a is not necessary according to spec and Firefox implementation Using aria-label on parent items in trees and menus is not necessary according to spec and Firefox implementation Jul 15, 2017
@mcking65 mcking65 added the Feedback Issue raised by or for collecting input from people outside APG task force label Jul 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Example Page Related to a page containing an example implementation of a pattern Feedback Issue raised by or for collecting input from people outside APG task force Pattern Page Related to a page documenting a Pattern question Issue asking a question
Development

No branches or pull requests

4 participants