Some things are well supported, others not so much
ARIA is seriously abused by nubes, don't be a nube
...you'll end up doing more damage than good
With that said, you WILL make mistakes ... embrace, fix and move on
My goal tonight
Create awareness
Provide a high-level overview
...that doesn't mean light on substance
Provide a better understanding when and why to use ARIA
Walk away motivated to learn more
Before we continue...
Prerequisite for using ARIA
HTML
HTML has roles (mostly)
A role provides an element's purpose.
<img> role is to display an image
<a> role is to display a hyperlink
<main> role is to provide a landmark for the main content of a page
<div> & <span> - no default role, can be crafted into whatever you like - custom controls
HTML has Names
Names provide a means to differeniate between elements
<img> name is the alternative text description
<a> name is the link text
<label> text provides the name for the associated input or form field
HTML has States & Properties
Provides information on an elements current state
<input type="checkbox" checked> provides information that the checkbox is currently checked.
Communicates visually that the checkbox is checked, and by passing this info to assistive technology, allows the user to become aware the checkbox is checked
<select required> the required attributed notifies that this form element is required.
HTML handles keyboard focus and interaction
Provides visual cues and default interaction with actionable elements
<a> can be followed by pressing the Enter key
<button> can be acted on by pressing the Space key
Action outside of form container dependant on JavaScript
HTML
Use it
Do as little as possible
Let HTML and the browser handle the majority of your needs
Accessibility APIs
Platform-specific, yet similar
Provides role, name and state info that is accessed by browsers and asssitive technology
W3C's HTML Accessibility API Mappings 1.0
http://www.w3.org/TR/html-aam-1.0/
Browsers
Creates a Document Object Model (DOM) of the page
Creates an Accessibility Tree of the page
While the DOM can be manipulated with JavaScript, the Accessibility Tree cannot be manipulated (today)
ARIA
What is ARIA?
Accessible Rich Internet Applications
A means for providing semantic value
Like a vitamin, ARIA supplements semantic meaning
ARIA has commandments
ARIA Commandment #1
Thou shalt not use ARIA
“Say What!?”
If you can use a native HTML element or attribute with the semantics and behaviour you require already built in, use that element or attribute
Don't use to re-purpose an element and add an ARIA role, state or property to make it accessible.
Thou shalt not change native semantics (unless you're weak-minded, poorly organized or desperate)
Do not change native semantics, unless you really have to.
Before changing native semantics, look for any other way, including using the native element
Click here
ARIA Commandment #3
Thou shalt make all interactive ARIA controls usable with the keyboard
If you create an interactive widget, a user must also be able to navigate to the widget and perform an equivalent action using the keyboard.
All interactive widgets must be scripted to respond to standard key strokes or key stroke combinations where applicable.
ARIA Commandment #4
Thou shalt not use role="presentation" or aria-hidden="true" on a visible focusable element
Using either of these on a visible focusable element will result in some users focusing on 'nothing'.
Don't do either of the following:
ARIA Commandment #5
Thou shalt provide an accessible name for all interactive elements
An interactive element only has an accessible name when it's Accessibility API accessible name (or equivalent) property has a value.
ARIA Roles, States and Properties
ARIA Roles
Describe the structure of the Web page
Describe the type of widget presented
What Roles Do Not Do
Does not make an element look or act differently for people not using assistive technology
Does not change the behaviours, states and properties of the host element but only the native role semantics.
Before we go any further...
Adding an ARIA role overrides the native role semantics, therefore ARIA indirectly affects what is reported to a screen reader or other assistive technology.
When to use ARIA roles
When the semantics you need don't exist otherwise
(i.e. <div>,<span>, tablist tabpanel)
When the semantics are weak or are not well supported (you may have to duplicate)
Roles (not complete list)
Navigational Landmarks
banner
complementary
contentinfo
main
navigation
search
UI Widgets
alert
button
checkbox
dialog
gridcell
link
menuitem
radio
slider
tab
tablist
tabpanel
tooltip
Landmark Roles
Provides web page landmarks for navigation, wayfinding