[Draft] Module 6: Widgets
Introduction
Courses based on this module:
- explain use of WAI-ARIA roles, states, and properties to create common accessible rich internet applications
- explain additional techniques to allow for keyboard navigation in complex widgets
Learning Outcomes for Module
Students should be able to:
- explain how WAI-ARIA allows text-to-speech technologies to make complex widgets accessible
- code accessibility properties of non-standard HTML widgets
- manage focus of widgets that are not focusable by default
- code additional states of widgets
- mark up dynamic changes in web pages
Competencies
Skills required for this module.
Students:
- Demonstrated completion of courses that include:
- Basic knowledge of:
Instructors:
- Applied expertise in teaching:
- WCAG 2 Success Criterion 1.4.13 Content on Hover or Focus
- WCAG 2 Success Criterion 2.1.4 Character Key Shortcuts
- WCAG 2 Success Criteria 2.2.2 Pause, Stop, Hide
- WCAG 2 Success Criterion 2.5.1 Pointer Gestures
- WCAG 2 Success Criterion 2.5.2 Pointer Cancellation
- WCAG 2 Success Criterion 2.5.3 Label in Name
- WCAG 2 Success Criterion 2.5.4 Motion Actuation
- WCAG 2 Success Criterion 3.2.1 On Focus
- WCAG 2 Success Criterion 4.1.1 Parsing
- WCAG 2 Success Criterion 4.1.2 Name, Role, Value
- HTML5 living standard
- WAI-ARIA specification
- WAI-ARIA Authoring Practices 1.1
- In-depth knowledge of:
Topics to Teach
Optional topics to achieve the learning outcomes.
Topic: WAI-ARIA Specification
Explain the purpose and scope of the WAI-Aria specification. Describe its different parts and present some scenarios for its usage, such as expanding native semantics of host languages.
Learning Outcomes for Topic
Students should be able to:
- explain the purpose and scope of the WAI-ARIA specification
- explain the purpose of WAI-ARIA roles, as well as categories of roles
- explain the purpose of WAI-ARIA states and properties
Teaching Ideas for Topic
Optional ideas to teach the learning outcomes:
- Define WAI-Aria as a set of roles, states, properties, and values to improve the accessibility of web content and applications. Emphasize that it does not substitute existing semantics of host languages where it is used, but complements and expands them. For reference on the WAI-ARIA specification, see WAI-ARIA overview.
- Show examples of WAI-ARIA roles applied to different types of widgets. For example, landmark, widget, document structure, or window roles. For reference on the different categories of WAI-ARIA roles, see the WAI-ARIA specification, Categorization of roles.
- Explain use of supported states and properties of WAI-ARIA in different applications. Mention that state values are more likely to change due to user interaction, whereas property values are meant to last through the application life-cycle. For reference on the WAI-ARIA states and properties, see the WAI-ARIA specification, Supported states and properties.
Ideas to Assess Knowledge for Topic
- Short Answer Questions — Students are asked about the different categories of roles that exist in the WAI-ARIA specification. Assess students’ knowledge of the available roles in the WAI-ARIA specification.
- Short Answer Questions — Students are asked about the difference between WAI-ARIA states and properties. Assess students’ knowledge of the differences between states and properties.
- Practical — Students are presented with different widgets and are asked to decide which WAI-ARIA roles and properties they should have. Assess students’ understanding of the purpose and scope of the WAI-ARIA specification.
Topic: Programmatic and Visual Focus
Explain how to add or remove focus to widgets that are not focusable by default. Emphasize that focus management is essential for keyboard, screen reader, and voice recognition software users to interact with non-standard widgets.
Learning Outcomes for Topic
Students should be able to:
- add focus to an element that is not focusable by default using the HTML attribute
tabindex="0"
- remove focus from an element that is not focusable by default using the HTML attribute
tabindex="-1"
- add event listeners to a component that is not focusable by default to allow for keyboard interaction
- add focus indicators using CSS styles attached to the focused state
Teaching Ideas for Topic
Optional ideas to teach the learning outcomes.
- Demonstrate use of the
tabindex
attribute to indicate if an element can or cannot be focusable. Explain use of the value-1
to mark an element so that it can be focusable when it becomes visible or available via scripts. Explain use of the value0
to make an element focusable and put it in the relative order of the navigation according to the DOM structure. For reference on how to use thetabindex
attribute, see the WAI-ARIA Authoring Practices, Managing focus within components using a roving tabindex. - Demonstrate use of event listeners that allow for several ways of interaction. For example, keyboard, mouse, and tactile gestures. Emphasize that, in addition to making an element focusable, it is also necessary to take care of all additional functionality, such as which keys need to be pressed to activate it. For a pointer on what additional functionality needs to be added to a custom widget to allow keyboard functionality, see A role is a promise.
- Demonstrate use of focus indicators for users to keep track of where they are as they are interacting with the widget. Mention that providing the specific styles is a shared responsibility among different team members: designers, and developers. For reference on how to make navigation predictable within widgets, see Discernible and predictable keyboard focus.
Ideas to Assess Knowledge for Topic
Optional ideas to support assessment.
- Short Answer Questions — Students are asked what the values of the
tabindex
element can be and what each of them means. Assess students’ knowledge of thetabindex
element and its values. - Practical — Students are presented with a non-standard button and are asked to code it using WAI-ARIA roles,
tabindex
attribute, and event listeners for keyboard, mouse, and tactile devices. Assess students understanding of the different ways in which users can interact with non-standard widgets.
Topic: Additional States of a widget
Describe additional states of a widget such as selected
, pressed
, expanded
, or collapsed
. Explain how to make them distinguishable from the focused
state.
Learning Outcomes for Topic
Students should be able to:
- code the
expanded
orcollapsed
states using thearia-expanded
attribute - code the
checked
state using thearia-checked
attribute - code the
selected
state using thearia-selected
attribute and styles different than those of the \focused\ state - code the
pressed
state using thearia-pressed
attribute
Teaching Ideas for Topic
Optional ideas to teach the learning outcomes.
- Demonstrate use of the WAI-ARIA attribute
aria-expanded
to convey if associated sections of a widget are visible or hidden. Mention examples of widgets where this attribute can be used, such as menus or accordions. For reference on how to use the WAI-ARIA attributearia-expanded
, see the WAI-ARIA authoring practices, Accordion (sections with show/hide functionality). - Show examples of non-standard checkboxes. Mention use of the WAI-ARIA attribute
aria-checked
to communicate the state of the checkbox. For reference on how to use the WAI-ARIA attributearia-checked
, see the WAI-ARIA authoring practices, Checkbox. - Demonstrate differences between
focused
andselected
states, such as those in listboxes or menus. Indicate that a clear distinction should be made between these two states, such as using the WAI-ARIA attributearia-selected
to convey the state of the selection and applying different styles for each. Mention that providing the specific styles is a shared responsibility among different team members: designers, and developers. For reference on how to communicate the selected state, see the WAI-ARIA authoring practices, Listbox. - Show examples of toolbars where the
pressed
state is visually conveyed. Indicate that it is necessary to communicate that information using the WAI-ARIA attributearia-pressed
. For reference on how to code thepressed
state, see the WAI-ARIA authoring practices, Toolbar.
Ideas to Assess Knowledge for Topic
- Practical — Students are asked to make an accordion accessible using
aria-expanded
where applicable. Assess students’ understanding of how to code theexpand
andcollapsed
states. - Practical — Students are asked to make a non-standard check box accessible using
aria-checked
androle="checkbox". Assess students' understanding of how to code the
checked and ` unchecked` states. - Practical — Students are asked to code an accessible non-standard list box using the focused and selected states where appropriate. Assess students’ understanding of how to code the difference between
focused
andselected
states. - Practical — Students are asked to code an accessible toolbar using \aria-pressed\ when necessary. Assess students’ knowledge of how to code the
pressed
state.
Topic: Dynamic Changes
Explain mechanisms to notify users about dynamic changes on a page.
Learning Outcomes for Topic
Students should be able to:
- code alerts and warnings on the page using the WAI-ARIA
role="alert"
- code the regions of the page that contain the dynamic changes using the WAI-ARIA attribute
aria-live
- mark up the level of priority for the updates using the values
polite
,assertive
, oroff
in the WAI-ARIA attributearia-live
- mark up the region to be announced as a whole or only parts using the WAI-ARIA attribute
aria-atomic
- mark up additions, removals, or all changes in the node to be announced using the attribute
aria-relevant
Teaching Ideas for Topic
Optional ideas to achieve the learning outcomes.
- Show examples of alerts and warnings on a page, such as a time warning or an error. Explain that these alerts may not be noticed while using assistive technologies, so additional markup is required. For reference on how to code these alerts, see the WAI-ARIA authoring practices Alert.
- Show examples of dynamic regions of a web page, such as carousels, chat logs, or feeds. Explain that screen reader users cannot perceive these types of updates by default as they can only be focused at one thing at a time. For reference on how to communicate the changes using
aria-live
, see the WAI-ARIA authoring practices, Auto-rotating image carousel. - Explain use of the
role="alert"
to mark up a region as dynamic. Show examples of messages that can be included in those regions, such as information about new loaded contents on a page, or about the item that is currently visible within a set of slides. - Demonstrate use of the WAI-ARIAattribute
aria-live
together with its values to indicate the priority with which updates are announced. For reference on the meaning of the different values of the WAI-ARIA attributearia-live
, see the WAI-ARIA specification,aria-atomic
. - Explain use of the WAI-ARIA attribute
aria-relevant
to communicate which changes of the node should be announced: additions, removals, or all. For reference on how to usearia-relevant
, see the WAI-ARIA specification,aria-relevant
.
Ideas to Assess Knowledge for Topic
Optional ideas to support assessment.
- Practical, — Students are presented with a widget containing an alert and are asked to code it appropriately. Assess students’ knowledge of
role="alert"
. - Practical — Students are presented with a chat log and are asked to code it appropriately so that it can be understood by users of text-to-speech. Assess students’ knowledge of the types of live regions as well as its roles and properties.
Ideas to Assess Knowledge for Module
Optional ideas to teach the learning outcomes.
- Portfolio — Students add non-standard widgets to the website they are building. Assess students’ knowledge of the WAI-ARIA roles and properties to expand semantics of host languages as well as additional states and keyboard conventions to allow for multiple ways of interaction.
Teaching Resources
Suggested resources to support your teaching:
- How People with Disabilities Use the Web — Provides stories of people with disabilities using the Web; describes types of disabilities and some of the barriers that people encounter using the Web; and introduces types of assistive technologies and adaptive strategies that some people use.
- WAI-ARIA Authoring Practices 1.1 – Provides readers with an understanding of how to use WAI-ARIA 1.1 to create accessible rich internet applications.
- WCAG — Address accessibility of web content on desktops, laptops, tablets, and mobile devices.
- WAI ARIA — Provides an ontology of roles, states, and properties that define accessible user interface elements and can be used to improve the accessibility and interoperability of web content and applications.
- HTML specification — The core markup language for the web, HTML, as well as numerous APIs like Web Sockets, Web Workers, localStorage, etc.
- Web Accessibility Perspectives (videos) — Is a series of 1-minute videos that demonstrate that web accessibility is essential for people with disabilities and useful for all. They show accessibility features, how they impact people with disabilities, and how they benefit everyone in a variety of situations.