You're only supposed to blow the bloody doors off!

You're only supposed to blow the bloody doors off!

FrontEnd NE, Newcastle 2018

5... 4... 3... 2... 1...

Screen readers

Jaws NVDA Voiceover Narrator Orca
Jaws NVDA Voiceover Narrator Orca
(Freedom Scientific) (NV Access) (Apple) (Microsoft) (GNOME)

Screen reader demo: text

Screen reader demo: headings

Screen reader demo: buttons

The details & summary elements

<details>
<summary>Tequila...</summary>
Makes me happy!
</details>

Edge: not implemented

details/summary elements in Edge

Firefox: implemented

The accessibility tree: details element

Role
button
State
focusable
focused
expandable
collapsed

Screen reader demo: details & summary elements

Accessibility APIs

Windows
UI Automation (UIA)
MS Active Accessibility (MSAA)
IAccessible2 (IA2)
Mac OS
OSX Accessibility Protocol (AXAPI)
Linux
Accessibility Toolkit (ATK)
AT Service Provider Interface (AT-SPI)

The div & span elements

Have neutral semantics

<div class="toolbar">
<span class="button">Bold</span><span class="button">Italic</span>...
</div>

Screen reader demo: div & span elements

Polyfill accessibility

Attributes that polyfill missing role, name, and state information for screen readers

ARIA 1.1 (W3C Recommendation)
w3.org/TR/wai-aria-1.1

The role attribute

70+ roles, including:

The aria- attributes

45+ states and properties, including:

Accessibility mechanics

5... Don't use ARIA

The span element

<span id="button">Tequila!</span>

Keyboard demo: span element

Tequila! button

Screen reader demo: span element

Polyfilled semantics

<span id="button" role="button" tabindex="0">...</span>

Screen reader demo: polyfilled semantics

The button element

<button>Tequila!</button>

Screen reader demo: button element

4... Don't break native semantics

The wrong role

<button role="heading" aria-level="1">Tequila!</button>

Screen reader demo: the wrong role

3... Make it work with the keyboard

Supplement existing interaction

<a href="#here" id="button" role="button">Tequila!</a>

var button = document.getElementById('button');
button.addEventListener('keydown', function(event) {
    if (event.keyCode == 13) {
        doSomething();
    }
});

Provide all interaction

<span id="button" role="button" tabindex="0">Tequila!</span>

var button = document.getElementById('button');
button.addEventListener('keydown', function(event) {
    if (event.keyCode == 13 || event.keyCode == 32) {
        toggle();
    }
});

Screen reader demo: provide all interaction

2... Don't invoke applications mode

The application role

<body role="application">...</body>

Keyboard intercept chain

Windows
Screen reader
Browser
Mac OS
Browser
Screen reader

Other application roles

Several roles invoke applications mode, including:

Screen reader demo: tablist role

Common design patterns

ARIA Authoring Practices Guide (APG) 1.1:
w3.org/tr/wai-aria-practices-1.1/

Screen reader demo: tablist role + keyboard support

1... JavaScript accessibility API

With great power...

Accessibility Object Model (AOM):
github.com/wicg/aom

ChromeFirefoxSafari

AOM use cases

You're only supposed to blow the bloody doors off!

Thank you