Problem/Motivation
There is still a lot of scope for improving our use of ARIA techniques. During the early phases of D8 development (2012-2013, say) the level of support for ARIA was quite inconsistent across various browsers and assistive technology. Many accessibility issues were decided on the basis of what we could get away with in the present state of technology. Since then, ARIA 1.0 has been more completely implemented. Broadly speaking we've moved from "not ready yet" to dealing with known bugs/quirks, and we are seeing more consensus in the wider accessibility community about how to use ARIA effectively.
Proposed resolution
The new six-monthly release cycle provides scope for modernizing our ARIA usage in stages, adopting new patterns once we feel they are well enough established. Quick wins can come in D8 minor releases, and major changes can be postponed to D9 if necessary.
The W3C ARIA Authoring Practices guide (APG for short) is being developed as a set of best-practice patterns for accessible UI widgets. It provides a good starting point to compare our existing UI widgets against. We don't have to adopt it wholesale though.
Similarly, WAI-ARIA 1.1 is now a W3C recommendation, and introduces some new roles, states and [properties which we can employ.
Some places we could use better ARIA patterns include:
- Improve the Drop-button pattern (used e.g. to wrap entity operation links).
- The Menu Button pattern from ARIA Authoring Practices looks like a very good fit, and is well-supported by current browsers and AT.
- #2893663: Dropbutton should report open/closed state to assistive technology.
- Do this as part of the wider dropbutton modernization plan at #1899236: Add new Splitbutton render element to eventually replace Dropbutton
- Bartik main menu does not convey open/closed state to assistive tech at small screen breakpoint, and fails "focus visible" for sighted keyboard-only users.
- Bring our vertical tabs into line with the tabs behaviour described in the ARIA Authoring Practices.
- Or we could look at contributing upstream to jQuery UI tabs, which already implements some of the keyboard behaviour suggested by the authoring practices. This already ships with Drupal core, but vertical tabs isn't based on it.
- Also horizontal tabs could follow the APG, if #1168364: Add horizontal tabs supports to FAPI gets into core.
- #2865199: Adopting ARIA Grid pattern. Could be a good fit for some admin pages where we have form elements in a table (e.g. Field UI's Manage Display).
- ARIA 1.1 introduces the
aria-currentproperty, which can make pagers, breadcrumbs, menus, and multi-step forms, more robust.- #2952488: Use aria-current=page in pagination links.
- Use aria-current=page in menu blocks. NEEDS CHILD ISSUE
- Use aria-current=page in breadcrumb blocks. NEEDS CHILD ISSUE? Might get it for free when fixing menu blocks.
- Investigate use aria-current=step in multi-step forms. NEEDS CHILD ISSUE. The installer page is an example, where we currently have a visually hidden span to indicate the current step. This is OK but could be replaced with aria-current=step.
- ARIA 1.1 introduces the
aria-errormessagerelationship property. We could programatically associate error messages with form inputs, similar to how we usearia-describedbyfor help text. - Using
role="progressbar"for Batch API could provide clearer announcements than the current approach which is just a basic live region. See comment #22-24. - ARIA 1.1 introduces
aria-modal="true"to clarify the behaviour of dialogs. Additionally, HTML 5.2 introduced a<dialog open>element with an accompanyingHtmlDialogElementinterface. We might employ these eventually. The authoring practices have some advice about how dialog implementation. aria-haspopup="dialog", per ARIA 1.1, does not have good support yet as of Feb 2019. When it does, it should be useful for places where we have dialogs: Views UI, Workspaces, MediaLibraryWidget, Layout builder, etc..aria-haspopup="true", per ARIA 1.0, has good support and can be used for menus like dropbuttons.
Use child issues to explore particular UI widgets in detail.
Remaining tasks
- Evaluate which new ARIA patterns will be useful to us, especially the ones described in the W3C ARIA Authoring Practices guide.
- Find examples in the wild.
- Find other FL/OSS libraries which already provide them.
User interface changes
This is primarily about accessibility improvements, for screen reader users, keyboard-only users, etc..
No major changes propsed to the current designs (visually speaking).
Some markup changes might be necessary; aim to minimize these.
API changes
Possibly some additions to the Javascript API. Some of these ARIA patterns might work as a JS library, or involve expanding the capabilities of existing libraries. On the scale of our existing Drupal.announce() and Drupal.tabbingManager() APIs.
Data model changes
Hopefully none.
Comments
Comment #2
andrewmacpherson commentedComment #3
andrewmacpherson commentedComment #4
andrewmacpherson commentedComment #5
andrewmacpherson commentedComment #6
andrewmacpherson commentedComment #7
andrewmacpherson commentedComment #8
andrewmacpherson commentedComment #9
andrewmacpherson commentedComment #10
andrewmacpherson commentedComment #11
andrewmacpherson commentedOK, that's enough of an initial plan. Next step is to get contributors interested in doing it - we can promote it on the Slack and G.D.O channels for a11y.
Comment #12
andrewmacpherson commentedComment #13
yoroy commentedGood stuff. I sense a concerted accessibility effort for 8.5 :)
Comment #14
andrewmacpherson commentedComment #15
Bojhan commentedIt feels like this needs a thorough review of which ARIA authoring practices we can pickup. I was under the assumption WCAG covered most of that, but clearly not.
Comment #16
andrewmacpherson commentedThat's right. The overall purpose of this issue is to consider each pattern from the ARIA authoring practices, to see where Drupal could benefit from using it.
The supporting documents for WCAG 2.0 do include many ARIA techniques which can help with various Success Criteria. Most of these are at the level of "providing labels for controls", and don't go as far as describing any complex components.
The WAI-ARIA Authoring Practices 1.1 is much newer that WCAG 2.0 (it's being developed to accompany ARIA 1.1). It describes patterns for the overall structure and behaviour of complex components. There's a focus on making web application widgets behave similarly to widgets in desktop applications (using equivalent roles, states, keystrokes, etc.). Examples are tab sets, accordions, collapsible nested menu links, drop-buttons, etc. Since Drupal has some components of this kind, this issue is about adopting these patterns where we can.
This isn't part of our accessibility gate - yet :-) It's one of things that I'd like to talk about in a core conversation at DrupalCon Vienna.
Update: come to think of it, while the ARIA Authoring Practices aren't part of our accessibility gate, they might increase our coverage of ATAG 2.0. I need to study that a bit more.
Comment #17
andrewmacpherson commentedI think some of the keyboard behaviours described in the ARIA Authoring Practices will go towards meeting ATAG A.3.1.3 Efficient Keyboard Access. For example, the ARIA patterns for tabs and grid could reduce the number of keystrokes needed to access some settings. I already noted this possibility in #2865199-5: Adopting ARIA Grid pattern
Comment #18
Bojhan commentedFrom my understanding reading up on this, it is a matter of time before we need to adopt this. We've always been ahead on the curve on this one, so I don't see any reason not to do this.
If you wish to present this for approval/review by the product management team, it primarily needs a good understanding of the work involved. With a clear indication of the benefits, moving beyond WCAG 2.0 - to me the ARIA Grid pattern is a good example of a big step ahead.
Comment #19
andrewmacpherson commentedWAI-ARIA 1.1 is now a W3C recommendation. Adding ideas about
aria-currentandaria-errormessage.Comment #20
andrewmacpherson commentedComment #21
andrewmacpherson commentedComment #22
andrewmacpherson commentedThe batch API progress bar is currently just wrapped in a basic
aria-live="polite", but it has quite a complicated structure inside. The announcements are a quite inconsistent between different screen readers.We should evaluate using
role=progressbar, with relevant properties and states. This presents the progress information in a more structured way for AT, so it might be easier to follow what's going on. Like most of the other ideas here, it will depend on how well supported it is.Comment #23
andrewmacpherson commentedI should organize the ideas list better. Some will be straight-forward to try out, others need more info.
Comment #24
andrewmacpherson commentedI mentioned
role="progressbar"to @John Cook - the new Batch API maintainer, who has experience of screen reader testing. He was enthusiastic about it.We discussed the related
aria-value*properties, and how these could be mapped to the values, label, and messages which a Batch API process already knows about. The idea is that assistive tech can convey progress in a way that is better matched to the platform norms, respect user verbosity settings, etc., than a simple ARIA-live region.Alternatively, Batch API might expose a way for developers to pass their own string or tokens to
aria-valuetext. Looks like a good child issue to spin out on it's own.Comment #25
andrewmacpherson commentedAdded #2952488: Use aria-current=page in pagination links..
Comment #26
andrewmacpherson commentedARIA 1.1 introduces
aria-modal="true"to clarify the behaviour of dialogs. Additionally, HTML 5.2 introduced a<dialog>element with an accompanying HtmlDialogElement interface.An earlier draft of the WAI-ARIA Authoring Practices described different interaction patterns for modal vs. non-modal dialogs. I recall it suggested that non-modal dialogs should have a standard window-switching keyboard shortcut (F6?) like old HTML framesets. I went to look it up today, but it's not in the latest version which reached W3C Note status. I asked one of the editors on Twitter if it's still a thing being considered.
Adding a short placeholder in the issue summary ideas list.
Comment #27
andrewmacpherson commentedTurns out there are already some modernization plans for the dropbutton component, at #1899236: Add new Splitbutton render element to eventually replace Dropbutton. The motivation there is about front-end coding practices for maintainability and theming.
So I've made #2893663: Dropbutton should report open/closed state to assistive technology a child issue for the drop-button plan. If they're going to overhaul the CSS and markup, that's the perfect opportunity to build in the accessibility improvements. I'm doubling down on using the Menu Button pattern from WAI-ARIA Authoring Practices too - the simplified markup proposal for dropbutton is already a move in that direction.
Also, the dropbutton modernization plan includes better focus styles, extending use of the blue-halo button focus style in Seven.
Comment #28
andrewmacpherson commentedComment #29
andrewmacpherson commentedComment #30
andrewmacpherson commentedComment #31
andrewmacpherson commentedaria-haspopup="dialog"is new in ARIA 1.1, and would seem to be ideal for the places where we use dialogs, particularly views UI. However support for this is currently very poor in browsers and assistive tech.Here's a test from a couple of years ago: ARIA Haspopup property.
Support hasn't improved yet. I tested recent versions of Windows 10 browsers with JAWS and NVDA, and got similar results.
JAWS bug report: Jaws does not announce token values of aria-haspopup
Support for
aria-haspopup="true", per ARIA 1.0 is fairly good. We can certainly use that for things like dropbuttons I think.Comment #32
tim.plunkettFixing tag
Comment #33
catchMoving to core from the ideas queue (which is deprecated).
Comment #34
mgiffordWe're now at 1.2 and there is a draft of 1.3
https://www.w3.org/WAI/standards-guidelines/aria/
Should we update this or start a new issue?