3. the problem
it's "easy" (in most cases) to make static web content accessible, but
nowadays the web strives to be an application platform
complex web applications require structures (e.g. interactive controls)
that go beyond what regular HTML offers (though some of this
introduced with HTML5 ... more on that later)
6. the problem
when building interactive controls, some (too many) web developers
go "all out" on the JavaScript/CSS, but ignore/sidestep regular HTML
controls completely
16. Operating systems and other platforms provide interfaces that expose
information about objects and events to assistive technologies
Java Accessibility API [JAPI], Microsoft Active Accessibility [MSAA], the Mac OS X
Accessibility Protocol [AXAPI], the Gnome Accessibility Toolkit (ATK) [ATK], and
IAccessible2 [IA2]
22. inspection tools
test using assistive technologies (e.g. screenreaders), however...
assistive technologies often use heuristics to repair
incomplete/broken accessibility API information - so we want to
check what's actually exposed to the OS/platform.
of course, browsers also have bugs/incomplete support...
39. what information does ARIA provide?
• role: what type of widget is this? (e.g. 'slider')
• state: what is its situation? (e.g. 'disabled')
• identity: what does it represent? (e.g. 'volume control')
this information is mapped by the browser to the operating system's
accessibility API and exposed to assistive technologies.
extra benefit: AT will (may) automatically announce widget-specific
hints and prompts (e.g. JAWS "... button - to activate, press SPACE
bar")
42. use ARIA to:
• make custom widgets understandable to assistive technology users
• programmatically indicate relationships between elements
• notify users of dynamic updates
• hide irrelevant visible content from assistive technology
• remediation of inaccessible content without completely recoding
43. ARIA roles and attributes: restrictions
• certain role s only make sense as part of a specific complex widget
• some aria-* attributes are global
• other aria-* attributes only make sense for particular role
• not all roles/attributes are supported/implemented consistently
everywhere
44. what ARIA doesn't do...
ARIA is not magic: it only changes how assistive technology
interprets content.
• make an element focusable
• provide keyboard events
• add properties
• change visible appearance
all of this is still your responsibility...
49. In principle ARIA works in all markup languages...but obviously that
depends on user agent/AT support. We'll focus on ARIA and HTML
Sidenote: Using ARIA to enhance SVG accessibility
55. If you can use a native HTML element [HTML5] or attribute with the
semantics and behaviour you require already built in, instead of re-
purposing an element and adding an ARIA role, state or property to
make it accessible, then do so.
“
56. 2. don't change native
semantics
unless you really have to / know what you're doing
57. don't do this:
<h1 role="button">heading button</h1>
do this instead:
<h1><span role="button">heading button</span></h1>
otherwise the heading is no longer a heading
(e.g. AT users can't navigate to it quickly)
58. don't do this:
<ul role="navigation">
<li><a href="...">...</a></li>
...
</ul>
do this instead:
<div role="navigation">
<ul>
<li><a href="...">...</a></li>
...
</ul>
</div>
otherwise the list is no longer a list
(e.g. AT won't announce "list with X items...")
60. All interactive widgets must be focusable and scripted to respond to
standard key strokes or key stroke combinations where applicable. [...]
Refer to the keyboard and structural navigation and design patterns
sections of the WAI-ARIA 1.0 Authoring Practices
86. why define landmarks?
• users of assistive technologies can more easily find areas of your
page/app
• AT keyboard controls to navigate to/between landmarks
• overview dialogs listing all landmarks (e.g. NVDA)
100. <span tabindex="0" role="checkbox"
aria-checked="false" class="...">Option</span>
<span tabindex="0" role="checkbox"
aria-checked="true" class="... checked">Option</span>
• add role="checkbox"
• make sure it's focusable
• add handling of SPACE
• add aria-checked and dynamically change its value
similar to toggle button, but announced differently by AT
104. <span tabindex="-1" role="radio"
aria-checked="false" class="...">Yes</span>
<span tabindex="0" role="radio"
aria-checked="true" class="... selected">No</span>
<span tabindex="-1" role="radio"
aria-checked="false" class="...">Maybe</span>
• add role="radio"
• only single tab-stop (as with native radio buttons)
• add handling of SPACE and cursor keys
• add aria-checked and dynamically change its value
• should be contained inside role="radiogroup" (cfr. <fieldset> )
110. <span tabindex="0" onmouseover="..." onfocus="..."
aria-describedby="tooltip" >...</span>
...
<span role="tooltip" id="tooltip">
this is the tooltip text</span>
example: tooltip
• add role="tooltip" (but seems to have no effect in AT)
• add aria-describedby pointing to id of tooltip
112. <span role="status" >
some form of status bar message...</span>
example: status bar
• add role="status" (varying support?)
• an example of a live region (more on this later)
114. <span role="alert" >
an alert message (no user interaction)</span>
example: alert
• add role="alert" (varying support?)
• an example of a live region (more on this later)
141. <!-- list with selectable items, expand/collapse, nesting -->
<div role="tree" >
<div role="treeitem" >...</div>
<div role="treeitem" >...</div>
<div role="treeitem" >...
<div role="group" >
<div role="treeitem" >...</div>
<div role="treeitem" >...</div>
</div>
</div>
...
</div>
example: Tree example (no ARIA used) / Tree example (with ARIA)
support very poor on mobile (as with many complex ARIA widgets)!
145. the basics
to be usable – all interactive controls must be:
• focusable
• in the logical tab order
• visible when they receive focus
• have a clear indication of focus
• operable with the keyboard
• no focus trap
• focus does not cause a change of context
146. problem with custom controls
• <div> , <span> etc. are not standard controls with defined behaviors
• not focusable with keyboard by default
147. solution
• ideally, use native focusable HTML controls ( <a> , <button> , etc.)
• or add tabindex="0" , appropriate role , and manually handle
keyboard interactions
148. complex widgets and focus
• generally, complex widgets (group of radio buttons, menus, listboxes,
tab lists) only have a single "tab stop"
• interactions within the widget handled programmatically
• TAB / SHIFT + TAB moves to the next widget, not to sub-components
149. keyboard navigation within widgets
• either: "roving" tabindex (only one element inside widget has
tabindex="0" , all others tabindex="-1" )
• or: focus remains on widget itself, denote active child element with
aria-activedescendant (and manually scroll into view, provide
highlight via CSS)
not all complex widgets lend themselves to "roving" tabindex - e.g.
role="combobox" needs aria-activedescendant , as actual focus
must remain inside the textbox.
W3C WAI-ARIA 1.0 Authoring Practices - 3.1.3. Keyboard Navigation
within Widgets
150. <!-- roving tabindex example -->
<div role="radiogroup">
<div role="radio" aria-checked="true" tabindex="0" ...> ...
<div role="radio" aria-checked="false" tabindex="-1" ...> ...
<div role="radio" aria-checked="false" tabindex="-1" ...> ...
</div>
only one radio button inside the group has focus
151. <!-- roving tabindex example -->
<div role="radiogroup">
<div role="radio" aria-checked="false" tabindex="-1" ...> ...
<div role="radio" aria-checked="true" tabindex="0" ...> ...
<div role="radio" aria-checked="false" tabindex="-1" ...> ...
</div>
changing the selection dynamically changes tabindex , aria-
checked and sets focus() on the newly selected radio button
153. <!-- activedescendant example -->
<div role="radiogroup" tabindex="0" aria-activedescendant="rad2" >
<div role="radio" id="rad1" aria-checked="false" ...> ...
<div role="radio" id="rad2" aria-checked="true" ...> ...
<div role="radio" id="rad3" aria-checked="false" ...> ...
</div>
changing the selection dynamically changes aria-
activedescendant on the radiogroup , aria-checked on the radio
button - but focus still remains only on the radiogroup
156. making AT aware of content changes
best way to notify users of assistive technologies of new content (a
new element added to the page, made visible, a change in text) is to
move focus() programmatically to it.
but this is not always possible, as it would interrupt the user's current
actions...
example: faked button with notification via focus()
157. ARIA live regions
• announce a change on content without moving focus to it
• aria-live : off , polite , assertive
• aria-atomic
• aria-relevant
example: faked button with notification using aria-live and aria-
atomic
some role s have implicit live region - e.g. role="alert"
unfortunately, support is...flaky
160. Dev.Opera - Gez Lemon - Accessible Drag and Drop Using WAI-ARIA
161. • aria-grabbed
• aria-dropeffect
example: Open Ajax Alliance - Drag and Drop / Gez Lemon's Drag and
Drop example
support is still bad (particularly on mobile) - consider refactoring or
providing alternative instead
163. document vs application mode
assistive technologies/screenreaders generally operate in two modes:
document mode and application mode (terminology varies)
• in document mode ("reading mode"), user can navigate freely through
the page/content with keyboard shortcuts provided by AT
• in application mode ("forms mode"), keystrokes are mostly passed
directly to page, which needs to handle all interactions
SSB Bart Group - How Windows Screen Readers Work on the Web
165. the result
• all keystrokes can now be handled via JavaScript
• need to ensure any text/content is explicitly associated with
focusable elements, use live regions, etc
• any content areas should be given role="document" to re-enable
user control
166.
167. (Google Mail doesn't use role="application" ... for illustrative purposes only)
168. you don't need role="application" ...
• for native HTML elements ( <button> , <select> etc)
• for common complex ARIA widgets (treeview, slider, dialog, etc)
in both cases, assistive technologies recognise them and
automatically switch to applicable mode / pass relevant keystrokes to
the page
tl;dr: in most situations, you won't need role="application"
176. if your page/app uses inappropriate markup, ARIA can be used to
patch some of the issues (if it can't be fixed properly)...
<table role="presentation" >
<tr>
<td>Layout column 1</td>
<td>Layout column 2</td>
</tr>
</table>
example: layout table remediation