Notes and guide to Accessibility techniques.
- Roles MUST NOT change in the DOM. If needed, you'll need to remove the entire element and it's children and all a new element with the desired role.
- MDN Accessibility ARIA
- W3C Definition of Roles
- WAI-ARIA Taxonomy
-
A region of the page intended as a navigational landmark for quick assess. Such as navigating, searching, primary content, etc.
-
main
- Superclass Role:
landmark
- The main content of a document.
- Non-obtrusive alternative for "skip to main content" links
- No more than one element with the
main
role.
- Superclass Role:
-
application
- Superclass Role:
landmark
- A region declared as a web application, as opposed to a web
document
.
- Superclass Role:
-
banner
-
complementary
-
contentinfo
-
form
-
navigation
-
search
Structures organize content in a page. Structures are not usually interactive.
TODO: Expound
document
- Superclass Role:
structure
- A region declared as document content, as opposed to a web
application
.
- Superclass Role:
article
directory
group
heading
img
list
listitem
note
presentation
region
separator
toolbar
TODO: Expound
button
link
radio
radiogroup
tab
tabpanel
tablist
tree
treeitem
menu
menubar
combobox
listbox
These attributes are used to support the widget
roles.
TODO: Expound
aria-autocomplete
aria-checked
(state)aria-disabled
(state)aria-expanded
(state)aria-haspopup
aria-hidden
(state)aria-invalid
(state)aria-label
aria-level
aria-multiselectable
aria-pressed
(state)aria-readonly
aria-required
aria-selected
(state)
TODO: Expound
aria-atomic
false
(default): Changes to the live region is presented alone, rather than the whole content. This prevents users from hearing redundant content repeatedly.true
: The live region are presented as a whole, rather than just announcing the parts that changed.
- aria-busy (state)
aria-live
off
(default): Updates to live regions are ignored. Good for secondary content which is frequently updated.polite
: Waits to announce updates, after the user not busy (reading, navigating).assertive
: Interrupt user immediately, possibly clearing current read buffer.
aria-relevant
TODO: Expound
http://www.w3.org/TR/wai-aria/states_and_properties#attrs_relationships
- Every
<lable>
needs afor
attribute, pointed to a valid form control'sid
, or needs to wrap the form control it belongs to.
<label for="inputId">Label Text</label>
<input id="inputId">
<!-- or -->
<label>
Label Text
<input>
</label>
- The placeholder attribute should not be used as an alternative to a label.
<input placeholder="...">
TODO: Expound
http://www.w3.org/TR/wai-aria/usage#managingfocus http://www.w3.org/TR/2013/WD-wai-aria-practices-20130307/#kbd_focus