Repository navigation
[test][dialog] Add axe tests and WCAG conformance report - #49975
Draft
michelengelen wants to merge 5 commits into
Draft
michelengelen wants to merge 5 commits into
michelengelen wants to merge 5 commits into
Conversation
The tests cover the hidden page (1.3.1), Escape (2.1.1), the focus trap (2.1.2), the focus restore (2.4.3), and focus without a close (3.2.1). Each title has the criterion number and name, so the accessibility scorecard reads the tests as evidence. A component that uses Modal can list Modal in the `tests` key of its claim. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Add six open Dialog fixtures for axe and one interaction fixture for Playwright. The fixtures use `disablePortal`, because axe scans only the test case element. Add unit tests for 1.3.1, 1.4.3, 2.4.3, 2.5.2, and 4.1.2. Add Playwright tests for the focus order, focus not obscured, reflow at 320 CSS px, and keyboard scroll. Enroll Dialog in the CSS layout suite. Two unit tests and one Playwright test pin the documented gaps. They fail when a gap is fixed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The full-screen demo has no DialogTitle, so its Dialog had no accessible name. The Dialog now has `aria-labelledby`, and the title is an `h2`. The Accessibility section now explains how to name a Dialog without a DialogTitle, and how to make text-only content keyboard scrollable with `scroll="paper"`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Add the Dialog claim, the report, and the axe results. Add two known-gap rows for 2.1.1 and 4.1.2. Regenerate the scorecard, the index, and the manual-testing checklist. The notes marked Modal in the report also apply to Drawer, Menu, and Popover. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 task done
Deploy previewBundle size
PerformanceNo regressions in 32 benchmarks · precise to ±9.7% (±15.8% at worst) · ran 3m 38s · details Check out the code infra dashboard for more information about this PR. |
A regression run wrote the file again after the format step. The CI check for committed a11y results then failed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds axe coverage, WCAG unit tests, and a WCAG 2.2 Level A/AA conformance report for
Dialog. This is Wave 2, item 1 of #49260. Part of #49416.Dialog
Known gaps, each confirmed in Chromium:
scroll="paper", DialogContent is the scroll container, and it is not focusable. If the content has no focusable element, keyboard users cannot scroll it.scroll="body"works, andtabIndex={0}on DialogContent works.aria-labelledbypoints to no element, and anaria-labelon Dialog goes to the root element, not to the element with thedialogrole. A DialogTitle with its ownidnames the Dialog only when the Dialog has the samearia-labelledby.Report:
Dialog/accessibility.mdChanges
Modal.test.jshas a new "WCAG 2.2 conformance" block for 1.3.1, 2.1.1, 2.1.2, 2.4.3, and 3.2.1.tests, so the scorecard reads them as Dialog evidence. Drawer, Menu, and Popover can do the same.Dialog.test.js"WCAG 2.2 conformance" block covers 1.3.1, 1.4.3, 2.4.3, 2.5.2, and 4.1.2.disablePortal, because axe scans only the test case element.DialogA11yOpen,DialogA11yFullScreen, andDialogA11yScrollBodyassert every rule.DialogA11yScrollrecordscolor-contrastwithout asserting it. axe cannot rate text that the scroll container clips.DialogA11yScrollTextalso recordsscrollable-region-focusable. This is the 2.1.1 gap.DialogA11yKnownGapsrecordsaria-prohibited-attrandaria-valid-attr-value. This is the 4.1.2 gap.DialogA11yOpen. Five tests inindex.test.jsuse real key presses:scroll="body"(2.1.1).scroll="paper". It fails when the gap is fixed.aria-labelledby, and its title is anh2. The Accessibility section ofdialogs.mdhas three new notes: how DialogTitle names the Dialog, how to name a Dialog without a DialogTitle, and how to make text-only content keyboard scrollable.Decisions for review
dialogrole and shows no focus indicator. The paper is a container, not a control, and the first Tab moves to a control. An auditor review of this decision is pending.body. Focus moves into it, and the page behind it is hidden from assistive technology. A screen-reader check of the reading order is pending.Not done in this PR
Follow-ups
aria-labelon Dialog on the element with thedialogrole.aria-labelledbywhen the Dialog has no DialogTitle.scroll="paper".role="none".Merge order
The Tooltip PR for the same wave (#49976) changes the same generated files. Do not merge the generated blocks by hand. After a rebase, run
pnpm a11y:scorecard.🤖 Generated with Claude Code