From 642e823105c5d25dc9846b8dd4a20bcf1504832e Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 10:13:07 +0000 Subject: [PATCH] WCAG 2.2 and WAI-ARIA 1.2 in full: every requirement from W3C's own data, each enforced as the register says WCAG 2.2: all 55 success criteria at A and AA from W3C's wcag.json (pinned by SHA-256), each mapped to the check that holds it: axe-core 4.10.3 rules, a verified not-applicable (nothing on any screen matches), a probe following W3C's test procedure, or the review-before-send suite. WAI-ARIA 1.2: all 142 roles, states and properties from the Recommendation, each kind enforced alike (enforcedByKind, a fallback the gate now reads). test/page/standards.test.mjs runs exactly the register's checks. Four criteria fail only in the canonical frame and are listed as failing with why: UOR-Foundation/template#93 fixes them. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013Asa3LnihjghMFtJj7tkWm --- app/specs/product/quality/QR-20.json | 6 +- app/specs/standards/debt.json | 6 + app/specs/standards/spec.json | 301 ++++++- test/page/standards.test.mjs | 296 ++++++- test/standards/requirements.json | 1186 ++++++++++++++++++++++++++ tools/standards/extract/aria_html.py | 40 + tools/standards/extract/wcag_json.py | 28 + tools/standards/gate.py | 17 + 8 files changed, 1837 insertions(+), 43 deletions(-) create mode 100644 tools/standards/extract/aria_html.py create mode 100644 tools/standards/extract/wcag_json.py diff --git a/app/specs/product/quality/QR-20.json b/app/specs/product/quality/QR-20.json index 2379c0e7..87abc5ff 100644 --- a/app/specs/product/quality/QR-20.json +++ b/app/specs/product/quality/QR-20.json @@ -3,11 +3,11 @@ "name": "Every screen meets WCAG 2.2 AA", "characteristic": "interaction capability", "subcharacteristic": "inclusivity", - "says": "the first visit, every place in the person's view, an opened item, Settings and an answer meet WCAG 2.2 at level AA, as axe-core 4.10.3 (pinned by SHA-256) checks it, at desktop and phone widths in light and dark, on the specifications' own examples", + "says": "every WCAG 2.2 success criterion at levels A and AA, from W3C's own wcag.json pinned by SHA-256, is enforced as the standards registry says (axe-core 4.10.3 rules, verified not-applicable conditions, or W3C's test procedures as probes) on the first visit, every place in the person's view, an opened item, Settings and an answer, at desktop and phone widths in light and dark, on the specifications' own examples", "measures": [ { - "key": "wcag-violations", - "says": "WCAG 2.2 AA rules violated on any screen of the walk beyond the listed debt", + "key": "wcag-failing", + "says": "WCAG 2.2 A and AA success criteria failing beyond the standard's listed debt", "direction": "atMost", "threshold": 0, "gate": "test/page/standards.test.mjs" diff --git a/app/specs/standards/debt.json b/app/specs/standards/debt.json index 7ff34083..60302bb1 100644 --- a/app/specs/standards/debt.json +++ b/app/specs/standards/debt.json @@ -822,5 +822,11 @@ "rfc6350-7.2.4-e2a4a65d", "rfc6350-9-86c493ee", "rfc6350-9-8b9671de" + ], + "wcag-2.2": [ + "wcag-2.2-1.4.11", + "wcag-2.2-2.1.1", + "wcag-2.2-2.1.4", + "wcag-2.2-2.4.7" ] } diff --git a/app/specs/standards/spec.json b/app/specs/standards/spec.json index 853980cf..5fe4348e 100644 --- a/app/specs/standards/spec.json +++ b/app/specs/standards/spec.json @@ -375,25 +375,306 @@ }, { "key": "wcag-2.2", - "title": "W3C Web Content Accessibility Guidelines 2.2", + "title": "W3C Web Content Accessibility Guidelines 2.2, conformance at level AA", "issuer": "W3C", - "text": null, - "unpinned": "W3C's wcag.json inventory (success criteria) needs pinning with the wcag-json extractor", - "governs": [], + "text": { + "url": "https://www.w3.org/TR/WCAG22/", + "sha256": "6e3c5fe397257cae509a2fb4752b73062cf8cbeb92c2cec618989b17e4cf7057" + }, + "governs": [ + "site/card.mjs", + "site/app.mjs", + "site/surface/surface.mjs" + ], "realizedBy": [ "ST-01" - ] + ], + "inventories": [ + { + "extract": "wcag-json", + "levels": [ + "A", + "AA" + ], + "source": { + "url": "https://www.w3.org/WAI/WCAG22/wcag.json", + "sha256": "b6bedebc86e96c4989722dd7ebb49eb604f8b832de04f7a570430c5ebee097e6" + } + } + ], + "engine": { + "name": "axe-core", + "url": "https://cdn.jsdelivr.net/npm/axe-core@4.10.3/axe.min.js", + "sha256": "880970c081707360e64f34cea25ff91892f5bc95675b0776925b9709dd8a68bb" + }, + "enforcedBy": { + "wcag-2.2-1.1.1": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: image-alt, input-image-alt, object-alt, role-img-alt, svg-img-alt, aria-meter-name, aria-progressbar-name" + }, + "wcag-2.2-1.2.1": { + "suite": "test/page/standards.test.mjs", + "how": "absent: audio, video" + }, + "wcag-2.2-1.2.2": { + "suite": "test/page/standards.test.mjs", + "how": "absent: audio, video" + }, + "wcag-2.2-1.2.3": { + "suite": "test/page/standards.test.mjs", + "how": "absent: audio, video" + }, + "wcag-2.2-1.2.4": { + "suite": "test/page/standards.test.mjs", + "how": "absent: audio, video" + }, + "wcag-2.2-1.2.5": { + "suite": "test/page/standards.test.mjs", + "how": "absent: audio, video" + }, + "wcag-2.2-1.3.1": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: aria-required-children, aria-required-parent, definition-list, dlitem, list, listitem, p-as-heading, td-has-header, td-headers-attr, th-has-data-cells, aria-hidden-body" + }, + "wcag-2.2-1.3.2": { + "suite": "test/page/standards.test.mjs", + "how": "probe: reading-order" + }, + "wcag-2.2-1.3.3": { + "suite": "test/page/standards.test.mjs", + "how": "probe: sensory-words" + }, + "wcag-2.2-1.3.4": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: css-orientation-lock" + }, + "wcag-2.2-1.3.5": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: autocomplete-valid" + }, + "wcag-2.2-1.4.1": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: link-in-text-block" + }, + "wcag-2.2-1.4.2": { + "suite": "test/page/standards.test.mjs", + "how": "absent: audio, video" + }, + "wcag-2.2-1.4.3": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: color-contrast" + }, + "wcag-2.2-1.4.4": { + "suite": "test/page/standards.test.mjs", + "how": "probe: text-200" + }, + "wcag-2.2-1.4.5": { + "suite": "test/page/standards.test.mjs", + "how": "absent: img, canvas" + }, + "wcag-2.2-1.4.10": { + "suite": "test/page/standards.test.mjs", + "how": "probe: reflow" + }, + "wcag-2.2-1.4.11": { + "suite": "test/page/standards.test.mjs", + "how": "probe: non-text-contrast" + }, + "wcag-2.2-1.4.12": { + "suite": "test/page/standards.test.mjs", + "how": "probe: text-spacing" + }, + "wcag-2.2-1.4.13": { + "suite": "test/page/standards.test.mjs", + "how": "absent: [role=tooltip]" + }, + "wcag-2.2-2.1.1": { + "suite": "test/page/standards.test.mjs", + "how": "probe: keyboard" + }, + "wcag-2.2-2.1.2": { + "suite": "test/page/standards.test.mjs", + "how": "probe: keyboard" + }, + "wcag-2.2-2.1.4": { + "suite": "test/page/standards.test.mjs", + "how": "probe: character-keys" + }, + "wcag-2.2-2.2.1": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: meta-refresh" + }, + "wcag-2.2-2.2.2": { + "suite": "test/page/standards.test.mjs", + "how": "probe: endless-motion" + }, + "wcag-2.2-2.3.1": { + "suite": "test/page/standards.test.mjs", + "how": "probe: endless-motion" + }, + "wcag-2.2-2.4.1": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: bypass" + }, + "wcag-2.2-2.4.2": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: document-title" + }, + "wcag-2.2-2.4.3": { + "suite": "test/page/standards.test.mjs", + "how": "absent: [tabindex]:not([tabindex='0'], [tabindex='-1'])" + }, + "wcag-2.2-2.4.4": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: link-name, area-alt" + }, + "wcag-2.2-2.4.5": { + "suite": "test/page/standards.test.mjs", + "how": "probe: multiple-ways" + }, + "wcag-2.2-2.4.6": { + "suite": "test/page/standards.test.mjs", + "how": "probe: headings-labels" + }, + "wcag-2.2-2.4.7": { + "suite": "test/page/standards.test.mjs", + "how": "probe: keyboard" + }, + "wcag-2.2-2.4.11": { + "suite": "test/page/standards.test.mjs", + "how": "probe: keyboard" + }, + "wcag-2.2-2.5.1": { + "suite": "test/page/standards.test.mjs", + "how": "absent: [draggable=true]" + }, + "wcag-2.2-2.5.2": { + "suite": "test/page/standards.test.mjs", + "how": "probe: pointer-cancellation" + }, + "wcag-2.2-2.5.3": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: label-content-name-mismatch" + }, + "wcag-2.2-2.5.4": { + "suite": "test/page/standards.test.mjs", + "how": "probe: no-motion" + }, + "wcag-2.2-2.5.7": { + "suite": "test/page/standards.test.mjs", + "how": "absent: [draggable=true]" + }, + "wcag-2.2-2.5.8": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: target-size" + }, + "wcag-2.2-3.1.1": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: html-has-lang, html-lang-valid, html-xml-lang-mismatch" + }, + "wcag-2.2-3.1.2": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: valid-lang" + }, + "wcag-2.2-3.2.1": { + "suite": "test/page/standards.test.mjs", + "how": "probe: keyboard" + }, + "wcag-2.2-3.2.2": { + "suite": "test/page/standards.test.mjs", + "how": "probe: on-input" + }, + "wcag-2.2-3.2.3": { + "suite": "test/page/standards.test.mjs", + "how": "probe: consistent-navigation" + }, + "wcag-2.2-3.2.4": { + "suite": "test/page/standards.test.mjs", + "how": "probe: consistent-navigation" + }, + "wcag-2.2-3.2.6": { + "suite": "test/page/standards.test.mjs", + "how": "probe: consistent-navigation" + }, + "wcag-2.2-3.3.1": { + "suite": "test/page/standards.test.mjs", + "how": "probe: error-identification" + }, + "wcag-2.2-3.3.2": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: form-field-multiple-labels, label, select-name" + }, + "wcag-2.2-3.3.3": { + "suite": "test/page/standards.test.mjs", + "how": "probe: error-identification" + }, + "wcag-2.2-3.3.4": { + "suite": "test/page/acts.test.mjs", + "how": "suite: review before send" + }, + "wcag-2.2-3.3.7": { + "suite": "test/page/standards.test.mjs", + "how": "probe: redundant-entry" + }, + "wcag-2.2-3.3.8": { + "suite": "test/page/standards.test.mjs", + "how": "absent: input[type=password]" + }, + "wcag-2.2-4.1.2": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: aria-allowed-attr, aria-braille-equivalent, aria-command-name, aria-conditional-attr, aria-deprecated-role, aria-hidden-focus, aria-input-field-name, aria-prohibited-attr, aria-required-attr, aria-roledescription, aria-roles, aria-toggle-field-name, aria-tooltip-name, aria-valid-attr-value, aria-valid-attr, button-name, duplicate-id-aria, frame-title-unique, frame-title, input-button-name, label, nested-interactive, summary-name" + }, + "wcag-2.2-4.1.3": { + "suite": "test/page/standards.test.mjs", + "how": "probe: status-messages" + } + }, + "failing": { + "wcag-2.2-1.4.11": "the canonical frame's address field has a 1.6:1 edge; UOR-Foundation/template#93 raises it to 3:1", + "wcag-2.2-2.1.1": "Tab skips the canonical frame's #github and #share; UOR-Foundation/template#93 ends the omnibox's edit on Tab", + "wcag-2.2-2.1.4": "site/app.mjs (template-locked) opens the spec on '.' alone; UOR-Foundation/template#93 removes the shortcut", + "wcag-2.2-2.4.7": "the canonical frame's #home link draws no focus ring; UOR-Foundation/template#93 draws one" + } }, { "key": "wai-aria-1.2", "title": "W3C Accessible Rich Internet Applications 1.2", "issuer": "W3C", - "text": null, - "unpinned": "the ARIA roles, states and properties need pinning with an extractor, and WPT's aria suite as oracle", - "governs": [], + "text": { + "url": "https://www.w3.org/TR/wai-aria-1.2/", + "sha256": "c0fea16fc747779569ab754d2d25bca3e2b7e8a673b8ef5362aeb9ebc73a4849" + }, + "governs": [ + "site/card.mjs", + "site/app.mjs", + "site/surface/surface.mjs" + ], "realizedBy": [ "ST-01" - ] + ], + "inventories": [ + { + "extract": "aria-html" + } + ], + "enforcedByKind": { + "abstract role": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: aria-roles" + }, + "role": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: aria-roles, aria-allowed-role, aria-deprecated-role, aria-required-attr, aria-required-children, aria-required-parent, aria-allowed-attr, aria-prohibited-attr" + }, + "state": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: aria-valid-attr, aria-valid-attr-value, aria-allowed-attr, aria-conditional-attr, aria-prohibited-attr, aria-required-attr, aria-hidden-focus, aria-hidden-body" + }, + "property": { + "suite": "test/page/standards.test.mjs", + "how": "axe-core rules: aria-valid-attr, aria-valid-attr-value, aria-allowed-attr, aria-conditional-attr, aria-prohibited-attr, aria-required-attr, aria-braille-equivalent, aria-roledescription" + } + } }, { "key": "accname-1.2", @@ -588,7 +869,6 @@ "app/src/RoutingProofs.lex.tex", "app/src/Security.lex.tex", "app/src/VocabProofs.lex.tex", - "site/app.mjs", "site/coherence/coherence.mjs", "site/coherence/sense.mjs", "site/coherence/today.mjs", @@ -635,7 +915,6 @@ "site/source/services.mjs", "site/source/shape.mjs", "site/spec.mjs", - "site/surface/surface.mjs", "site/time/rhythm.mjs", "site/uorc/guest.mjs", "site/uorc/objects.mjs", diff --git a/test/page/standards.test.mjs b/test/page/standards.test.mjs index eb4b79da..84b0d3fc 100644 --- a/test/page/standards.test.mjs +++ b/test/page/standards.test.mjs @@ -1,17 +1,27 @@ -// UX-01: every screen the person meets is held to a published standard, not a -// home-made one: WCAG 2.2 at level AA (W3C), checked by axe-core, the W3C -// ACT-aligned engine, fetched at a pinned version and SHA-256. The walk runs -// on the specifications' own examples (test/oracle/corpus.json) on the day -// they happen, at a desktop and a phone width, in light and dark: the first -// visit, every place in the person's view, an opened item, Settings and an -// answer. A violation the debt below does not list fails, and so does listed -// debt that is gone, so the debt only shrinks and a fixed class stays fixed. +// The front end implements its standards in full, and the registry says how +// each requirement is enforced. Every requirement of every standard that +// governs the page (app/specs/standards/spec.json) names the check that holds +// it, and this suite runs exactly those checks, read from the registry: +// "axe-core rules: a, b" the pinned axe-core engine's rules, on every screen +// "absent: " a verified not-applicable: nothing on any screen, +// the frame's shadow roots included, matches it +// "probe: " one of the probes below, each a requirement's own +// test procedure (W3C's Understanding documents) +// "suite: " another suite, named by the entry's "suite" +// A requirement that fails and is not on the standard's debt +// (app/specs/standards/debt.json) fails this suite, and so does debt that now +// passes, so the debt only shrinks. +// +// The walk is on the specifications' own examples (test/oracle/corpus.json) +// on the day they happen, at a desktop and a phone width, in light and dark: +// the first visit, every place in the person's view, an opened item, +// Settings and an answer. // // pages.yml runs it on the assembled page and again on the published page. // usage: NODE_PATH="$(npm root --global)" [PAGE_SITE=dir | PAGE_URL=url] node --test test/page/standards.test.mjs import assert from "node:assert/strict"; import { createHash } from "node:crypto"; -import { createReadStream, existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs"; +import { createReadStream, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, writeFileSync } from "node:fs"; import { createServer } from "node:http"; import { createRequire } from "node:module"; import { tmpdir } from "node:os"; @@ -23,20 +33,32 @@ const site = resolve(process.env.PAGE_SITE ?? "site"); const published = process.env.PAGE_URL; const types = { ".html": "text/html", ".mjs": "text/javascript", ".js": "text/javascript", ".json": "application/json", ".css": "text/css", ".wasm": "application/wasm", ".svg": "image/svg+xml", ".png": "image/png", ".woff2": "font/woff2", ".webmanifest": "application/manifest+json" }; const { PLACES } = await import(resolve("site/surface/surface.mjs")); -const { example } = await import(resolve("test/oracle/examples.mjs")); +const { example, toOf } = await import(resolve("test/oracle/examples.mjs")); -// The standard and its checker. -const STANDARD = { name: "WCAG 2.2 AA", tags: ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "wcag22aa"] }; -const ENGINE = { url: "https://cdn.jsdelivr.net/npm/axe-core@4.10.3/axe.min.js", sha256: "880970c081707360e64f34cea25ff91892f5bc95675b0776925b9709dd8a68bb" }; -// QR-20's measure: rules violated on any screen beyond the debt, at most 0. -const MEASURE = "wcag-violations"; -// What still violates it, as "rule at screen": this list only shrinks. -const DEBT = []; +// The registry's entries whose requirements name this suite. +const SUITE = "test/page/standards.test.mjs"; +// QR-20's measure: requirements failing beyond the debt, at most 0. +const MEASURE = "wcag-failing"; +const REGISTRY = JSON.parse(readFileSync("app/specs/standards/spec.json", "utf8")).standards; +const DEBTS = existsSync("app/specs/standards/debt.json") ? JSON.parse(readFileSync("app/specs/standards/debt.json", "utf8")) : {}; +// A standard may enforce every requirement of a kind alike ("enforcedByKind"): its checks fail as that kind. +const enforcing = (s) => [...Object.entries(s.enforcedBy ?? {}), ...Object.entries(s.enforcedByKind ?? {}).map(([kind, e]) => [`every ${kind}`, e])]; +const STANDARDS = REGISTRY.filter((s) => enforcing(s).some(([, e]) => e.suite === SUITE)); +// Each requirement's check, parsed from its "how". +const CHECKS = STANDARDS.flatMap((s) => enforcing(s).filter(([, e]) => e.suite === SUITE).map(([id, e]) => { + const [, kind, arg] = /^(axe-core rules|absent|probe): (.+)$/.exec(e.how) ?? []; + assert.ok(kind, `${s.key} ${id}: "${e.how}" is not a check this suite knows`); + return { standard: s.key, id, kind, arg: kind === "axe-core rules" ? arg.split(/,\s*/) : arg }; +})); +const RULES = [...new Set(CHECKS.filter((c) => c.kind === "axe-core rules").flatMap((c) => c.arg))]; +const ABSENT = [...new Set(CHECKS.filter((c) => c.kind === "absent").map((c) => c.arg))]; +const PROBED = new Set(CHECKS.filter((c) => c.kind === "probe").map((c) => c.arg)); +const ENGINE = STANDARDS.find((s) => s.engine)?.engine; async function engine() { const dir = join(tmpdir(), "prism-standards"); const path = join(dir, ENGINE.sha256); - let bytes = existsSync(path) ? readFileSync(path) : Buffer.from(await (await fetch(ENGINE.url)).arrayBuffer()); + const bytes = existsSync(path) ? readFileSync(path) : Buffer.from(await (await fetch(ENGINE.url)).arrayBuffer()); const digest = createHash("sha256").update(bytes).digest("hex"); assert.equal(digest, ENGINE.sha256, `${ENGINE.url} is ${digest}, not the pinned engine`); mkdirSync(dir, { recursive: true }); @@ -54,7 +76,185 @@ const VIEWS = [ { name: "phone dark", viewport: { width: 390, height: 844 }, colorScheme: "dark" }, ]; -test(`every screen the person meets meets ${STANDARD.name} (UX-01)`, { timeout: 15 * 60000 }, async () => { +// In the page: every element, the frame's shadow roots included. +const DEEP = `const deep = (root = document) => [...root.querySelectorAll("*")].flatMap((el) => el.shadowRoot ? [el, ...deep(el.shadowRoot)] : [el]); +const shown = (el) => { const r = el.getBoundingClientRect(); const s = getComputedStyle(el); return (r.width > 0 || r.height > 0 || s.display === "contents") && s.visibility !== "hidden" && !el.closest("[hidden]"); }; +const active = () => { let a = document.activeElement; while (a?.shadowRoot?.activeElement) a = a.shadowRoot.activeElement; return a; };`; +const inPage = (body) => new Function("arg", `${DEEP}\n${body}`); + +// Probes run on every screen: each returns the failures it found. +const SCREEN = { + // 1.3.2: each list's items are read in the order they are seen (rows top to bottom, a row left to right). + "reading-order": inPage(`const bad = []; + for (const list of deep().filter((el) => /^(UL|OL)$/.test(el.tagName) && shown(el))) { + const items = [...list.children].filter((li) => shown(li) && li.getBoundingClientRect().height > 0).map((li) => li.getBoundingClientRect()); + for (let i = 1; i < items.length; i++) { + const a = items[i - 1], b = items[i]; + if (b.top < a.top - 2 || (Math.abs(b.top - a.top) <= 2 && b.left < a.left - 1)) { bad.push((list.id || list.className) + " item " + (i + 1)); break; } + } + } + return bad;`), + // 1.3.3: no instruction leans on shape, place, size or colour (WCAG failure F14). + "sensory-words": inPage(`const text = document.body.innerText; + const hit = /\\b(click|press|tap|select|use)\\b[^.\\n]{0,30}\\b(left|right|above|below|round|square|green|red|blue|yellow|big|small)\\b/i.exec(text); + return hit ? [hit[0]] : [];`), + // 2.4.6: every heading and every label says something (that each control has a name is axe-core's, under 4.1.2). + "headings-labels": inPage(`return deep().filter((el) => (/^H[1-6]$/.test(el.tagName) || el.tagName === "LABEL") && shown(el) && !el.textContent.trim()).map((el) => "empty " + el.tagName.toLowerCase());`), + // 4.1.3: the Prism's line is a live region, so what it says is announced without moving focus. + "status-messages": inPage(`const out = document.getElementById("pr-out"); + const live = out?.closest('[aria-live]:not([aria-live="off"]), [role=status], [role=log], [role=alert]') ?? (/^(status|log|alert)$/.test(out?.getAttribute("role") ?? "") ? out : null); + return live ? [] : ["#pr-out is in no live region"];`), + // 2.4.5: more than one way to every place: the navigation names each, and Ask finds anything. + "multiple-ways": inPage(`const bad = []; + for (const key of arg) if (!document.querySelector('.pr-go[data-place="' + key + '"]')) bad.push("no way to " + key); + if (!document.getElementById("pr-prompt")) bad.push("no Ask"); + return bad;`), + // 2.2.2, 2.3.1: nothing moves on its own without end, and nothing flashes more than three times a second. + "endless-motion": inPage(`const bad = []; + for (const a of document.getAnimations({ subtree: true })) { + const t = a.effect?.getComputedTiming?.() ?? {}; + if (a.playState === "running" && t.iterations === Infinity) bad.push("endless " + (a.animationName ?? a.id ?? "animation") + " on " + (a.effect?.target?.id || a.effect?.target?.className || "?")); + if (a.playState === "running" && t.iterations > 3 && t.duration < 333) bad.push("flash " + (a.animationName ?? "")); + } + return bad;`), + // 1.4.11: a field's edge, which is how it is seen as a field, has 3:1 against what is behind it. + "non-text-contrast": inPage(`const paint = new OffscreenCanvas(1, 1).getContext("2d", { willReadFrequently: true }); + // Any CSS colour (rgb, oklab, color-mix...) as the sRGB the screen shows. + const rgb = (c) => { if (!c) return null; paint.clearRect(0, 0, 1, 1); paint.fillStyle = "rgba(0, 0, 0, 0)"; paint.fillStyle = c; paint.fillRect(0, 0, 1, 1); const [r, g, b, a] = paint.getImageData(0, 0, 1, 1).data; return { r, g, b, a: a / 255 }; }; + const over = (top, under) => ({ r: top.r * top.a + under.r * (1 - top.a), g: top.g * top.a + under.g * (1 - top.a), b: top.b * top.a + under.b * (1 - top.a), a: 1 }); + const lum = (c) => { const f = (v) => { v /= 255; return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4; }; return 0.2126 * f(c.r) + 0.7152 * f(c.g) + 0.0722 * f(c.b); }; + const ratio = (x, y) => { const [a, b] = [lum(x), lum(y)].sort((p, q) => q - p); return (a + 0.05) / (b + 0.05); }; + const behind = (el) => { const chain = []; for (let n = el.parentElement ?? el.getRootNode().host; n; n = n.parentElement ?? n.getRootNode().host) { const c = rgb(getComputedStyle(n).backgroundColor); if (c && c.a > 0) { chain.push(c); if (c.a >= 1) break; } } let base = chain.at(-1)?.a >= 1 ? chain.pop() : (matchMedia("(prefers-color-scheme: dark)").matches ? { r: 0, g: 0, b: 0, a: 1 } : { r: 255, g: 255, b: 255, a: 1 }); for (const c of chain.reverse()) base = over(c, base); return base; }; + const bad = []; + // The edge may be the field's own or that of the box drawn tight around it. + const seenOf = (el) => { + const s = getComputedStyle(el); + const back = behind(el); + const fill = rgb(s.backgroundColor); + const face = fill && fill.a > 0 ? over(fill, back) : back; + const edge = rgb(s.borderTopColor); + const width = parseFloat(s.borderTopWidth); + return Math.max(width > 0 && edge && edge.a > 0 ? ratio(over(edge, back), back) : 0, ratio(face, back)); + }; + for (const el of deep().filter((el) => el.matches('input:not([type=hidden]):not([type=file]), textarea, [role=switch]') && shown(el))) { + const box = el.getBoundingClientRect(); + let seen = seenOf(el); + for (let up = el.parentElement ?? el.getRootNode().host, i = 0; seen < 3 && up && i < 3; up = up.parentElement ?? up.getRootNode().host, i++) { + const r = up.getBoundingClientRect(); + if (r.height > box.height + 24) break; + seen = Math.max(seen, seenOf(up)); + } + if (seen < 3) bad.push((el.id || el.getAttribute("aria-label") || el.tagName.toLowerCase()) + " " + seen.toFixed(2) + ":1"); + } + return bad;`), +}; + +// Probes run once a view, on a place with its content: each returns its failures by requirement. +async function viewProbes(page, view, home) { + const out = []; + const fail = (probe, why) => out.push({ probe, why }); + const where = () => page.evaluate(() => [document.getElementById("pr-title")?.textContent, document.documentElement.className, location.hash].join("|")); + if (PROBED.has("keyboard")) { + // 2.1.1, 2.1.2, 2.4.7, 2.4.11, 3.2.1: Tab reaches every control, comes round again, each shows its focus + // and is not hidden under anything, and focusing changes nothing. + await page.evaluate(() => { document.activeElement?.blur?.(); window.scrollTo(0, 0); }); + const before = await where(); + const seen = []; + for (let i = 0; i < 160; i++) { + await page.keyboard.press("Tab"); + const f = await page.evaluate(inPage(`const el = active(); + if (!el || el === document.body) return null; + const target = getComputedStyle(el).display === "contents" ? el.parentElement : el; + const s = getComputedStyle(el), t = getComputedStyle(target); + // A ring may be drawn on the control, on the row it lends its cells to, or on its ::before or ::after. + const ring = (x) => (x.outlineStyle !== "none" && parseFloat(x.outlineWidth) > 0) || (x.boxShadow && x.boxShadow !== "none"); + const r = target.getBoundingClientRect(); + const points = [[r.left + r.width / 2, r.top + r.height / 2], [r.left + 2, r.top + 2], [r.right - 2, r.bottom - 2]]; + const top = (x, y) => { let e = document.elementFromPoint(x, y); while (e?.shadowRoot) { const inner = e.shadowRoot.elementFromPoint(x, y); if (!inner || inner === e) break; e = inner; } return e; }; + const clear = points.some(([x, y]) => { const e = top(x, y); return e && (e === el || e === target || el.contains(e) || target.contains(e) || e.contains(el)); }); + return { id: el.id || el.getAttribute("aria-label") || el.textContent.trim().slice(0, 30) || el.tagName, key: el.id + "|" + el.className + "|" + el.textContent.trim().slice(0, 40) + "|" + Math.round(r.left) + "," + Math.round(r.top), ring: ring(s) || ring(t) || ring(getComputedStyle(el, "::before")) || ring(getComputedStyle(el, "::after")), clear };`)); + if (!f) continue; + if (seen.length && f.key === seen[0].key) break; + seen.push(f); + if (!f.ring) fail("keyboard", `2.4.7 ${f.id} shows no focus`); + if (!f.clear) fail("keyboard", `2.4.11 ${f.id} is hidden when focused`); + } + if (seen.length >= 160 || new Set(seen.map((f) => f.key)).size < seen.length / 2) fail("keyboard", "2.1.2 Tab does not come round"); + const reached = new Set(seen.map((f) => f.key)); + const missing = await page.evaluate(inPage(`return deep().filter((el) => el.matches('button:not([disabled]), input:not([disabled]):not([type=hidden]), textarea, select, a[href], [tabindex="0"]') && shown(el) && el.tabIndex >= 0) + .map((el) => { const r = (getComputedStyle(el).display === "contents" ? el.parentElement : el).getBoundingClientRect(); return { id: el.id || el.getAttribute("aria-label") || el.textContent.trim().slice(0, 30) || el.tagName, key: el.id + "|" + el.className + "|" + el.textContent.trim().slice(0, 40) + "|" + Math.round(r.left) + "," + Math.round(r.top) }; });`)); + for (const m of missing) if (!reached.has(m.key)) fail("keyboard", `2.1.1 Tab never reaches ${m.id}`); + if ((await where()) !== before) fail("keyboard", "3.2.1 focusing changed the page"); + } + if (PROBED.has("character-keys")) { + // 2.1.4: no single printable key does anything unless focus is on its control. + for (const key of [..."abcdefghijklmnopqrstuvwxyz0123456789.,/;'[]-=?"]) { + await page.evaluate(() => { document.activeElement?.blur?.(); }); + const before = await where(); + await page.keyboard.press(key); + if ((await where()) !== before) { fail("character-keys", `2.1.4 the key "${key}" alone acts`); await page.keyboard.press(key).catch(() => {}); await page.keyboard.press("Escape"); } + } + } + const overflow = () => page.evaluate(() => document.documentElement.scrollWidth > document.documentElement.clientWidth + 1); + if (PROBED.has("text-200")) { + // 1.4.4: text at 200 percent loses nothing sideways. + await page.evaluate(() => { document.documentElement.style.fontSize = "200%"; }); + if (await overflow()) fail("text-200", "1.4.4 text at 200 percent overflows sideways"); + await page.evaluate(() => { document.documentElement.style.fontSize = ""; }); + } + if (PROBED.has("reflow")) { + // 1.4.10: at 320 CSS pixels wide, nothing needs scrolling sideways. + await page.setViewportSize({ width: 320, height: view.viewport.height }); + await page.waitForTimeout(200); + if (await overflow()) fail("reflow", "1.4.10 at 320 px the page scrolls sideways"); + await page.setViewportSize(view.viewport); + await page.waitForTimeout(200); + } + if (PROBED.has("text-spacing")) { + // 1.4.12: WCAG's own spacing (line 1.5, paragraph 2, letter 0.12, word 0.16) clips nothing new. + const clipped = () => page.evaluate(inPage(`return deep().filter((el) => shown(el) && el.children.length === 0 && el.textContent.trim() && /hidden|clip/.test(getComputedStyle(el).overflow) && getComputedStyle(el).textOverflow !== "ellipsis" && (el.scrollHeight > el.clientHeight + 2 || el.scrollWidth > el.clientWidth + 2)).map((el) => el.id || el.className || el.tagName);`)); + const was = new Set(await clipped()); + await page.addStyleTag({ content: "* { line-height: 1.5 !important; letter-spacing: 0.12em !important; word-spacing: 0.16em !important; } p { margin-bottom: 2em !important; }" }).then((h) => h.evaluate((el) => el.setAttribute("data-probe", "spacing"))); + await page.waitForTimeout(100); + if (await overflow()) fail("text-spacing", "1.4.12 the page overflows sideways"); + for (const c of await clipped()) if (!was.has(c)) fail("text-spacing", `1.4.12 ${c} is clipped`); + await page.evaluate(() => document.querySelector("style[data-probe=spacing]")?.remove()); + } + if (PROBED.has("on-input")) { + // 3.2.2: typing into a field changes no place. + const before = await where(); + await page.fill("#pr-prompt", "a"); + if ((await where()) !== before) fail("on-input", "3.2.2 typing in Ask changed the page"); + await page.fill("#pr-prompt", ""); + } + if (PROBED.has("pointer-cancellation")) { + // 2.5.2: a press acts on release, and releasing away from it cancels. + const before = await where(); + const box = await page.locator(`.pr-go[data-place="${home}"]`).first().boundingBox(); + await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2); + await page.mouse.down(); + if ((await where()) !== before) fail("pointer-cancellation", "2.5.2 a press acted before release"); + await page.mouse.move(2, view.viewport.height - 2); + await page.mouse.up(); + if ((await where()) !== before) fail("pointer-cancellation", "2.5.2 releasing away did not cancel"); + } + if (PROBED.has("error-identification")) { + // 3.3.1, 3.3.3: a wrong address is identified, in text, with what would be right. + await page.click('.pr-go[data-place="conversations"]'); + await page.click("#pr-new"); + await page.fill('#pr-act input[type="email"]', "mary"); + await page.fill("#pr-act textarea", "a"); + await page.click('#pr-act button[type="submit"]'); + const said = await page.evaluate(() => { const f = document.querySelector('#pr-act input[type="email"]'); return { invalid: f.matches(":invalid") || f.getAttribute("aria-invalid") === "true", message: f.validationMessage }; }); + if (!said.invalid) fail("error-identification", "3.3.1 a wrong address is not identified"); + if (!said.message) fail("error-identification", "3.3.3 a wrong address comes with no suggestion"); + await page.keyboard.press("Escape"); + } + return out; +} + +test("the front end meets every requirement of its standards, as the registry enforces each", { timeout: 20 * 60000 }, async () => { + for (const name of PROBED) assert.ok(name in SCREEN || ["keyboard", "character-keys", "text-200", "reflow", "text-spacing", "on-input", "pointer-cancellation", "error-identification", "consistent-navigation", "redundant-entry", "no-motion"].includes(name), `no probe "${name}"`); const axe = await engine(); const dir = mkdtempSync(join(tmpdir(), "standards-")); const files = FEED.map(([id, ext]) => { const path = join(dir, `${id}.${ext}`); writeFileSync(path, example(id)); return path; }); @@ -67,8 +267,19 @@ test(`every screen the person meets meets ${STANDARD.name} (UX-01)`, { timeout: createReadStream(file).pipe(response); }); if (!published) await new Promise((done) => server.listen(0, "127.0.0.1", done)); + // What fails, by "standard id", with the first place it failed. + const failed = new Map(); + const failing = (standard, id, why) => { const key = `${standard} ${id}`; if (!failed.has(key)) failed.set(key, why); }; + // A probe that names the requirement it found failing ("2.4.7 ...") fails that one; otherwise every requirement it holds. + const byProbe = (probe, why) => { const named = /(?:^|: )(\d+\.\d+\.\d+) /.exec(why)?.[1]; for (const c of CHECKS.filter((c) => c.kind === "probe" && c.arg === probe)) if (!named || c.id.endsWith(`-${named}`)) failing(c.standard, c.id, why); }; + + // 2.5.4: nothing is worked by moving the device (the page's code never listens for motion). + if (PROBED.has("no-motion")) { + const code = readdirSync("site", { recursive: true }).filter((f) => /\.m?js$/.test(f) && !/(^|\/)(vendor|test)\//.test(f)); + for (const f of code) if (/devicemotion|deviceorientation|DeviceMotionEvent|DeviceOrientationEvent/.test(readFileSync(join("site", f), "utf8"))) byProbe("no-motion", `site/${f} listens for device motion`); + } + const browser = await chromium.launch(); - const found = new Map(); try { for (const view of VIEWS) { // The page's own CSP refuses injected scripts; the checker is let in for the audit only. @@ -79,14 +290,26 @@ test(`every screen the person meets meets ${STANDARD.name} (UX-01)`, { timeout: page.on("pageerror", (error) => errors.push(error.message)); await page.goto(published ?? `http://127.0.0.1:${server.address().port}/me/`); await page.waitForSelector("html.pr-ready", { timeout: 60000 }); + // The canonical frame, fetched live, is part of every screen: the walk starts once it is drawn. + await page.waitForFunction(() => customElements.get("prism-frame") && !document.querySelector(".frame-fallback"), null, { timeout: 30000 }).catch(() => {}); + const navs = []; const audit = async (screen) => { await page.waitForTimeout(300); if (!(await page.evaluate(() => typeof window.axe === "object"))) await page.evaluate(axe); - const result = await page.evaluate((tags) => window.axe.run(document, { runOnly: { type: "tag", values: tags }, resultTypes: ["violations"] }), STANDARD.tags); - for (const v of result.violations) { - const key = `${v.id} at ${screen}`; - if (!found.has(key)) found.set(key, `${v.impact}: ${v.help} (${view.name}: ${v.nodes.map((n) => n.target.join(" ")).slice(0, 3).join(", ")})`); + const result = await page.evaluate((rules) => window.axe.run(document, { runOnly: { type: "rule", values: rules }, resultTypes: ["violations"] }), RULES); + for (const v of result.violations) for (const c of CHECKS.filter((c) => c.kind === "axe-core rules" && c.arg.includes(v.id))) { + failing(c.standard, c.id, `${v.id} at ${screen} (${view.name}): ${v.help}: ${v.nodes.map((n) => n.target.join(" ")).slice(0, 3).join(", ")}`); } + for (const selector of ABSENT) { + const found = await page.evaluate(inPage(`return deep().filter((el) => el.matches(arg)).map((el) => el.outerHTML.slice(0, 80));`), selector); + for (const c of CHECKS.filter((c) => c.kind === "absent" && c.arg === selector)) if (found.length) failing(c.standard, c.id, `at ${screen} (${view.name}) "${selector}" matches ${found.slice(0, 2).join(", ")}`); + } + for (const [name, probe] of Object.entries(SCREEN)) if (PROBED.has(name)) { + const arg = name === "multiple-ways" ? PLACES.filter((p) => p.viewpoint === "person" && p.host !== "composer").map((p) => p.key) : null; + for (const why of await page.evaluate(probe, arg)) byProbe(name, `at ${screen} (${view.name}): ${why}`); + } + // 3.2.3, 3.2.4, 3.2.6: the navigation, and the help beside it, are the same on every screen. + navs.push([screen, await page.evaluate(() => JSON.stringify([...document.querySelectorAll(".pr-go")].map((b) => [b.dataset.place, b.textContent.trim()]).concat([[ "spec", document.getElementById("open-spec")?.textContent.trim() ?? "" ]])))]); }; const go = (key) => page.click(`.pr-go[data-place="${key}"]`); @@ -100,16 +323,30 @@ test(`every screen the person meets meets ${STANDARD.name} (UX-01)`, { timeout: await picker.setInputFiles(files); await page.waitForFunction(() => /^\d+ items$/.test(document.getElementById("pr-out").textContent), null, { timeout: 30000 }); await audit(settings.key); - for (const place of PLACES.filter((p) => p.viewpoint === "person" && p.host !== "composer" && p.show !== "settings")) { + const places = PLACES.filter((p) => p.viewpoint === "person" && p.host !== "composer" && p.show !== "settings"); + for (const place of places) { await go(place.key); await audit(place.key); const row = page.locator("#pr-list [aria-expanded=false]").first(); if (await row.count()) { await row.click(); await audit(`${place.key}, opened`); } } + await go("calendar"); + for (const { probe, why } of await viewProbes(page, view, places[0].key)) byProbe(probe, `${view.name}: ${why}`); await page.fill("#pr-prompt", "What is going on with John?"); await page.click("#pr-ask-go"); await page.waitForFunction(() => !document.getElementById("pr-ask-go").disabled, null, { timeout: 15000 }); await audit("answer"); + if (PROBED.has("consistent-navigation")) for (const [screen, nav] of navs) if (nav !== navs[0][1]) byProbe("consistent-navigation", `${view.name}: the navigation at ${screen} differs from the first visit's`); + if (PROBED.has("redundant-entry")) { + // 3.3.7: what the person has given once is there the next time it is asked for. + await go(settings.key); + const field = page.locator('#pr-settings input[autocomplete="email"]').first(); + await field.fill(toOf("rfc5322-1")); + await field.locator("xpath=following::button[1]").click(); + await go(places[0].key); + await go(settings.key); + if ((await field.inputValue()) !== toOf("rfc5322-1")) byProbe("redundant-entry", `${view.name}: 3.3.7 the address given is asked for again`); + } assert.deepEqual(errors, [], `page errors (${view.name}): ${errors.join(" | ")}`); await context.close(); } @@ -117,8 +354,9 @@ test(`every screen the person meets meets ${STANDARD.name} (UX-01)`, { timeout: await browser.close(); server.close(); } - const fresh = [...found].filter(([key]) => !DEBT.includes(key)).map(([key, why]) => `${key}: ${why}`); - assert.deepEqual(fresh, [], `${MEASURE}: these screens violate ${STANDARD.name}: fix them, or list each under DEBT with why`); - const gone = DEBT.filter((key) => !found.has(key)); - assert.deepEqual(gone, [], "these now meet the standard: remove them from DEBT so they stay met"); + const debt = STANDARDS.flatMap((s) => (DEBTS[s.key] ?? []).filter((id) => s.enforcedBy?.[id]?.suite === SUITE).map((id) => `${s.key} ${id}`)); + const fresh = [...failed].filter(([key]) => !debt.includes(key)).map(([key, why]) => `${key}: ${why}`); + assert.deepEqual(fresh, [], `${MEASURE}: these requirements fail: fix them, or list each under the standard's debt with why`); + const gone = debt.filter((key) => !failed.has(key)); + assert.deepEqual(gone, [], "these now hold: take them off the debt so they stay held"); }); diff --git a/test/standards/requirements.json b/test/standards/requirements.json index 1171ce53..8c462cac 100644 --- a/test/standards/requirements.json +++ b/test/standards/requirements.json @@ -4832,5 +4832,1191 @@ "ref": "RFC 6350 9", "text": "In cases where the confidentiality or authenticity of information contained in vCard is a concern, the vCard SHOULD be transported using one of these secure mechanisms." } + ], + "wai-aria-1.2": [ + { + "id": "wai-aria-1.2-aria-activedescendant", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-activedescendant", + "text": "the aria-activedescendant property" + }, + { + "id": "wai-aria-1.2-aria-atomic", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-atomic", + "text": "the aria-atomic property" + }, + { + "id": "wai-aria-1.2-aria-autocomplete", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-autocomplete", + "text": "the aria-autocomplete property" + }, + { + "id": "wai-aria-1.2-aria-busy", + "kind": "state", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-busy", + "text": "the aria-busy state" + }, + { + "id": "wai-aria-1.2-aria-checked", + "kind": "state", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-checked", + "text": "the aria-checked state" + }, + { + "id": "wai-aria-1.2-aria-colcount", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-colcount", + "text": "the aria-colcount property" + }, + { + "id": "wai-aria-1.2-aria-colindex", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-colindex", + "text": "the aria-colindex property" + }, + { + "id": "wai-aria-1.2-aria-colspan", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-colspan", + "text": "the aria-colspan property" + }, + { + "id": "wai-aria-1.2-aria-controls", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-controls", + "text": "the aria-controls property" + }, + { + "id": "wai-aria-1.2-aria-current", + "kind": "state", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-current", + "text": "the aria-current state" + }, + { + "id": "wai-aria-1.2-aria-describedby", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-describedby", + "text": "the aria-describedby property" + }, + { + "id": "wai-aria-1.2-aria-details", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-details", + "text": "the aria-details property" + }, + { + "id": "wai-aria-1.2-aria-disabled", + "kind": "state", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-disabled", + "text": "the aria-disabled state" + }, + { + "id": "wai-aria-1.2-aria-dropeffect", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-dropeffect", + "text": "the aria-dropeffect property" + }, + { + "id": "wai-aria-1.2-aria-errormessage", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-errormessage", + "text": "the aria-errormessage property" + }, + { + "id": "wai-aria-1.2-aria-expanded", + "kind": "state", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-expanded", + "text": "the aria-expanded state" + }, + { + "id": "wai-aria-1.2-aria-flowto", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-flowto", + "text": "the aria-flowto property" + }, + { + "id": "wai-aria-1.2-aria-grabbed", + "kind": "state", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-grabbed", + "text": "the aria-grabbed state" + }, + { + "id": "wai-aria-1.2-aria-haspopup", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-haspopup", + "text": "the aria-haspopup property" + }, + { + "id": "wai-aria-1.2-aria-hidden", + "kind": "state", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-hidden", + "text": "the aria-hidden state" + }, + { + "id": "wai-aria-1.2-aria-invalid", + "kind": "state", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-invalid", + "text": "the aria-invalid state" + }, + { + "id": "wai-aria-1.2-aria-keyshortcuts", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-keyshortcuts", + "text": "the aria-keyshortcuts property" + }, + { + "id": "wai-aria-1.2-aria-label", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-label", + "text": "the aria-label property" + }, + { + "id": "wai-aria-1.2-aria-labelledby", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-labelledby", + "text": "the aria-labelledby property" + }, + { + "id": "wai-aria-1.2-aria-level", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-level", + "text": "the aria-level property" + }, + { + "id": "wai-aria-1.2-aria-live", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-live", + "text": "the aria-live property" + }, + { + "id": "wai-aria-1.2-aria-modal", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-modal", + "text": "the aria-modal property" + }, + { + "id": "wai-aria-1.2-aria-multiline", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-multiline", + "text": "the aria-multiline property" + }, + { + "id": "wai-aria-1.2-aria-multiselectable", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-multiselectable", + "text": "the aria-multiselectable property" + }, + { + "id": "wai-aria-1.2-aria-orientation", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-orientation", + "text": "the aria-orientation property" + }, + { + "id": "wai-aria-1.2-aria-owns", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-owns", + "text": "the aria-owns property" + }, + { + "id": "wai-aria-1.2-aria-placeholder", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-placeholder", + "text": "the aria-placeholder property" + }, + { + "id": "wai-aria-1.2-aria-posinset", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-posinset", + "text": "the aria-posinset property" + }, + { + "id": "wai-aria-1.2-aria-pressed", + "kind": "state", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-pressed", + "text": "the aria-pressed state" + }, + { + "id": "wai-aria-1.2-aria-readonly", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-readonly", + "text": "the aria-readonly property" + }, + { + "id": "wai-aria-1.2-aria-relevant", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-relevant", + "text": "the aria-relevant property" + }, + { + "id": "wai-aria-1.2-aria-required", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-required", + "text": "the aria-required property" + }, + { + "id": "wai-aria-1.2-aria-roledescription", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-roledescription", + "text": "the aria-roledescription property" + }, + { + "id": "wai-aria-1.2-aria-rowcount", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-rowcount", + "text": "the aria-rowcount property" + }, + { + "id": "wai-aria-1.2-aria-rowindex", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-rowindex", + "text": "the aria-rowindex property" + }, + { + "id": "wai-aria-1.2-aria-rowspan", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-rowspan", + "text": "the aria-rowspan property" + }, + { + "id": "wai-aria-1.2-aria-selected", + "kind": "state", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-selected", + "text": "the aria-selected state" + }, + { + "id": "wai-aria-1.2-aria-setsize", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-setsize", + "text": "the aria-setsize property" + }, + { + "id": "wai-aria-1.2-aria-sort", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-sort", + "text": "the aria-sort property" + }, + { + "id": "wai-aria-1.2-aria-valuemax", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-valuemax", + "text": "the aria-valuemax property" + }, + { + "id": "wai-aria-1.2-aria-valuemin", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-valuemin", + "text": "the aria-valuemin property" + }, + { + "id": "wai-aria-1.2-aria-valuenow", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-valuenow", + "text": "the aria-valuenow property" + }, + { + "id": "wai-aria-1.2-aria-valuetext", + "kind": "property", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#aria-valuetext", + "text": "the aria-valuetext property" + }, + { + "id": "wai-aria-1.2-role-alert", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#alert", + "text": "the alert role" + }, + { + "id": "wai-aria-1.2-role-alertdialog", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#alertdialog", + "text": "the alertdialog role" + }, + { + "id": "wai-aria-1.2-role-application", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#application", + "text": "the application role" + }, + { + "id": "wai-aria-1.2-role-article", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#article", + "text": "the article role" + }, + { + "id": "wai-aria-1.2-role-banner", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#banner", + "text": "the banner role" + }, + { + "id": "wai-aria-1.2-role-blockquote", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#blockquote", + "text": "the blockquote role" + }, + { + "id": "wai-aria-1.2-role-button", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#button", + "text": "the button role" + }, + { + "id": "wai-aria-1.2-role-caption", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#caption", + "text": "the caption role" + }, + { + "id": "wai-aria-1.2-role-cell", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#cell", + "text": "the cell role" + }, + { + "id": "wai-aria-1.2-role-checkbox", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#checkbox", + "text": "the checkbox role" + }, + { + "id": "wai-aria-1.2-role-code", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#code", + "text": "the code role" + }, + { + "id": "wai-aria-1.2-role-columnheader", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#columnheader", + "text": "the columnheader role" + }, + { + "id": "wai-aria-1.2-role-combobox", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#combobox", + "text": "the combobox role" + }, + { + "id": "wai-aria-1.2-role-command", + "kind": "abstract role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#command", + "text": "the command role, which authors must not use" + }, + { + "id": "wai-aria-1.2-role-complementary", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#complementary", + "text": "the complementary role" + }, + { + "id": "wai-aria-1.2-role-composite", + "kind": "abstract role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#composite", + "text": "the composite role, which authors must not use" + }, + { + "id": "wai-aria-1.2-role-contentinfo", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#contentinfo", + "text": "the contentinfo role" + }, + { + "id": "wai-aria-1.2-role-definition", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#definition", + "text": "the definition role" + }, + { + "id": "wai-aria-1.2-role-deletion", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#deletion", + "text": "the deletion role" + }, + { + "id": "wai-aria-1.2-role-dialog", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#dialog", + "text": "the dialog role" + }, + { + "id": "wai-aria-1.2-role-directory", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#directory", + "text": "the directory role" + }, + { + "id": "wai-aria-1.2-role-document", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#document", + "text": "the document role" + }, + { + "id": "wai-aria-1.2-role-emphasis", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#emphasis", + "text": "the emphasis role" + }, + { + "id": "wai-aria-1.2-role-feed", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#feed", + "text": "the feed role" + }, + { + "id": "wai-aria-1.2-role-figure", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#figure", + "text": "the figure role" + }, + { + "id": "wai-aria-1.2-role-form", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#form", + "text": "the form role" + }, + { + "id": "wai-aria-1.2-role-generic", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#generic", + "text": "the generic role" + }, + { + "id": "wai-aria-1.2-role-grid", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#grid", + "text": "the grid role" + }, + { + "id": "wai-aria-1.2-role-gridcell", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#gridcell", + "text": "the gridcell role" + }, + { + "id": "wai-aria-1.2-role-group", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#group", + "text": "the group role" + }, + { + "id": "wai-aria-1.2-role-heading", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#heading", + "text": "the heading role" + }, + { + "id": "wai-aria-1.2-role-img", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#img", + "text": "the img role" + }, + { + "id": "wai-aria-1.2-role-input", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#input", + "text": "the input role" + }, + { + "id": "wai-aria-1.2-role-insertion", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#insertion", + "text": "the insertion role" + }, + { + "id": "wai-aria-1.2-role-landmark", + "kind": "abstract role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#landmark", + "text": "the landmark role, which authors must not use" + }, + { + "id": "wai-aria-1.2-role-link", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#link", + "text": "the link role" + }, + { + "id": "wai-aria-1.2-role-list", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#list", + "text": "the list role" + }, + { + "id": "wai-aria-1.2-role-listbox", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#listbox", + "text": "the listbox role" + }, + { + "id": "wai-aria-1.2-role-listitem", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#listitem", + "text": "the listitem role" + }, + { + "id": "wai-aria-1.2-role-log", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#log", + "text": "the log role" + }, + { + "id": "wai-aria-1.2-role-main", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#main", + "text": "the main role" + }, + { + "id": "wai-aria-1.2-role-marquee", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#marquee", + "text": "the marquee role" + }, + { + "id": "wai-aria-1.2-role-math", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#math", + "text": "the math role" + }, + { + "id": "wai-aria-1.2-role-menu", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#menu", + "text": "the menu role" + }, + { + "id": "wai-aria-1.2-role-menubar", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#menubar", + "text": "the menubar role" + }, + { + "id": "wai-aria-1.2-role-menuitem", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#menuitem", + "text": "the menuitem role" + }, + { + "id": "wai-aria-1.2-role-menuitemcheckbox", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#menuitemcheckbox", + "text": "the menuitemcheckbox role" + }, + { + "id": "wai-aria-1.2-role-menuitemradio", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#menuitemradio", + "text": "the menuitemradio role" + }, + { + "id": "wai-aria-1.2-role-meter", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#meter", + "text": "the meter role" + }, + { + "id": "wai-aria-1.2-role-navigation", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#navigation", + "text": "the navigation role" + }, + { + "id": "wai-aria-1.2-role-none", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#none", + "text": "the none role" + }, + { + "id": "wai-aria-1.2-role-note", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#note", + "text": "the note role" + }, + { + "id": "wai-aria-1.2-role-option", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#option", + "text": "the option role" + }, + { + "id": "wai-aria-1.2-role-paragraph", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#paragraph", + "text": "the paragraph role" + }, + { + "id": "wai-aria-1.2-role-presentation", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#presentation", + "text": "the presentation role" + }, + { + "id": "wai-aria-1.2-role-progressbar", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#progressbar", + "text": "the progressbar role" + }, + { + "id": "wai-aria-1.2-role-radio", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#radio", + "text": "the radio role" + }, + { + "id": "wai-aria-1.2-role-radiogroup", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#radiogroup", + "text": "the radiogroup role" + }, + { + "id": "wai-aria-1.2-role-range", + "kind": "abstract role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#range", + "text": "the range role, which authors must not use" + }, + { + "id": "wai-aria-1.2-role-region", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#region", + "text": "the region role" + }, + { + "id": "wai-aria-1.2-role-roletype", + "kind": "abstract role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#roletype", + "text": "the roletype role, which authors must not use" + }, + { + "id": "wai-aria-1.2-role-row", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#row", + "text": "the row role" + }, + { + "id": "wai-aria-1.2-role-rowgroup", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#rowgroup", + "text": "the rowgroup role" + }, + { + "id": "wai-aria-1.2-role-rowheader", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#rowheader", + "text": "the rowheader role" + }, + { + "id": "wai-aria-1.2-role-scrollbar", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#scrollbar", + "text": "the scrollbar role" + }, + { + "id": "wai-aria-1.2-role-search", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#search", + "text": "the search role" + }, + { + "id": "wai-aria-1.2-role-searchbox", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#searchbox", + "text": "the searchbox role" + }, + { + "id": "wai-aria-1.2-role-section", + "kind": "abstract role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#section", + "text": "the section role, which authors must not use" + }, + { + "id": "wai-aria-1.2-role-sectionhead", + "kind": "abstract role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#sectionhead", + "text": "the sectionhead role, which authors must not use" + }, + { + "id": "wai-aria-1.2-role-select", + "kind": "abstract role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#select", + "text": "the select role, which authors must not use" + }, + { + "id": "wai-aria-1.2-role-separator", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#separator", + "text": "the separator role" + }, + { + "id": "wai-aria-1.2-role-slider", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#slider", + "text": "the slider role" + }, + { + "id": "wai-aria-1.2-role-spinbutton", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#spinbutton", + "text": "the spinbutton role" + }, + { + "id": "wai-aria-1.2-role-status", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#status", + "text": "the status role" + }, + { + "id": "wai-aria-1.2-role-strong", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#strong", + "text": "the strong role" + }, + { + "id": "wai-aria-1.2-role-structure", + "kind": "abstract role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#structure", + "text": "the structure role, which authors must not use" + }, + { + "id": "wai-aria-1.2-role-subscript", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#subscript", + "text": "the subscript role" + }, + { + "id": "wai-aria-1.2-role-superscript", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#superscript", + "text": "the superscript role" + }, + { + "id": "wai-aria-1.2-role-switch", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#switch", + "text": "the switch role" + }, + { + "id": "wai-aria-1.2-role-tab", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#tab", + "text": "the tab role" + }, + { + "id": "wai-aria-1.2-role-table", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#table", + "text": "the table role" + }, + { + "id": "wai-aria-1.2-role-tablist", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#tablist", + "text": "the tablist role" + }, + { + "id": "wai-aria-1.2-role-tabpanel", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#tabpanel", + "text": "the tabpanel role" + }, + { + "id": "wai-aria-1.2-role-term", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#term", + "text": "the term role" + }, + { + "id": "wai-aria-1.2-role-textbox", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#textbox", + "text": "the textbox role" + }, + { + "id": "wai-aria-1.2-role-time", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#time", + "text": "the time role" + }, + { + "id": "wai-aria-1.2-role-timer", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#timer", + "text": "the timer role" + }, + { + "id": "wai-aria-1.2-role-toolbar", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#toolbar", + "text": "the toolbar role" + }, + { + "id": "wai-aria-1.2-role-tooltip", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#tooltip", + "text": "the tooltip role" + }, + { + "id": "wai-aria-1.2-role-tree", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#tree", + "text": "the tree role" + }, + { + "id": "wai-aria-1.2-role-treegrid", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#treegrid", + "text": "the treegrid role" + }, + { + "id": "wai-aria-1.2-role-treeitem", + "kind": "role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#treeitem", + "text": "the treeitem role" + }, + { + "id": "wai-aria-1.2-role-widget", + "kind": "abstract role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#widget", + "text": "the widget role, which authors must not use" + }, + { + "id": "wai-aria-1.2-role-window", + "kind": "abstract role", + "ref": "https://www.w3.org/TR/wai-aria-1.2/#window", + "text": "the window role, which authors must not use" + } + ], + "wcag-2.2": [ + { + "id": "wcag-2.2-1.1.1", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#non-text-content", + "text": "Non-text Content" + }, + { + "id": "wcag-2.2-1.2.1", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#audio-only-and-video-only-prerecorded", + "text": "Audio-only and Video-only (Prerecorded)" + }, + { + "id": "wcag-2.2-1.2.2", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#captions-prerecorded", + "text": "Captions (Prerecorded)" + }, + { + "id": "wcag-2.2-1.2.3", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#audio-description-or-media-alternative-prerecorded", + "text": "Audio Description or Media Alternative (Prerecorded)" + }, + { + "id": "wcag-2.2-1.2.4", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#captions-live", + "text": "Captions (Live)" + }, + { + "id": "wcag-2.2-1.2.5", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#audio-description-prerecorded", + "text": "Audio Description (Prerecorded)" + }, + { + "id": "wcag-2.2-1.3.1", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#info-and-relationships", + "text": "Info and Relationships" + }, + { + "id": "wcag-2.2-1.3.2", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#meaningful-sequence", + "text": "Meaningful Sequence" + }, + { + "id": "wcag-2.2-1.3.3", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#sensory-characteristics", + "text": "Sensory Characteristics" + }, + { + "id": "wcag-2.2-1.3.4", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#orientation", + "text": "Orientation" + }, + { + "id": "wcag-2.2-1.3.5", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#identify-input-purpose", + "text": "Identify Input Purpose" + }, + { + "id": "wcag-2.2-1.4.1", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#use-of-color", + "text": "Use of Color" + }, + { + "id": "wcag-2.2-1.4.10", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#reflow", + "text": "Reflow" + }, + { + "id": "wcag-2.2-1.4.11", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#non-text-contrast", + "text": "Non-text Contrast" + }, + { + "id": "wcag-2.2-1.4.12", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#text-spacing", + "text": "Text Spacing" + }, + { + "id": "wcag-2.2-1.4.13", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#content-on-hover-or-focus", + "text": "Content on Hover or Focus" + }, + { + "id": "wcag-2.2-1.4.2", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#audio-control", + "text": "Audio Control" + }, + { + "id": "wcag-2.2-1.4.3", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#contrast-minimum", + "text": "Contrast (Minimum)" + }, + { + "id": "wcag-2.2-1.4.4", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#resize-text", + "text": "Resize Text" + }, + { + "id": "wcag-2.2-1.4.5", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#images-of-text", + "text": "Images of Text" + }, + { + "id": "wcag-2.2-2.1.1", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#keyboard", + "text": "Keyboard" + }, + { + "id": "wcag-2.2-2.1.2", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#no-keyboard-trap", + "text": "No Keyboard Trap" + }, + { + "id": "wcag-2.2-2.1.4", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#character-key-shortcuts", + "text": "Character Key Shortcuts" + }, + { + "id": "wcag-2.2-2.2.1", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#timing-adjustable", + "text": "Timing Adjustable" + }, + { + "id": "wcag-2.2-2.2.2", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#pause-stop-hide", + "text": "Pause, Stop, Hide" + }, + { + "id": "wcag-2.2-2.3.1", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#three-flashes-or-below-threshold", + "text": "Three Flashes or Below Threshold" + }, + { + "id": "wcag-2.2-2.4.1", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#bypass-blocks", + "text": "Bypass Blocks" + }, + { + "id": "wcag-2.2-2.4.11", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#focus-not-obscured-minimum", + "text": "Focus Not Obscured (Minimum)" + }, + { + "id": "wcag-2.2-2.4.2", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#page-titled", + "text": "Page Titled" + }, + { + "id": "wcag-2.2-2.4.3", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#focus-order", + "text": "Focus Order" + }, + { + "id": "wcag-2.2-2.4.4", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#link-purpose-in-context", + "text": "Link Purpose (In Context)" + }, + { + "id": "wcag-2.2-2.4.5", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#multiple-ways", + "text": "Multiple Ways" + }, + { + "id": "wcag-2.2-2.4.6", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#headings-and-labels", + "text": "Headings and Labels" + }, + { + "id": "wcag-2.2-2.4.7", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#focus-visible", + "text": "Focus Visible" + }, + { + "id": "wcag-2.2-2.5.1", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#pointer-gestures", + "text": "Pointer Gestures" + }, + { + "id": "wcag-2.2-2.5.2", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#pointer-cancellation", + "text": "Pointer Cancellation" + }, + { + "id": "wcag-2.2-2.5.3", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#label-in-name", + "text": "Label in Name" + }, + { + "id": "wcag-2.2-2.5.4", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#motion-actuation", + "text": "Motion Actuation" + }, + { + "id": "wcag-2.2-2.5.7", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#dragging-movements", + "text": "Dragging Movements" + }, + { + "id": "wcag-2.2-2.5.8", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#target-size-minimum", + "text": "Target Size (Minimum)" + }, + { + "id": "wcag-2.2-3.1.1", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#language-of-page", + "text": "Language of Page" + }, + { + "id": "wcag-2.2-3.1.2", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#language-of-parts", + "text": "Language of Parts" + }, + { + "id": "wcag-2.2-3.2.1", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#on-focus", + "text": "On Focus" + }, + { + "id": "wcag-2.2-3.2.2", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#on-input", + "text": "On Input" + }, + { + "id": "wcag-2.2-3.2.3", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#consistent-navigation", + "text": "Consistent Navigation" + }, + { + "id": "wcag-2.2-3.2.4", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#consistent-identification", + "text": "Consistent Identification" + }, + { + "id": "wcag-2.2-3.2.6", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#consistent-help", + "text": "Consistent Help" + }, + { + "id": "wcag-2.2-3.3.1", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#error-identification", + "text": "Error Identification" + }, + { + "id": "wcag-2.2-3.3.2", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#labels-or-instructions", + "text": "Labels or Instructions" + }, + { + "id": "wcag-2.2-3.3.3", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#error-suggestion", + "text": "Error Suggestion" + }, + { + "id": "wcag-2.2-3.3.4", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#error-prevention-legal-financial-data", + "text": "Error Prevention (Legal, Financial, Data)" + }, + { + "id": "wcag-2.2-3.3.7", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#redundant-entry", + "text": "Redundant Entry" + }, + { + "id": "wcag-2.2-3.3.8", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#accessible-authentication-minimum", + "text": "Accessible Authentication (Minimum)" + }, + { + "id": "wcag-2.2-4.1.2", + "kind": "success criterion, level A", + "ref": "https://www.w3.org/TR/WCAG22/#name-role-value", + "text": "Name, Role, Value" + }, + { + "id": "wcag-2.2-4.1.3", + "kind": "success criterion, level AA", + "ref": "https://www.w3.org/TR/WCAG22/#status-messages", + "text": "Status Messages" + } ] } diff --git a/tools/standards/extract/aria_html.py b/tools/standards/extract/aria_html.py new file mode 100644 index 00000000..bf3274fe --- /dev/null +++ b/tools/standards/extract/aria_html.py @@ -0,0 +1,40 @@ +"""WAI-ARIA's roles, states and properties from the W3C Recommendation itself. + +The Recommendation (https://www.w3.org/TR/wai-aria-1.2/) defines each role in +a section of class "role" headed by its name, and each state and property +in one headed by a "state-name" or "property-name". A role the text calls +abstract ("an abstract role used for the ontology") is one authors must +not use; every other role, state and property is one the page must use as +the Recommendation says wherever it uses it. +""" +import html +import re + + +def requirements(data: bytes, standard, inv): + text = data.decode("utf-8") + key = standard["key"] + out = [] + sections = re.split(r'(?=
", 1)[0] + abstract = "abstract role" in re.sub(r"<[^>]+>", "", body) + out.append({ + "id": f"{key}-role-{name}", + "kind": "abstract role" if abstract else "role", + "ref": f"{standard['text']['url']}#{name}", + "text": f"the {name} role" + (", which authors must not use" if abstract else ""), + }) + for kind in ("state", "property"): + for name in sorted(set(re.findall(rf'class="{kind}-name" title="(aria-[a-z]+)"', text))): + out.append({ + "id": f"{key}-{name}", + "kind": kind, + "ref": f"{standard['text']['url']}#{name}", + "text": html.unescape(f"the {name} {kind}"), + }) + return out diff --git a/tools/standards/extract/wcag_json.py b/tools/standards/extract/wcag_json.py new file mode 100644 index 00000000..75ab3fe7 --- /dev/null +++ b/tools/standards/extract/wcag_json.py @@ -0,0 +1,28 @@ +"""WCAG's success criteria from W3C's own machine-readable WCAG (wcag.json). + +W3C publishes every success criterion with its number, handle and level at +https://www.w3.org/WAI/WCAG22/wcag.json. A conformance claim is made at a +level (WCAG 2.2, section 5.2.1), so the inventory names the levels it +claims: "levels": ["A", "AA"] takes every criterion at A and at AA. A +criterion with no level is one the standard has made obsolete (4.1.1 +Parsing, removed in 2.2) and is never a requirement. +""" +import json + + +def requirements(data: bytes, standard, inv): + levels = set(inv.get("levels", ["A", "AA"])) + wcag = json.loads(data) + out = [] + for principle in wcag["principles"]: + for guideline in principle["guidelines"]: + for sc in guideline["successcriteria"]: + if sc["level"] not in levels: + continue + out.append({ + "id": f"{standard['key']}-{sc['num']}", + "kind": f"success criterion, level {sc['level']}", + "ref": f"https://www.w3.org/TR/WCAG22/#{sc['id']}", + "text": sc["handle"], + }) + return out diff --git a/tools/standards/gate.py b/tools/standards/gate.py index 10cf159f..0e064766 100644 --- a/tools/standards/gate.py +++ b/tools/standards/gate.py @@ -213,6 +213,23 @@ def claim(rid, suite, how): for standard in spec["standards"]: for rid, entry in sorted(standard.get("enforcedBy", {}).items()): claim(rid, entry.get("suite", ""), f"{standard['key']} enforcedBy {rid}") + # A standard may enforce every requirement of a kind alike; an id's own entry comes first. + by_kind = standard.get("enforcedByKind", {}) + for kind in sorted(by_kind): + if kind not in {r["kind"] for r in requirements.get(standard["key"], [])}: + refusals.append(f"{standard['key']} enforcedByKind names {kind!r}, which is the kind of none of its requirements") + for r in requirements.get(standard["key"], []): + entry = by_kind.get(r["kind"]) + if entry and r["id"] not in standard.get("enforcedBy", {}): + claim(r["id"], entry.get("suite", ""), f"{standard['key']} enforcedByKind {r['kind']}") + # A requirement its suite checks and finds failing is not enforced yet: it stays debt, + # with why, and the suite fails once it holds so the debt shrinks. + for rid, why in sorted(standard.get("failing", {}).items()): + if rid not in enforced: + refusals.append(f"{standard['key']} lists {rid} as failing, but no suite checks it") + elif not str(why).strip(): + refusals.append(f"{standard['key']} lists {rid} as failing with no reason") + enforced.pop(rid, None) return enforced