Skip to content

Commit 600cfda

Browse files
scottaoharaCopilot
andauthored
Clarify accessibility criteria descriptions (#1405)
* Clarify accessibility criteria descriptions I have not been able to look through everything in the accessibility instruction file. But the changes I'm submitting attempt to clarify / correct content that needed it. * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @scottaohara * Apply suggestion from @scottaohara --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent de50693 commit 600cfda

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

instructions/a11y.instructions.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ Comprehensive accessibility rules for web application development. Every anti-pa
2525
| 1.2.1 Audio/Video-only | A | Provide transcript (audio) or text alternative (video). |
2626
| 1.2.2 Captions (Prerecorded) | A | All prerecorded video has synchronized captions. |
2727
| 1.3.1 Info and Relationships | A | Structure (headings, lists, tables, labels, landmarks) programmatically conveyed. |
28-
| 1.3.2 Meaningful Sequence | A | DOM reading order matches visual order. |
28+
| 1.3.2 Meaningful Sequence | A | When the sequence that content is presented affects its meaning, the visual and programmatic ordering of content should align. |
2929
| 1.3.3 Sensory Characteristics | A | Instructions don't rely solely on shape, size, position, or sound. |
30-
| 1.3.4 Orientation | AA | Content not restricted to single orientation unless essential. |
31-
| 1.3.5 Identify Input Purpose | AA | Input fields have `autocomplete` attributes for user data (name, email, tel). |
30+
| 1.3.4 Orientation | AA | Content is not restricted to single orientation unless essential. |
31+
| 1.3.5 Identify Input Purpose | AA | Input fields have `autocomplete` attributes when collecting information about the user. |
3232
| 1.4.1 Use of Color | A | Color is not the only means of conveying info. |
3333
| 1.4.3 Contrast (Minimum) | AA | Text: 4.5:1 normal, 3:1 large (18pt / 14pt bold). |
34-
| 1.4.4 Resize Text | AA | Text resizable to 200% without loss of content. |
35-
| 1.4.10 Reflow | AA | Content reflows at 320px CSS width (no horizontal scroll). |
34+
| 1.4.4 Resize Text | AA | Text resizable to 200% without loss of content or functionality. |
35+
| 1.4.10 Reflow | AA | Sections of content can fit within 320px CSS width viewports without needing to scroll in two dimensions to read. |
3636
| 1.4.11 Non-text Contrast | AA | UI components and graphics: 3:1 against adjacent colors. |
37-
| 1.4.12 Text Spacing | AA | No loss of content with overridden line-height (1.5x), spacing. |
38-
| 1.4.13 Content on Hover/Focus | AA | Tooltips: dismissible, hoverable, persistent. |
37+
| 1.4.12 Text Spacing | AA | No loss of content or functionality with user-overridden line-height (1.5x), or specified paragraph spacing, letter spacing, and word spacing adjustments. |
38+
| 1.4.13 Content on Hover/Focus | AA | Popup content that appears on hover or focus is: dismissible, hoverable, persistent. |
3939

4040
### Operable
4141

@@ -52,13 +52,13 @@ Comprehensive accessibility rules for web application development. Every anti-pa
5252
| 2.4.4 Link Purpose | A | Link purpose determinable from text or context. |
5353
| 2.4.6 Headings and Labels | AA | Headings and labels describe topic or purpose. |
5454
| 2.4.7 Focus Visible | AA | Keyboard focus indicator is visible. |
55-
| 2.4.11 Focus Not Obscured | AA | Focused element not entirely hidden by sticky headers/footers. *(New in 2.2)* |
55+
| 2.4.11 Focus Not Obscured | AA | Focused element not entirely hidden by other overlaying elements (such as sticky headers or footers). *(New in 2.2)* |
5656
| 2.5.1 Pointer Gestures | A | Multi-point gestures have single-pointer alternative. |
57-
| 2.5.2 Pointer Cancellation | A | Activation on up-event, not down-event. |
58-
| 2.5.3 Label in Name | A | Accessible name contains the visible label text. |
57+
| 2.5.2 Pointer Cancellation | A | Activation on up-event, unless activation can be aborted, reversed, or down-event activation is essential. |
58+
| 2.5.3 Label in Name | A | Accessible name contains the label text as it is visually presented. |
5959
| 2.5.4 Motion Actuation | A | Device motion has UI alternative and can be disabled. |
6060
| 2.5.7 Dragging Movements | AA | Drag-and-drop has click/tap alternative. *(New in 2.2)* |
61-
| 2.5.8 Target Size (Minimum) | AA | Touch targets at least 24x24 CSS px. *(New in 2.2)* |
61+
| 2.5.8 Target Size (Minimum) | AA | Interactive controls have a target size, or spacing of at least 24x24 CSS px. *(New in 2.2)* |
6262

6363
### Understandable
6464

@@ -102,7 +102,7 @@ Comprehensive accessibility rules for web application development. Every anti-pa
102102
## Five Rules of ARIA
103103

104104
1. **Prefer native HTML** — Use `<button>` not `<div role="button">`. Native elements have built-in keyboard, focus, and semantics.
105-
2. **Don't change native semantics** — Don't add `role="heading"` to a `<button>`. Use the correct element.
105+
2. **Don't change native semantics where prohibited** — Don't add `role="heading"` to a `<button>`. Use the correct element.
106106
3. **All ARIA controls must be keyboard operable** — If `role="button"`, handle Enter and Space key events.
107107
4. **Don't use `aria-hidden="true"` on focusable elements** — Hidden from assistive tech but still focusable creates a "ghost" element.
108108
5. **All interactive elements need an accessible name** — Via label, `aria-label`, `aria-labelledby`, or visible text content.
@@ -147,7 +147,7 @@ Maintain logical nesting: `h1 > h2 > h3 > h4`. Style headings with CSS, not by c
147147

148148
- **Severity**: IMPORTANT
149149
- **Detection**: Pages using only `<div>` without `<nav>`, `<main>`, `<header>`, `<footer>`
150-
- **WCAG**: 1.3.1 (A), 2.4.1 (A)
150+
- **WCAG**: Best practice (supports 1.3.1, 2.4.1)
151151

152152
```html
153153
<!-- GOOD -->
@@ -230,15 +230,15 @@ Remove redundant ARIA. `<button>` already has `role="button"`.
230230
- **Detection**: `aria-hidden="true"` on focusable elements (button, input, a, [tabindex])
231231
- **WCAG**: ARIA Rule 4
232232

233-
Use `inert` attribute or remove from tab order entirely.
233+
Do not leave focusable elements inside `aria-hidden="true"` content or use `aria-hidden="true"` on focusable elements. Rather, for native controls that support it, such as `<button>` or `<input>`, use `disabled` if disabling the control is the intended behavior. For `<a>` elements or arbitrary elements made focusable with `[tabindex]`, remove focusability instead (for example, remove `href` or `tabindex`). If the content should be completely non-interactive and hidden from assistive technology, use `inert`, `hidden`, or remove it from the DOM.
234234

235235
### A3: Missing Required ARIA Properties
236236

237237
- **Severity**: CRITICAL
238238
- **Detection**: `role="tab"` without `aria-selected`, `role="checkbox"` without `aria-checked`
239239
- **WCAG**: 4.1.2 (A)
240240

241-
Required per role: `tab` needs `aria-selected`/`aria-controls`; `combobox` needs `aria-expanded`/`aria-controls`; `slider` needs `aria-valuemin`/`aria-valuemax`/`aria-valuenow`; `checkbox` needs `aria-checked`.
241+
Required per role: `tab` needs `aria-selected`; `combobox` needs `aria-expanded`/`aria-controls`; `slider` needs `aria-valuemin`/`aria-valuemax`/`aria-valuenow`; `checkbox` needs `aria-checked`.
242242

243243
### A4: Invalid ARIA Role Values
244244

@@ -279,14 +279,16 @@ Invalid roles are ignored by assistive technology. Common mistakes: `role="input
279279
- **Detection**: `role="presentation"` on interactive elements
280280
- **WCAG**: ARIA Rule 4
281281

282+
Browsers will ignore the presentation role on focusable elements.
283+
282284
### A8: Missing Live Region for Dynamic Content
283285

284286
- **Severity**: IMPORTANT
285287
- **Detection**: Toast/notification components without `role="alert"`, `role="status"`, or `aria-live`
286288
- **WCAG**: 4.1.3 (AA)
287289

288290
```html
289-
<!-- GOOD — content announced when injected -->
291+
<!-- GOOD — content announced when content is injected into a preexisting live region element in the DOM -->
290292
<div role="status" aria-live="polite">Item saved successfully</div>
291293
<!-- Use role="alert" (assertive) for errors -->
292294
<div role="alert">Failed to save. Please try again.</div>
@@ -302,7 +304,7 @@ Invalid roles are ignored by assistive technology. Common mistakes: `role="input
302304
- **Detection**: `(?:onClick|@click|\(click\))` on `<div>` or `<span>` without keyboard handler
303305
- **WCAG**: 2.1.1 (A)
304306

305-
Use `<button>` instead. If div is required: add `role="button"`, `tabIndex={0}`, and handle Enter/Space.
307+
Use `<button>` instead. If a div is required: add `role="button"`, `tabIndex={0}`, handle Enter and Space key activation.
306308

307309
### K2: Positive `tabindex` Values
308310

@@ -318,7 +320,7 @@ Only use `tabindex="0"` (add to tab order) and `tabindex="-1"` (programmatic foc
318320
- **Detection**: Modal/overlay without Escape key handler or focus trapping
319321
- **WCAG**: 2.1.2 (A)
320322

321-
Use native `<dialog>` with `showModal()` — it provides focus trapping, Escape-to-close, and focus return automatically. Use `inert` attribute on background content to prevent interaction outside the dialog (96%+ browser support). If custom implementation is needed: trap Tab within the dialog, close on Escape, return focus to the trigger element on close.
323+
Use native `<dialog>` with `showModal()` — it prevents keyboard focus from moving to the inert non-dialog content. Additionally, it has built in Escape key to dismiss, and focus will automatically return to the invoking element (if available). If a custom modal dialog implementation is needed: trap Tab within the dialog or use the `inert` attribute for non-dialog content (do not use `inert` on an element that contains the dialog), dismiss on Escape (unless user confirmation of an action is essential), return focus to the trigger element on close, or to best logical location if triggering element is no longer present upon dismissal.
322324

323325
### K4: Missing Skip Link
324326

@@ -356,13 +358,13 @@ button:focus-visible { outline: 2px solid #005fcc; outline-offset: 2px; }
356358

357359
Pair hover with focus events. Use `onFocus`/`onBlur` alongside `onMouseEnter`/`onMouseLeave`.
358360

359-
### K7: Focus Not Returned After Modal Close
361+
### K7: Focus Not Returned After Custom Modal Close
360362

361363
- **Severity**: IMPORTANT
362-
- **Detection**: Dialog close without restoring focus to trigger
364+
- **Detection**: Custom modal dialog close without restoring focus to trigger
363365
- **WCAG**: 2.4.3 (A)
364366

365-
Store reference to trigger element. On modal close, call `triggerElement.focus()`.
367+
Store reference to trigger element or to best logical location if triggering element is no longer present upon close. On modal close, call `triggerElement.focus()`.
366368

367369
---
368370

0 commit comments

Comments
 (0)