Part 11 · 2 chapters · ~12 min

Accessibility

From the standard to the user: WCAG and POUR, the accessibility tree with roles, names and ARIA, screen readers and live regions, focus and keyboard models, contrast and motion, and audits.

24

The standard, the tree and the reader

What WCAG asks, what the browser builds for assistive tech, and how screen readers use it.

WCAG

WCAG 2.2Perceivable1.4.3…Operable2.1.1…Understand…Robustprinciples → guidelines → success criteria

The Web Content Accessibility Guidelines: testable success criteria under four principles (POUR) at levels A, AA and AAA; AA is the usual legal target.

in practiceWCAG 2.2 AA in procurement, the EU Accessibility Act and the ADA; audit reports citing criteria like 1.4.3.

deep dive: Disciplines P0

POUR

PerceivableOperableUnderstandableRobust

Perceivable, Operable, Understandable, Robust: the four principles every WCAG criterion sits under.

in practiceA quick lens in design review: can it be seen or heard, used, understood, and read by assistive tech?

deep dive: Disciplines P0

Accessibility tree

WebArea "Checkout"navigationmainheading…button …

The tree the browser derives from the DOM and ARIA for assistive technology: each node with a role, name, state and value.

in practiceThe Accessibility pane in DevTools; what a screen reader actually reads, which may differ from what you see.

deep dive: Disciplines P0

Role

<div onClick>role: genericnot focusableno keyboard<button>role: buttonfocusableEnter and Space

What an element is to assistive tech (button, link, checkbox, dialog, tab), from native HTML semantics or an ARIA role.

in practiceA div with onClick has no role: it is invisible as a control to screen readers.

deep dive: Disciplines P0

Accessible name

aria-labelledbywinsaria-label<label> / contenttitlelast…

The text assistive tech announces for an element, computed from aria-labelledby, aria-label, the label element, content or title, in that order.

in practiceIcon buttons with no name ("button" read aloud); getByRole name matching in tests.

deep dive: Disciplines P0

ARIA

role="tab"what it isaria-selected="true"its statearia-controls="panel-2"its relationship(no behaviour)you still write the keyboard

Accessible Rich Internet Applications: attributes that add or change roles, names, states and relationships in the accessibility tree; they change nothing else.

in practicearia-expanded on disclosure buttons, aria-live regions; the first rule: use native HTML when it exists.

deep dive: Disciplines P0

Landmarks

banner (header)navigation (nav)maincomplementary (aside)contentinfo (footer)

Regions (banner, navigation, main, complementary, contentinfo, search) that let screen reader users jump around a page.

in practiceheader, nav, main, aside and footer elements; the rotor's landmarks list in VoiceOver.

deep dive: Disciplines P1

Heading structure

h1 Checkout h2 Delivery h2 Payment h3 Card details

A logical outline of h1 to h6 that screen reader users navigate by; levels show hierarchy, not font size.

in practiceThe headings rotor; skipped levels and visual-only headings in audits.

deep dive: Disciplines P1

Screen reader

DOM + AR…accessib…platform…screen r…speech, bra…

Software that reads the accessibility tree aloud or to braille and provides its own navigation (by heading, landmark, link, form field).

in practiceVoiceOver (Apple), NVDA and JAWS (Windows), TalkBack (Android); browse mode versus focus mode.

deep dive: Disciplines P1

Browse vs focus mode

browse modearrows move thereader's cursorH jumps headingsfocus modekeys go to thepage: forms, widgetsyour handlers run

Screen readers on Windows read pages with their own virtual cursor (browse) and pass keys to the page only in form fields and widgets (focus).

in practiceWhy custom keyboard handlers do not fire for screen reader users until focus mode; role="application" misuse.

deep dive: Disciplines P1

Live region

pagelive regionscreen readertext: "Saved"announce (polite)focus unchanged

An element whose changes are announced without moving focus (aria-live polite or assertive, role status or alert).

in practice"3 results", "Saved", form error summaries, toasts; must exist before content is injected.

deep dive: Disciplines P2

Accessible description

<input id="pw" aria-describedby="pw-hint pw-err"><p id="pw-hint">At least 12 characters</p><p id="pw-err">Too short</p>// "Password, edit text, At least 12…, Too short"

Extra text announced after the name and role (aria-describedby), for hints and errors.

in practicePassword rules and inline errors linked to the input.

deep dive: Disciplines P2
THE ACCESSIBILITY LAYER, IN ORDER
from the standard to the tree, the reader, the keyboard, the eye and the audit
swipe the figure sideways, or tap expand for full screen
1/6
standard
Standard: WCAG's criteria sit under four principles; AA is the usual legal bar.
25

Keyboard, perception and audits

Focus and keyboard models, the visual requirements, and how products are evaluated.

Focus

linkinputbuttonfocusedlinkTab moves forward in DOM order

The single element receiving keyboard input; moved by Tab, by clicks and by script.

in practicedocument.activeElement; focus lost to body after a modal closes or a list item is deleted.

deep dive: Disciplines P1

Focus visible

outline: nonekeyboard userslose their place:focus-visible ring2px offset ringkeyboard only

A clearly visible indicator on the focused element; :focus-visible shows it for keyboard users without showing it on mouse clicks.

in practiceoutline: none with no replacement, the most common keyboard failure; WCAG 2.4.7 and 2.4.11.

deep dive: Disciplines P1

Tab order and tabindex

tabindex="0"in tab order, DOM positiontabindex="-1"focusable by script onlytabindex="3"jumps the queue: avoid

Focus moves in DOM order; tabindex="0" adds an element to it, "-1" makes it focusable by script only, positive values are an anti-pattern.

in practiceVisual order that differs from DOM order (CSS grid reordering) confusing keyboard users.

deep dive: Disciplines P1

Focus trap

close ×field 1field 2SaveTab wraps inside; Esc closes; focus returns

Keeping focus inside a modal dialog while it is open, and returning it to the trigger when it closes.

in practiceThe dialog element with showModal(), or inert on the background; focus returning to the button that opened it.

deep dive: Disciplines P1

inert

<main inert>not focusablenot clickablenot in a11y tree<dialog open>the onlyinteractive region

An attribute that makes a subtree unfocusable, unclickable and hidden from assistive tech.

in practiceMaking the page behind a modal or drawer inert; off-screen carousel slides.

deep dive: Disciplines P1

Roving tabindex

tab 1-1tab 20 (active)tab 3-1arrows move the 0; Tab leaves the group

In a composite widget (toolbar, tabs, grid), one item has tabindex 0 and the rest -1; arrow keys move it, so Tab enters and leaves the widget in one stop.

in practiceTab lists, menus, radio groups, data grids.

deep dive: Disciplines P1

Contrast ratio

failAA larg…AA bodyAAA4.5 : 1

The luminance ratio between text and background, from 1:1 to 21:1; AA needs 4.5:1 for body text and 3:1 for large text and UI parts.

in practiceThe contrast picker in DevTools; grey placeholder text failing; brand colours that need a darker text shade.

deep dive: Disciplines P2

Use of colour

colour onlyred border(8% of mencannot tell)colour + text + icon⚠ red border"Enter a validemail"

Meaning must not depend on colour alone: errors need text or icons too, links need more than a hue difference.

in practiceRed-only error borders; charts distinguished only by colour; WCAG 1.4.1.

deep dive: Disciplines P2

prefers-reduced-motion

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; }}

A media query reflecting the OS setting to reduce motion; parallax, large slides and autoplay should stop or soften.

in practiceVestibular disorders triggered by large movement; replacing slides with fades.

deep dive: Disciplines P2

Target size

16 × 16 iconfails 2.5.824 × 24AA minimum44 × 44comfortable (Apple HIG)

Interactive targets large enough to hit: WCAG 2.2 AA asks for at least 24 by 24 CSS pixels or enough spacing; 44 to 48 is the comfortable norm.

in practiceTiny close buttons and icon rows on mobile.

deep dive: Disciplines P2

Accessibility audit

automatedaxe ~1/3manualkeyboard, SRusersdisabled te…reportcriteria, f…

A structured evaluation of a product against WCAG with automated tools, manual keyboard and screen reader passes, and users with disabilities.

in practiceVPAT and ACR documents for enterprise sales; the quarterly audit plus the CI gate in between.

deep dive: Disciplines P3