Several accessibility issues were identified in the new toolbar. Mostly these boil down to insufficient semantic data. More details are available in #6.
1) It is more semantic to use <nav>
than <div>
, thus better for screen readers and other AT.
2) If the variable tray.label exists, then it should appear as an ARIA label. Either way the list of tray.links should be be properly structured within a <nav>
element.
3) Proper ARIA Roles should be used with grouped menus.
These are the known accessibility issues with the responsive toolbar.
---- Original ----
Accessibility issues need to be outlined in this issue as they are surfaced. We can either address them in a single patch, if possible, or create sub-issues for larger changes as appropriate.
Comment | File | Size | Author |
---|---|---|---|
#32 | Screen Shot 2014-07-21 at 9.26.03 AM.png | 548.71 KB | mgifford |
#31 | toolbar-aria-roles.patch | 2.12 KB | falcon03 |
#29 | 1800614-29.patch | 2.1 KB | LinL |
#27 | responsive-toolbar-aria.png | 335.38 KB | mgifford |
#26 | toolbar_26.patch | 2.06 KB | mgifford |
Comments
Comment #1
Everett Zufelt CreditAttribution: Everett Zufelt commentedCan I get a demo please.
Comment #2
jessebeach CreditAttribution: jessebeach commentedSurely. Here is the info.
Site: http://toolbar.qemistry.us/
user: toolbar_tester
password: uS8593!k
Comment #3
Everett Zufelt CreditAttribution: Everett Zufelt commented- I had to navigate to the bottom of the page to find the toolbar, past the Powered by Drupal. If I wasn't looking I wouldn't have found it.
- There is a "Menu button" with no label that seems to do nothing when clicked
- There are a lot of actions, in different lists, and it is difficult to distinguish what I might find where.
JAWS reads:
Comment #4
webchickMarking this as postponed on #1137920: Fix toolbar on small screen sizes and redesign toolbar for desktop.
Comment #5
mgiffordWould be good to have a full review of the toolbar.
Comment #6
falcon03 CreditAttribution: falcon03 commented@caecus (he is another screen reader user :-)) and I discussed the toolbar accessibility in the skype accessibility group some time ago. I promised to report here the conclusion that we came to, but I never did it! :(
First off, we both agreed on the fact that the toolbar cannot be compared to a standard toolbar (e.g. the toolbar of a wysiwyg editor) and as a consequence the toolbar ARIA role is not appropriate for it. But we came to the conclusion that our toolbar is a composite widget and that it doesn't convey this information to a screen reader user.
So, we should make sure that the toolbar is wrapped in a container which the "group" ARIA role is assigned to either by wrapping it in a container or adding the attribute to an existing one. In addition to this, a (translatable) ARIA-label containing the text "Drupal toolbar" (the string could be improved, but we didn't have a better idea :-)) should be added to this container. Furthermore, each toolbar tray should be wrapped in a "nag" container which the navigation ARIA role is assigned to. The tray label (that is currently shown inside an heading before the tray content) should be added as an aria-label to that container.
The first section of the toolbar (the one that contains the buttons to show/hide the various sections of the toolbar) should be wrapped in a "nag" container which the navigation ARIA role is assigned to as well. In addition to this the "toolbar items" label (that is currently shown inside an heading before the various buttons) should be added as an aria-label to that container and its text should be changed both in the heading and in the aria-label from "Toolbar items" to a more significant string (the most appropriate string has not been identified yet, help is greatly appreciated :-)).
The headings shouldn't be removed from the toolbar, so that the same information (the section label) is conveyed through the aria-label and the heading. This prevents us from degrading the uix for drupal users using a screen reader that does not support the aria-label attribute.
Comment #7
falcon03 CreditAttribution: falcon03 commentedPlease note that this is an experimental solution. This means that an eventual patch should be carefully tested with various screen readers before getting committed. I wanted to post this proposal to get the discussion started! :-) Any different proposal/idea is very very welcome.
Comment #8
falcon03 CreditAttribution: falcon03 commentedMight be a better title. Also tagging.
Comment #9
jessebeach CreditAttribution: jessebeach commentedFrom the Minnesota Accessibility studies at the Twin Cities Drupal Camp
https://docs.google.com/a/acquia.com/spreadsheet/ccc?key=0AgZownHpU1oqdH...
Comment #10
falcon03 CreditAttribution: falcon03 commented@jessebeach, well, I think that the problem is mostly because of the "Toolbar items" heading that is positioned before the buttons. It doesn't allow you to understand easily what the buttons are supposed to do. I don't think that clicking on a button to make a menu show up is an accessibility issue; letting blind people understand this behavior easily is an accessibility issue, though! :-)
Comment #11
falcon03 CreditAttribution: falcon03 commentedAlso, if people agree on the proposed solution in #8 I can submit a patch. However, it will need to change core/modules/toolbar/templates/toolbar.html.twig significantly by moving things around (especially due to the conditional check for tray.label before printing it out).
So, basically the end result will be that if you add a tray to the toolbar but don't specify a tray.label the tray will not be shown. Of course I'm completely fine with this behavior because it will enforce the usage of tray.label.
Comment #14
mgiffordSee related issue #2052473-2: Add aria-label or aria-describedby attributes to all <nav> elements - Would be good to add aria-labels to nav elements in the toolbar here rather than there.
Comment #15
jessebeach CreditAttribution: jessebeach commentedFrom the Twin Cities Drupal Camp testing:
Comment #16
mgiffordComment #17
mgiffordHere's a patch to help extend discussion about #6 above.
1) Add ARIA group
Any reason not to add role="group" to the
<nav>
?2) Add ARIA-label
Why not just link the container to the H2 with labelledby?
3) Add ARIA to each toolbar tray
I'm blanking on "nag" container. You use that term here too #2052473: Add aria-label or aria-describedby attributes to all <nav> elements - not navigation.. First Mozilla's example above suggest using
aria-owns
.4) Assign ARIA role to first section of the toolbar
5) Add ARIA-label to container
Not sure what we should call this.
6) Leave the headings
Agreed.
Comment #18
mgiffordComment #19
falcon03 CreditAttribution: falcon03 commented@mgifford, uploading a new patch to show in practice what I meant in comment#6...
I'm going to reply to your question soon.
Again, I'd like to remark that this is experimental code and that I'm not 100% sure this is the right thing to do to improve the toolbar accessibility.
Comment #20
falcon03 CreditAttribution: falcon03 commentedOf course in the patch I posted there's an issue: we use
{{ tray.label }}
before cheking if it exists. This is the issue I was talking about in comment#6: the only solutions to this problem are:
Both solutions have a great advantage: they will enforce anyone that defines a new toolbar tray to define a label for that tray as well to get the tray printed out. IMO this is desirable from an accessibility point of view.
Comment #21
MiriamGonzalez CreditAttribution: MiriamGonzalez commentedComment #22
mgiffordThanks @falcon03
This applies nicely and doesn't cause any known problems that I can see.
I just looked at the patch and applied it to SimplyTest.me
Comment #23
falcon03 CreditAttribution: falcon03 commented@MiriamGonzalez, could you explain the reason why you set the issue status to "active"?
@mgifford, thanks. I'm waiting for feedback about the question in comment#20 so that I can complete the patch.
Comment #24
mgiffordI'm for keeping it simple. Since this is already being tested for:
Let's just move the conditional check for tray.label one line above as you suggested in #20.
I do think that if there is a reason to have the ID's that it's fine and I really don't think that there is any way to add this semantic information into a dominant part of D8 without them.
How do we best document the enforcement around the new toolbar tray? We want it to be easier for there to be labels than not to have labels.
Comment #25
mgiffordComment #26
mgiffordHopefully this helps move this issue ahead. It's leveraging tray.label as suggested in #24.
Comment #27
mgiffordThis seems like an easy win. There are no UI changes, just additional semantics.
Patch still applies nicely.
Comment #28
mgiffordNo longer applies.
Comment #29
LinL CreditAttribution: LinL commentedComment #30
mgiffordI realized we may not actually want to list Drupal here:
It might be better to just add the toolbar to the description like:
Comment #31
falcon03 CreditAttribution: falcon03 commented@mgifford, great idea. Let's do it...
Comment #32
mgiffordExcellent. This patch looks good to go.
Comment #35
LinL CreditAttribution: LinL commentedBack to RTBC, #33 was a testbot glitch.
Comment #36
alexpottThe issue summary does not explain the scope of the patch or what it is fixing.
Comment #37
mgiffordFilling in summary and moving it back to RTBC. Thanks @alexpott for getting us to improve the summary. If it needs more, do let me know.
Comment #38
alexpottCommitted 77a9ea0 and pushed to 8.x. Thanks!