Web Accessibility For Developers 1571157806 2
Web Accessibility For Developers 1571157806 2
Learning Outcomes
Suggested Prerequisites
Introduction | 1
• JavaScript: You should have a functional understanding of the
JavaScript scripting language and be familiar with using jQuery
and jQuery plugins. Though you can follow along with basic
knowledge of JavaScript and jQuery, it will be easier to
understand if you are comfortable writing (or, at least, copying
and pasting) JavaScript code and making adjustments.
• HTML: You should have at least a functional understanding of
HTML 5. Though most of the HTML in this book will be
provided, you’ll need to understand how it is used to produce
the widgets you’ll be working on.
• Git Version Control: We strongly recommend a GitHub
account (and a basic understanding of how it is used) in order
to participate in the activities found in this book. Details will be
provided in the book if you need to set up an account, and
basic Git commands will be covered.
Suggested Technology
2 | Introduction
such as Visual Studio Code, Sublime Text, or Atom.
Suggested Readings
Suggested Reading:
You might also look ahead to the next version by reviewing WAI-
ARIA 1.2, currently available as an editor’s draft.
These readings are more references than they are readings. At
a minimum, scan through these documents to understand what
they contain and refer back to them when you encounter scenarios
where WAI-ARIA could or should be used.
Disclaimer
Introduction | 3
Getting the Most Out of This
Book
We highly recommend reading this book online. While the book is
available for download in various formats (ePub, HTML, and PDF),
the interactive elements in the readings and activities are best
viewed here in Pressbooks.
Throughout the book, you’ll see the various coloured boxes
described below to help you organize how you engage with the
content.
Toolkit
Key Points
Try This
Suggested Reading
Self-Tests
The first few chapters include Self-Tests, which will help reinforce
key topics discussed in a unit. For questions that have multiple
answers, be sure to select all the correct answers and none
of incorrect answers in order for the question to be marked
“correct.” Multiple answer questions can be challenging, and they
typically require a thorough understanding of the topic in question
to answer correctly. Questions will only reference topics covered
in the book itself. They will not test your knowledge of content
referred to on external resource sites that may be linked from the
book.
Try This: Skip ahead to the end of the book and read through
the Book Recap for a high-level summary of the topics
covered in the book.
Suggested Reading:
2 | Accessibility Statement
BACKGROUND
Background | 3
Types of Disabilities and
Barriers
In order to understand why web accessibility is necessary, it is
helpful to have a basic understanding of the range of disabilities
and their related barriers with respect to the consumption of web
content.
Key Point: Those who have taken our other courses will have
encountered this content already. Read again or skim for a
refresher.
Not all people with disabilities encounter barriers on the Web, and
those with different types of disabilities encounter different types
of barriers. For instance, if a person is in a wheelchair they may
encounter no barriers at all in web content. A person who is blind
will experience different barriers than a person with limited vision.
Different types of disabilities and some of their commonly
associated barriers are described here.
Watch the following video to see how students with disabilities
experience the Internet.
Video: Experiences of Students with Disabilities (1:59)
© Jared Smith. Released under the terms of a Standard YouTube License. All rights
reserved.
© davidbermancom. Released under the terms of a Standard YouTube License. All rights
reserved.
People who are blind tend to face many barriers in web content,
given the visual nature of the Web. They will often use a screen
reader to access their computer or device and may use a refreshable
Braille display to convert text to Braille.
Common barriers for this group include:
For a quick look at how a person who is blind might use a screen
reader like JAWS to navigate the Web, watch the following video.
Video: Accessing the web using screen reading software (3:07)
© rscnescotland. Released under the terms of a Standard YouTube License. All rights
reserved.
People with low vision are often able to see web content if it is
magnified. They may use a screen magnification program to
increase the size and contrast of the content to make it more visible.
They are less likely to use a screen reader than a person who is
blind, though, in some cases they will. People with low vision may
rely on the magnification or text customization features in their
web browser, or they may install other magnification or text reading
software.
Common barriers for this group include:
© Centre for Inclusive Design. Released under the terms of a Standard YouTube License.
For most people who are deaf the greatest barrier on the Web
is audio content that is presented without text-based alternatives.
They encounter relatively few barriers on the Web otherwise. Those
who are deaf and blind will face many more barriers, including those
described for people who are blind. For those who communicate
with American Sign Language (ASL) or other sign languages, such
as langue de Signes Quebecoise (LSQ), the written language of a
website may produce barriers similar to those faced when reading
in a second language.
Everyone
Key Point: Those who have taken our other courses, or read
our other books, will have read through this content already.
Read again or skim for a refresher.
Curb Cuts
Suggested Reading:
For those reading this book from Ontario, Canada, we’ll provide
occasional references to the Accessibility for Ontarians with
Disabilities Act (AODA). For those reading this book from outside
Ontario, you might compare AODA’s web accessibility requirements
with those in your local area. They will be similar in many cases and
likely based on the W3C WCAG 2.0 Guidelines. The goal in Ontario
is for all obligated organizations to meet the Level AA accessibility
requirements of WCAG 2.0 by 2021, which, ultimately, is the goal of
most international jurisdictions.
The AODA provided the motivation to create this book. All
18 | AODA Background
businesses and organizations in Ontario with more than 50
employees (and all public sector organizations) are now required
by law to make their websites accessible to people with disabilities
(currently at WCAG 2.0 Level A). Many businesses still don’t know
what needs to be done in order to comply with the new rules. This
book hopes to fill some of that need.
The AODA has its roots in the Ontario Human Rights Code,
introduced in 1990. It essentially made it illegal to discriminate
based on disability (among other forms of discrimination). The
development of the AODA began in earnest in 1994 with the
emergence of the Ontarians with Disabilities Act (ODA). Its aim
was to legislate the removal and prevention of barriers that inhibit
people with disabilities from participating as full members of
society, improving access to employment, goods and services, and
facilities. The act was secured as law in 2001.
With the election of a new government in 2003, the movement
that brought us the ODA sought to strengthen the legislation. The
Accessibility Standards Advisory Council was established and the
AODA was passed as law in 2005, and, in July 2011, the Integrated
Accessibility Standards Regulation (IASR) brought together the five
standards of the AODA covering Information and Communication,
Employment, Transportation, and Design of Public Spaces, in
addition to the original Customer Service standard.
The AODA sets out to make Ontario fully accessible by 2025, with
an incremental roll-out of accessibility requirements over a period
of 20 years. These requirements span a whole range of accessibility
considerations — from physical spaces to customer service, the
Web, and much more.
Our focus here is on access to the Web. The timeline set out in
the AODA requires government and large organizations to remove
all barriers in web content between 2012 and 2021. The timeline
for these requirements is outlined in the table below. Any new or
significantly updated information posted to the Web must comply
with the given level of accessibility by the given date. This includes
AODA Background | 19
both Internet and Intranet sites. Any content developed prior to
January 1, 2012, is exempt.
Level A Level AA
• January 1,
2016
(except live
captions
and audio
description)
• January 1, 2012 (except live
Government • January 1,
captions and audio description)
2020
(including
live
captions
and audio
description)
• January 1,
• Beginning January 1, 2014, new
2021
websites and significantly
Designated (except live
refreshed websites must meet
Organizations* captions
Level A (except live captions and
and audio
audio description)
description)
For more about the AODA you can review the following references:
Suggested Reading:
20 | AODA Background
◦ Reg. 146/10: Public Bodies and Commission Public
Bodies – Definitions
AODA Background | 21
About WCAG and
WAI-ARIA
Before we get into the main part of the book, some background
information on the relevant W3C specifications will help provide
some context for why developers should learn to use WAI-ARIA
when they are developing custom interactivity for the Web.
WCAG
The Web Content Accessibility Guidelines (i.e., WCAG 2.0 and the
recent WCAG 2.1, pronounced wuh-kag) is the primary specification
adopted around the world and describes how web content should
be created so it will be accessible to people with disabilities. WAI-
ARIA can help developers create content that conforms with
recommendations in WCAG. WCAG is covered in more detail in
another book, so we will just provide a basic introduction here. For
those who are not already familiar with WCAG, follow the link to the
W3C WCAG Specification for details.
Suggested Reading:
Suggested Reading:
WAI-ARIA
Suggested Reading:
1. Introduction | 27
Objectives and Activities
Objectives
Activities
If you do not already have one, you should create a GitHub account.
For any developer, it is an invaluable tool for sharing and
collaborating on code development. A GitHub account is free.
Though you can download the book files from GitHub, then unzip
them and work from a local directory on your hard drive, we
recommend creating a fork of the book files to your own account,
and cloning your fork into a local directory. Follow the link below to
set up an account, then read on.
Depending on the operating system you are using, there are specific
versions of Git for each platform. You may choose to use a Git client,
or you may choose to use Git from the command line. Here we will
present command line options. If you choose to use a client, see
the documentation associated with the client for details on cloning,
committing, pulling, and pushing.
If you are going to use a client, instead of working from a
command line, for Windows and Mac users, we suggest installing
SourceTree. GitHub Desktop is a good alternative if you prefer to
use an Open Source client. Feel free to choose another Git client if
you like.
For Linux users you can use your system’s package manager to
You should now have a copy of the book files available locally that
you can edit and commit back as your assignment updates, which
become part of your GitHub Pages website.
Note that it can take a few seconds or a minute for changes
committed to your GitHub Pages repository to actually show up on
the website.
To add the files to an existing GitHub Pages site, open the settings
for the forked repository you created. In the GitHub Pages section
shown in the screenshot below, choose the Source (typically, the
master branch) and click Save. This will create a subdirectory under
your existing GitHub Pages site with the name of the forked
repository (i.e., learnaria.github.io).
You may want to rename the repository to something shorter
(e.g., learnaria) before enabling it in GitHub Pages. This would
produce a URL to the book files something like:
https://[username].github.io/learnaria/
Figure: A
screenshot of
the GitHub
Pages
settings
You do not need to be an expert Git user, but you should know a few
basic commands if you are working from a command prompt. The
commands you’ll likely use are the following
Of course there are many other potential commands, but these are
the most common. If you are using a Git client, like SourceTree,
these commands will be clickable in the UI buttons and menus. For
more about using Git from the command line, see the Git Book.
Here is what to expect once you have successfully set up the book
files. You’ll note that the widgets are inaccessible. Your job
throughout the book will be to fix the accessibility of each widget.
If you are taking a course that uses this textbook, your instructor
will provide information on how and where to submit the URLs to
your various assignment submissions.
Grading Rubric
Criteria Points
URL to Course Files:
10.0
URL submitted to your copy of all the course files either in
pts
GitHub Pages or on a web server of your choosing.
Total Points: 10.0
Disclaimer
When creating this book and the jQuery plugin, we have optimized
plugin widgets to work with ChromeVox, the screen reader you’ll
be introduced to shortly. You may find some inconsistencies in
functionality and presentation when using NVDA or JAWS (i.e., other
screen readers). Compatibility or limitations across screen readers
will be discussed throughout the activities within the book.
The above libraries have been pulled apart and set up as individual
demos. These demos can be found through The Chang School’s
Distance Education website, as part of a set of resources for a local
workshop run at the university.
Toolkit:
Toolkit: Visit the Chrome store while using the Chrome web
Key Point:
Requirements
Criteria Points
Good descriptions provided for each element listed 5.0 pts
52 | Self-Test 1
2. INTRODUCTION TO
WAI-ARIA
2. Introduction to WAI-ARIA | 53
Objectives and Activities
Objectives
Activities
Source: W3C
Source: W3C
56 | What is WAI-ARIA?
Some elements of the framework can be used on their own to add
accessibility to web content (e.g., landmarks). More often, they are
combined with scripting that is used to dynamically add or remove
WAI-ARIA attributes depending on the context.
WAI-ARIA provides semantics for custom widgets and web
applications that can be understood by assistive technologies (ATs)
and conveyed to users in a “human understandable” form. For
example, HTML list markup might be used to create a navigation
bar with menus and submenus. Without WAI-ARIA a screen reader
would simply recognize the navigation bar as a collection of nested
lists. Adding WAI-ARIA menu attributes (e.g., menubar, menu,
menuitem, aria-haspopup, aria-expanded) can give the nested list
a whole new meaning, more easily understood as a means of
navigation than the list would be understood.
Source: W3C
What is WAI-ARIA? | 57
When and When Not to Use WAI-ARIA
58 | What is WAI-ARIA?
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=259
What is WAI-ARIA? | 59
Roles, States, and Properties
The semantics described earlier are created by adding roles, states,
and properties to HTML elements.
Roles
Source: W3C
Roles are typically added to HTML elements using the role attribute
as follows. In the example below, an unordered list is given a role
of menubar . Typically, this is used when creating a horizontal
navigation bar across the top of a user interface. Each list item is
given a role of menuitem .
States
Source: W3C
States are used along with roles, typically, to define its functional
status. States are much like properties, though they typically change
while an application or widget is being used (e.g., aria-checked
changes between true and false). Properties typically do not change
(e.g., aria-labelledby keeps the same value). States and
properties are all “aria-” prefixed, unlike roles.
Here are a few examples of states:
• aria-busy
• aria-checked
• aria-expanded
• aria-disabled
• aria-hidden
Properties
Source: W3C
• aria-describedby
• aria-atomic
• aria-autocomplete
• aria-colcount
• aria-colspan
• aria-controls
Here’s a video that shows how ChromeVox would read out the menu
described above:
Video: Example Menu with WAI-ARIA (0:33)
Toolkit: For a full list of roles, see section 1 in the The ARIA
Role Matrices.
Toolkit:
Definitions
Toolkit:
Validating WAI-ARIA | 75
Web-Based Validator
Chrome
Firefox
76 | Validating WAI-ARIA
WAI-ARIA Taxonomy
In addition to the full list of WAI-ARIA attributes in the specification,
the visual presentation of that list in the WAI-ARIA taxonomy can be
helpful in understanding the relationships between elements. This
image can also help those who are visual learners to see how WAI-
ARIA is organized. Click on the thumbnail below to open the full
visual taxonomy.
Figure: WAI-
ARIA
taxonomy
thumbnail.
Click to open
full-sized
image.
WAI-ARIA Taxonomy | 77
Activity 3: WAI-ARIA
Scavenger Hunt
The overall goal of this book is to provide the tools and knowledge
needed to make web interactivity accessible to screen reader users.
In this activity, you will use ChromeVox and code review to identify
WAI-ARIA used throughout the Web Accessibility Auditing
Showcase home page.
Requirements
Note: Not all ARIA-related markup starts with the “aria-” prefix.
Scan through the WAI-ARIA documentation introduced in this unit
for a listing of all potential WAI-ARIA markup you might come
across. Also, not all accessibility enhancements are WAI-ARIA. For
example, alt is an accessibility feature of the HTML img element.
You can mention these other accessibility features; however, they
will not count toward your mark on this activity.
Criteria Points
At least five instances of static WAI-ARIA being used in the page 5.0
are listed. pts
At least five instances of dynamic WAI-ARIA being used in the 5.0
page are listed. pts
Self-Test 2 | 81
3. BASIC WAI-ARIA
3. Basic WAI-ARIA | 83
Objectives and Activities
Objectives
Activities
• banner
• complementary
• contentinfo
• form
• main
• navigation
• region
• search
In the following short video, you will see how ChromeVox interacts
with landmarked regions for the next activity coming up in this unit.
Use it as a model for implementing your own landmarks. Aim to have
your activity submission operate the same as it does in the video.
Video: WAI-ARIA Landmarks Demo (1:07)
86 | WAI-ARIA Landmarks
A YouTube element has been excluded from this version of the
text. You can view it online here:
https://pressbooks.library.ryerson.ca/wafd/?p=303
WAI-ARIA Landmarks | 87
layout is just an example. The landmarks assigned to any given
region should reflect the function of that particular region,
regardless of where it might appear on the page. If advertising were
spread across a region at the bottom of the page, for example, then
that region would be assigned role="complementary" .
Example of landmarked regions of a web page:
Custom Regions
88 | WAI-ARIA Landmarks
landmark roles and is important enough that a user might want to
navigate directly to that area of the page. When it is used, it must
be accompanied by aria-label or aria-labelledby if there is
an existing element on the page that describes the region (such as a
heading).
For example, you may want to define a specific area on each
page where contact information or a contact form is located. The
following markup might be used to define a “contact region.”
Suggested Reading:
WAI-ARIA Landmarks | 89
• Using ARIA landmarks to identify regions of a page
• Page Regions (WAI Web Accessibility Tutorials)
• ARIA Landmarks Example
90 | WAI-ARIA Landmarks
Common Static WAI-ARIA
Much of the WAI-ARIA introduced so far is static. That is, it can
be written directly into HTML elements as attributes, their values
typically do not change, and they do not require scripting to control
their behaviour. Landmarks and roles, for example, are all static.
Anyone who knows how to read and write HTML can make use of
these attributes by simply adding them to HTML elements. WAI-
ARIA properties are also typically static, though not always.
As discussed earlier, static WAI-ARIA often consists of properties
given to define specific characteristics of an HTML element that
has a particular functional role. For example, a nested list may be
defined as a menu using role="menubar" to define the top-level
list and role="menu" to define sublists.
List items in the top-level list that have a nested sublist would
be given the attribute aria-haspopup="true" (or aria-
haspopup="menu" ). Thus, when encountered by assistive
technology, a list item with this attribute will announce that a
submenu is present (e.g., “menu with submenu” when using
ChromeVox).
• aria-describedby
• aria-labelledby
• aria-label
• aria-required
• aria-controls
• aria-details
• aria-haspopup
• aria-live
• aria-owns
• aria-relevant
• aria-roledescription
Dialogs
Dialogs are used like modal dialogs are, except it is still possible to
interact with the other content of the page. These are defined using
role="dialog" .
Suggested Reading:
Using Tabindex | 97
be wrapped around the menu, given tabindex="0" to make it
focusable, so, when a user navigates to the <div> , it announces
instructions for using the keyboard to navigate within the menu.
The following example demonstrates using tabindex , along with
aria-label , to provide context information. If you navigate
through the Showcase site above with ChromeVox, you’ll notice this
strategy with the side menu, announcing how to operate the menu
with a keyboard.
98 | Using Tabindex
Keyboard Interaction
Keyboard access is perhaps the most important accessibility feature
that can go into a website, widget, or web application. However, it is
often overlooked by developers, who are typically mouse users and
may not have keyboard usability as a part of their testing regimen.
People who are blind are typically unable to use a mouse, so any
feature that relies on a mouse alone to function will likely be
inaccessible to them. Fortunately, it is relatively easy to include
keyboard access. It’s more a matter of remembering to add it when
mouse access is added.
The following is a simple example of including both mouse and
keyboard events when defining interaction for a widget or web
application. Examine the JavaScript to see how mouse and keyboard
events are handled, then under the Result tab, try operating the
button with a keyboard and mouse while using ChromeVox. How
you go about implementing both mouse and keyboard doesn’t really
matter, as long as it is possible to interact with both.
You may notice some inconsistencies in ChromeVox support for
the live region used to present the messages in the example, more
specifically the aria-atomic attribute. Live regions will be
covered more thoroughly later in this unit.
Keyboard Interaction | 99
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=312
• Combobox
• Grid
• Listbox
• Menu or menu bar
• Radiogroup
• Tabs
• Toolbar
• Tree View
Application Role
Presentation Role
ChromeVox (53.0.2784.5)
Suggested Reading:
• role=”log”
• role=”marquee”
• role=”timer”
• role=”status”
Requirements
Part 1: Landmarks
The form on the page has three required fields. If you submit the
form without valid input for these fields, an error message is
generated below each field that has invalid input. Add
role="alert" to the first error message, so, when it appears, it
is automatically read by ChromeVox along with sending focus to
the first field in error so it can be corrected. Do the same for the
feedback message that appears when the form is submitted without
errors.
HINT: look in join.lib.js in the book files.
Criteria Points
Content Contained: 2.0
All content is contained within a landmarked region. pts
Correct Landmarks: 3.0
Appropriate landmarks have been used for each region. pts
Messages Announced:
The first Error/Feedback message is announced when the form
is submitted with and without invalid input. When the first 4.0
required field is corrected, the next Error/Feedback message is pts
announced, and so on, so any field with invalid content is read
aloud.
Landmarks Distinguishable:
Landmark regions with the same role are distinguishable from 1.0 pts
each other.
Total Points: 10.0
Self-Test 3 | 117
4. INTERACTIVE WAI-ARIA
(BASIC)
Objectives
Activities
◦ Suggestion box
◦ Tooltips
◦ Progress bar
• role="button"
• tabindex="0"
• aria-label="[button name]"
• aria-pressed="[true|false]"
Key Point: The code that appears under the JavaScript tab is
not exactly as it appears in the book files. The
$(document.ready{}) function at the top is copied from the
associated HTML file for the widget, and the contents of
ik_util.js have been appended, so the widget will function in
JSFiddle. You will not need to include these in the JavaScript
file from the book files that you will be editing for each
widget.
Keyboard access for the buttons is fairly simple, with no special key
press events needing to be defined.
The buttons are accessed initially with the Tab key, and the Tab key
is used to move between buttons. The Space bar or Enter keys are
used to activate and deactivate buttons. Aim to have the widget you
edit in the associated activity function like that presented in the
video (there is no associated activity for this example).
Video: Accessible Toggle Buttons
• role=’region’
• aria-live=’polite’
• aria-describedby='[id of instructions div]’
• /suggest.html
• /assets/ik_suggest.js
Requirements
Grading Rubric
Criteria Points
Initial Instructions:
2.0 pts
Instructions are provided when the country field receives focus.
Announce Suggestions Present:
The suggestion list is announced when suggestions are 2.0 pts
available.
Suggestion Instructions
1.0 pts
Instructions are provided when suggestions are available.
Keyboard Access: 5.0
A country selection can be made using only the keyboard pts
Total Points: 10.0
• role="tooltip"
• aria-hidden:[true|false]
• aria-live="polite"
• tabindex = [0|-1]
146 | Tooltips
code described below to fix the accessibility of the tooltip before
completing Activity 6 on the page that follows.
Tooltips | 147
The first thing to add to the init() function, where the tooltip
<span> element is defined, are the WAI-ARIA attributes. First,
define the tooltip with role="tooltip" . Hide the tooltip by
default with aria-hidden="true" . Also, add a live region with
aria-live="polite" , so screen readers automatically read the
tooltip when it appears. Note, the WAI-ARIA 1.1 best practices
recommend using aria-describedby within the owning element
to reference the content of a tooltip, which does not announce as
expected with current versions of Chrome. Instead, we use aria-
live , which announces correctly across all current browsers.
Next, add keyboard focus to the element the tooltip belongs to with
tabindex="0" , and add focus to .on('mouseover') , so both
a mouse hover and keyboard focus open the tooltip.
148 | Tooltips
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=336
Tooltips | 149
Recommended Keyboard Interaction for
a Tooltip
Note:
150 | Tooltips
version of the text. You can view it online here:
https://pressbooks.library.ryerson.ca/wafd/?p=336
Tooltips | 151
A YouTube element has been excluded from this version of the
text. You can view it online here:
https://pressbooks.library.ryerson.ca/wafd/?p=336
152 | Tooltips
Activity 6: Accessible
Tooltips
Accessible Tooltips
• /tooltip.html
• /assets/ik_tooltip.js
Requirements
When you have applied your changes and tested to be sure your
tooltips function as described, submit the URL to your tooltip.html
file on your GitHub Pages site, to the file on the web server you are
using to host your copy of the book files, or to a Githack URL.
Grading Rubric
Criteria Points
Tooltips Open:
Tooltips open when their owning element receives keyboard 3.0 pts
focus or mouseover.
Tooltips Read:
Tooltips read aloud when their owning element receives 3.0 pts
keyboard focus or mouseover.
Tooltips Hides:
2.0 pts
Tooltips hide when focus is removed or on mouseout.
Tooltips Escape:
2.0 pts
Tooltips hide when the Esc key is pressed.
• role="progressbar"
• tabindex = [0|-1]
• aria-valuenow = "0"
• aria-valuemin = "0"
• aria-valuemax = "[max value define in default
options]"
• aria-describedby = "[instruction ID]"
• role = "region"
• aria-live = "assertive"
• aria-atomic = "additions"
• aria-hidden = "[true|false]"
Based on the Progress Bar details on the previous page, apply what
you have learned to the associated book files to make the progress
bar there accessible.
Files for this activity include:
• /progressbar.html
• /assets/ik_progressbar.js
Requirements
When you have applied your changes and tested to be sure your
progress bar functions as described, submit the URL to your
progressbar.html file on your GitHub Pages site, to the file on the
web server you are using to host your copy of the course files, or to
a GitHack URL.
Grading Rubric
Criteria
Instructions Provided:
When the progress bar begins running, instructions are provided on how to announce pro
Keyboard Announce Progress:
The keyboard can be used to announce progress percentage.
Announce Complete:
When progress finishes, Loading Complete is announced.
Total Points:
5. Interactive WAI-ARIA
(Intermediate) | 167
Objectives and Activities
Objectives
Activities
◦ Slider
◦ Accordion
◦ Tab panel
◦ Carousel
• tabindex="[0 | -1]"
• role="slider"
• aria-valuemin="[number]"
• aria-valuemax="[number]"
• aria-valuenow="[number]"
170 | Sliders
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=349
Define some instructions that describe how to use the slider for
screen reader users.
Sliders | 171
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=349
172 | Sliders
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=349
Sliders | 173
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=349
174 | Sliders
Keyboard Interaction for a Slider
Note:
Sliders | 175
direction of the value change for the keys
specified above (e.g., having Up Arrow
decrease the value) could create a more
intuitive experience.
176 | Sliders
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=349
Sliders | 177
Accessible Slider in Action
178 | Sliders
A YouTube element has been excluded from this version of the
text. You can view it online here:
https://pressbooks.library.ryerson.ca/wafd/?p=349
Sliders | 179
Activity 8: Accessible Slider
Accessible Slider
Based on the Slider details on the previous page, apply what you
have learned to the associated book files to make the slider there
accessible.
Files for this activity include:
• /slider.html
• /assets/ik_slider.js
When you have applied your changes and tested to be sure your
slider functions as described, submit the URL to your slider.html file
on your GitHub Pages site, to the file on the web server you are
using to host your copy of the course files, or to a GitHack URL.
Grading Rubric
Criteria
Slider Focusable:
Slider thumb is keyboard focusable.
Keyboard Operable:
Slider thumb moves using Left and Right Arrow keys, and the Home and End keys.
Min/Max Values Announced:
Minimum and maximum values are announced.
Value Announced:
When the slider moves, its new value is announced.
Total Points:
182 | Accordions
functions without any accessibility features added. You can work
in JSFiddle itself by clicking “Edit in JSFiddle”, copying the
accessibility/WAI-ARIA code described below to fix the accessibility
of the accordion before completing Activity 9 on the page that
follows.
Accordions | 183
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=353
184 | Accordions
accordion is initialized, adding the region role to the init()
function.
Add a <div> inside the header (i.e., DT ) and define its role as a
button. The button is given an aria-controls attribute to define
which of the accordion panels it controls. By default the toggle
state is set to false with aria-expanded="false" to be updated
dynamically when the button is clicked or key pressed. Finally add
tabindex="0" to the button ( <div> ) to make it keyboard
focusable.
Accordions | 185
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=353
The tabindex will make the button focusable, but it will not make
it clickable. The .on() jQuery function adds a click event to the
button, but a keypress event must also be added. Adding
.on('keydown') activates the onKeyDown function, defined
below, so the accordion headers operate with both a mouse click
and a keypress.
186 | Accordions
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=353
Accordions | 187
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=353
• Enter or Space:
188 | Accordions
panel.
◦ When focus is on the accordion header
for an expanded panel, collapses the panel if
the implementation supports collapsing.
Some implementations require one panel to
be expanded at all times and allow only one
panel to be expanded; so they do not
support a collapse function.
Accordions | 189
that panel. If focus is on an accordion header,
moves focus to the previous accordion header. If
focus is on the first accordion header, either does
nothing or moves focus to the last accordion
header.
190 | Accordions
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=353
Accordions | 191
Accessible Accordion in Action
192 | Accordions
A YouTube element has been excluded from this version of the
text. You can view it online here:
https://pressbooks.library.ryerson.ca/wafd/?p=353
Accordions | 193
Activity 9: Accessible
Accordion
Accessible Accordion
• /accordion.html
• /assets/ik_accordion.js
Requirements
When you have applied your changes and tested to be sure your
accordion functions as described, submit the URL to your
accordion.html file on your GitHub Pages site, to the file on the web
server you are using to host your copy of the book files, or a GitHack
URL.
Grading Rubric
Criteria
Header Focus:
Accordion headers are keyboard focusable.
Headers as Buttons:
Accordion headers are announced as buttons instead of list items.
Open Panels:
Accordion headers open panels with a click or key press.
Expand/Collapse:
Accordions announce expanded when a panel is opened and collapsed when closed.
Panels Focusable:
Accordion panels are focusable with a Tab key press when opened.
Header Navigation:
Navigation between accordion headers with Up and Down Arrow keys, and the Tab key.
Total Points:
• role="tablist"
• role="tabpanel"
• role="tab"
• aria-hidden="[true|false]"
• tabindex = [0 | -1]
• aria-controls="[panel id]"
• aria-selected="[true|false]"
The tabs themselves are now defined, replacing the list item
semantics with tab semantics adding role="tab" to each of the
<li> elements generated. We also need to define which tab
controls which tabpanel, dynamically generating aria-
controls="[panel_id]" for each of the tabs.
Note:
Based on the Tab Panel details on the previous page, apply what you
have learned to the associated book files to make the tab panel there
accessible.
Files for this activity include:
• /tabs.html
• /assets/ik_tabs.js
Requirements
When you have applied your changes and tested to ensure your tab
panel functions as described, submit the URL to your tabs.html file
on your GitHub Pages site, to the file on the web server you are
using to host your copy of the book files, or a GitHack URL.
Grading Rubric
Criteria Points
List to Tab Semantics: 2.0
List semantics are replaced with tab panel semantics. pts
Tab Position:
1.0 pts
Focus position in the tablist is announced.
Tab Focus opens Panel:
1.0 pts
When a tab is in focus, its associated panel displays.
Arrow Key Between Tabs: 2.0
Arrow keys can be used to navigate between tabs. pts
Tab Key from Tab to Panel:
2.0
Tab key can be used to move from a selected tab directly to its
pts
associated panel, Shift+Tab to move back to tabs.
Panels Focusable: 2.0
Panels are keyboard focusable. pts
Total Points: 10.0
• role="region"
• aria-live="polite"
• tabindex="0"
• aria-describedby="[id of div with instructions]"
• aria-hidden="(true|false)"
Carousels | 209
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=362
210 | Carousels
navigation. In our case, we’ll add a few words and assign them to
the “instructions” variable in the default settings of the init()
function for the carousel. The instructions will be rendered in its
own <div> and referenced with aria-describedby a little later
in the code.
Carousels | 211
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=362
Hide images from screen readers. Notice that the alt text for
the images are defined in the HTML but left empty so it is not read
in this case. Screen readers will read the figcaptions .
212 | Carousels
Add an aria-live attribute to the stopTimer function. Set its
value to polite so content updating in the live region announces
when a screen reader is not reading elsewhere on the page. The
content of the visible carousel panel is read automatically when it is
in focus, manually navigating between panels with the Arrow keys.
Carousels | 213
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=362
214 | Carousels
An interactive or media element has been excluded
from this version of the text. You can view it online
here:
https://pressbooks.library.ryerson.ca/wafd/?p=362
Carousels | 215
Accessible Carousel in Action
216 | Carousels
Activity 11: Accessible
Carousel
Accessible Carousel
• /carousel.html
• /assets/ik_carousel.js
Requirements
When you have applied your changes and tested to ensure your
carousel functions as described, submit the URL to your
carousel.html file on your GitHub Pages site, to the file on the
web server you are using to host your copy of the book files, or
a GitHack URL.
Grading Rubric
Criteria
Instructions Provided
Screen reader instructions are provided when carousel receives focus.
Carousel Focusable
Carousel panels are keyboard focusable.
Carousel Navigation
Navigate between panels with the Left and Right Arrow keys.
Panels Read Aloud
While the carousel has focus, each panel reads aloud when it comes into view.
Manual while in Focus
When in focus, or while a mouse pointer is hovering over the carousel, panels rotate manu
Total Points:
6. Interactive WAI-ARIA
(Advanced) | 219
Objectives and Activities
Objectives
Activities
◦ Menu bar
◦ Tree menu
◦ Sortable list
• aria-hidden = [true|false]
• role = "menubar"
• role = "menu"
• role = "menuitem"
• aria-labelledby = "[instruction div id]"
• aria-label = [link text]
• tabindex = [0 | -1]
• aria-haspopup = "true"
• aria-expanded = "[true|false]"
• aria-selected = "[true|false]"
For all the menu items in the menu bar that have submenus,
add role="menu" to their <ul> and hide them by default using
aria-hidden="true" . This can be located after the
$elem.find('ul:eq(0)') block presented immediately above.
Hide the links in the menu items from screen readers by default
using tabindex="-1" and setting aria-hidden="true" .
For each of the menu items that has a submenu, add aria-
haspopup="true" to announce the presence of the submenu, and
set its default state to “collapsed” by adding aria-
expanded="false" .
• Space:
• Down Arrow:
• Up Arrow:
• Right Arrow:
• Left Arrow:
• /menu.html
• /assets/ik_menu.js
Requirements
When you have applied your changes and tested to be sure your
menu bar functions as described, submit the URL to your menu.html
file on your GitHub Pages site, to the file on the web server you are
using to host your copy of the book files, or a GitHack URL.
Grading Rubric
Criteria Points
Instructions Provided:
Instructions are announced on how to use the menu bar with a 1.0 pts
keyboard, when the menu bar first receives focus.
Focus Control:
2.0
Only elements of the menu bar that are in view are able to
pts
receive focus.
Keyboard Operable:
3.0
As described in Adding Keyboard Operability for a menu bar, the
pts
menu bar functions using a keyboard (and mouse).
Total Points: 10.0
• tabindex = [0 | -1]
• aria-labelledby = [instruction div id | title div id]
• aria-hidden = [true | false]
• role = "tree"
• role = "treeitem"
• role = "presentation"
• aria-level = [number of parent ULs]
• aria-setsize = [number of LIs in a level]
• aria-posinset = [position of each LI in a set]
• aria-expanded = [true | false]
• aria-selected = [true | false]
Within the init() function, for each tree item use the text of
the associated span element as its label. To ensure both the label
Much like the menu bar described in the previous activity, keyboard
operability for a tree menu can be complex, with various operations
using multiple key strokes to perform the same function. W3C
• Right Arrow:
• Left Arrow:
Note:
For the tree menu created here, we’ve added in basic keyboard
operability. Keyboard operation includes: Up and Down, and Left
and Right Arrows for navigating within the tree, and the Enter or
Space bar keys to toggle submenus open or closed. The Tab key
by default enters and exits the tree menu and does not need to be
defined as part of the keyboard operability of the tree menu.
• /tree.html
• /assets/ik_treemenu.js
Requirements
When you have applied your changes and tested to be sure your
tree menu functions as described, submit the URL to your tree.html
file on your GitHub Pages site, to the file on the web server you are
using to host your copy of the book files, or a GitHack URL.
Activity 13: Accessible Tree
Navigation | 257
Grading Rubric
Criteria Points
Instructions Provided:
When the tree menu receives focus, instructions are 1.0 pts
announced on how to use the menu with a keyboard.
Tree Menu Semantics:
When navigating through the tree menu with a keyboard, 2.0 pts
elements are announced with tree menu semantics.
Tree Submenus:
When a tree menu item with a submenu receive focus, the
2.0 pts
submenu state is announced as expanded when open or
collapsed when closed.
Focus Control:
Only elements of the tree menu that are in view are able to 2.0 pts
receive focus.
Keyboard Operable:
Tree menu functions with a keyboard as described in Adding 3.0 pts
Keyboard Operability for tree menus.
Total Points: 10.0
• role = “list”
• role = “listitem”
• tabindex = “[0 | -1]”
• aria-labelledby = “[instruction div id]”
• aria-hidden = “[true | false]”
Where the draggable attributes are defined near the end of the
init() function, attach a keydown reference to the
onKeyDown() function to make the list draggable with a keyboard.
• /sortable.html
• /assets/ik_sortable.js
When you have applied your changes and tested to be sure your
sortable list functions as described, submit the URL to your
sortable.html file on your GitHub Pages site, to the file on the web
server you are using to host your copy of the book files, or a GitHack
URL.
Grading Rubric
Criteria Points
Instructions Provided:
Instructions are announced on using the sortable list with a 1.0 pts
keyboard when it first receives focus.
Movable List Items:
2.0
When navigating through list items, their position is announced
pts
along with an indication they can be moved.
List Items are Sortable:
Using the keyboard operation described in Adding Keyboard 3.0
Operability for sortable lists, list items can be moved without pts
using a mouse.
Moved position: 4.0
When a list items is moved, its new position is announced. pts
Total Points: 10.0
Chapter 1 Summary
Chapter 2 Summary
Chapter 3 Summary
Chapter 4 Summary
In Chapter 4 and the two chapters that follow, the focus moved
to practical implementation of WAI-ARIA, looking at specific
interactions and the types of information that need to be available
to assistive technologies to ensure these interactions are accessible
to users of these AT.
In this unit, we looked specifically at:
Chapter 5 Summary
Chapter 6 Summary
• Join GitHub
• SourceTree
• GitHub Desktop
• jQuery UI Accessibility Enhancements
• Accessible MooTools Widgets
• WAI-ARIA Authoring Practices 1.1
• ARIA Techniques for WCAG 2.0
• Using WAI-ARIA
• ChromeVox Screen Reader
• ChromeVox_Key_Commands (Word)
• The ARIA Role Matrices
• WAI-ARIA Screen Reader Compatibility
• WAI-ARIA Browser Compatibility
• ARIA Alert Support
• User Agent Support Notes for ARIA Techniques
• W3C HTML Validator
• Chrome Developer Tools
• Lighthouse
• ARIA Validator
• aXe (for Chrome)
Self-Test 1
Self-Test 2
Self-Test 3
1. Which of the following are landmark roles? Choose all that apply.
[Incorrect] a. menu
[Correct] b. navigation
[Incorrect] c. aria-label
[Incorrect] d. tabindex
[Incorrect] e. aria-describedby
[Incorrect] f. aria-checked
[Correct] g. complementary
[Incorrect] h. footer
[Correct] i. banner
Feedback: Navigation, complementary, and banner are
landmark roles.
2. Which would usually be the best approach to provide
feedback to a screen reader user with a message that an
operation just completed was successful or has failed
presenting an error message?
[Incorrect] a. aria-live=”polite”
[Correct] b. role=”alert”
[Incorrect] c. role=”alertdialog”
[Correct] a. Predictable
[Incorrect] b. Redundant
[Incorrect] c. Easy
[Correct] d. Consistent
[Correct] e. Conventional
Feedback: Keyboard interaction should be predictable,
consistent, and conventional.
4. Which of the following WAI-ARIA roles, when active, would
disable keyboard access to the file menu in a web browser?
[Correct] a. Application
[Incorrect] b. Menu
[Incorrect] c. Menubar
[Incorrect] d. Navigation
[Incorrect] e. Presentation
Feedback: The Application role would disable the browser’s
file menu.
5. When role=”presentation” is used on an unordered list element,
semantics for which of the following elements would be fully
suppressed? Choose all that apply.
<ul role=”presentation”>…</ul>
[Correct] a. UL
[Correct] b. UL>LI
[Incorrect] c. UL>LI>UL
[Incorrect] d. UL>LI>OL
[Incorrect] e. UL>LI>UL>LI
[Correct] a. role=”alert”
[Correct] b. aria-live=”polite”
[Correct] c. role=”timer”
[Correct] d. role=”log”
[Incorrect] e. role=”live-region”
Feedback: All except the last choice will create live regions.
role=”live-region” is not a WAI-ARIA role or live region.
7. Which of the following would be good candidates for a live
region? Choose all that apply.
[Incorrect] a. A timer counting down by seconds
[Correct] b. A dynamically injected feedback message
[Correct] c. A news feed from a local news provider
[Correct] d. A twitter feed that receives occasional updates
[Correct] e. A chat application, for communicating in real time
Feedback: A timer may also be a live region, but counting
down by seconds may make the content on the page it is
embedded in unusable. A timer counting down by minutes
(e.g., minutes until the end of a quiz) would be a better
candidate.
Back to Self-Test 3
286 | Acknowledgements