diff --git a/docs/accessibility.md b/docs/accessibility.md index 9f26e3d..b5b674e 100644 --- a/docs/accessibility.md +++ b/docs/accessibility.md @@ -49,7 +49,7 @@ restores the page for searching. | Check | Where | What it covers | |---|---|---| -| axe-core 4.13.0, WCAG 2.0/2.1/2.2 A and AA rules | `test/e2e/a11y.spec.mjs` | Every surface and state in the table below, light and dark: zero violations | +| axe-core 4.14.1, WCAG 2.0/2.1/2.2 A and AA rules | `test/e2e/a11y.spec.mjs` | Every surface and state in the table below, light and dark: zero violations | | Keyboard walk | same file, `test/helpers/a11y-checks.mjs` | Tab reaches every control; each shows a focus indicator (outline or ring, else a screenshot difference); none is hidden under a sticky header or bar (2.4.11); modal layers keep Tab inside | | Target size | same | Every pointer target at least 24 × 24 CSS px (2.5.8), WCAG's inline-link exception aside; the word card's buttons too | | Text spacing | same | WCAG's 1.4.12 overrides cut no text off, except in the word list's one-line rows (the inspector shows every field whole) | diff --git a/extension/_locales/en/messages.json b/extension/_locales/en/messages.json index f380cd2..ac423d2 100644 --- a/extension/_locales/en/messages.json +++ b/extension/_locales/en/messages.json @@ -746,8 +746,8 @@ "description": "Second line of the All card." }, "dash_shelf_all_label_one": { - "message": "All languages, $COUNT$ word", - "description": "Accessible name of the All card.", + "message": "All, every language, $COUNT$ word", + "description": "Accessible name of the All card. Starts with the card's visible text (dash_shelf_all, dash_shelf_all_sub, the count), in that order (WCAG 2.5.3).", "placeholders": { "count": { "content": "{count}" @@ -755,8 +755,8 @@ } }, "dash_shelf_all_label_other": { - "message": "All languages, $COUNT$ words", - "description": "Accessible name of the All card.", + "message": "All, every language, $COUNT$ words", + "description": "Accessible name of the All card. Starts with the card's visible text (dash_shelf_all, dash_shelf_all_sub, the count), in that order (WCAG 2.5.3).", "placeholders": { "count": { "content": "{count}" @@ -764,8 +764,8 @@ } }, "dash_shelf_card_label_one": { - "message": "$LANGUAGE$, $ENDONYM$, $COUNT$ word", - "description": "Accessible name of a language card. {language} in the interface language, {endonym} in its own.", + "message": "$ENDONYM$, $LANGUAGE$, $COUNT$ (word)", + "description": "Accessible name of a language card, in the order the card shows it (WCAG 2.5.3): {endonym} in the language itself, {language} in the interface language, then the count. The unit is in parentheses so the visible text stays an unbroken run of the name.", "placeholders": { "language": { "content": "{language}" @@ -779,8 +779,8 @@ } }, "dash_shelf_card_label_other": { - "message": "$LANGUAGE$, $ENDONYM$, $COUNT$ words", - "description": "Accessible name of a language card.", + "message": "$ENDONYM$, $LANGUAGE$, $COUNT$ (words)", + "description": "Accessible name of a language card, in the order the card shows it (WCAG 2.5.3): {endonym} in the language itself, {language} in the interface language, then the count. The unit is in parentheses so the visible text stays an unbroken run of the name.", "placeholders": { "language": { "content": "{language}" @@ -793,35 +793,9 @@ } } }, - "dash_shelf_card_label_hidden_one": { - "message": "$LANGUAGE$, $ENDONYM$, $COUNT$ word, hidden on pages", - "description": "Accessible name of a hidden language's card.", - "placeholders": { - "language": { - "content": "{language}" - }, - "endonym": { - "content": "{endonym}" - }, - "count": { - "content": "{count}" - } - } - }, - "dash_shelf_card_label_hidden_other": { - "message": "$LANGUAGE$, $ENDONYM$, $COUNT$ words, hidden on pages", - "description": "Accessible name of a hidden language's card.", - "placeholders": { - "language": { - "content": "{language}" - }, - "endonym": { - "content": "{endonym}" - }, - "count": { - "content": "{count}" - } - } + "dash_shelf_hidden_label": { + "message": "hidden (on pages)", + "description": "Added to a hidden language card's accessible name. Starts with dash_shelf_hidden, the word the card shows (WCAG 2.5.3); the rest is in parentheses." }, "dash_shelf_week_one": { "message": "+$COUNT$ this week", diff --git a/extension/_locales/es/messages.json b/extension/_locales/es/messages.json index 01eb56e..63b3a72 100644 --- a/extension/_locales/es/messages.json +++ b/extension/_locales/es/messages.json @@ -746,8 +746,8 @@ "description": "Second line of the All card." }, "dash_shelf_all_label_one": { - "message": "Todos los idiomas, $COUNT$ palabra", - "description": "Accessible name of the All card.", + "message": "Todas, todos los idiomas, $COUNT$ palabra", + "description": "Accessible name of the All card. Starts with the card's visible text (dash_shelf_all, dash_shelf_all_sub, the count), in that order (WCAG 2.5.3).", "placeholders": { "count": { "content": "{count}" @@ -755,8 +755,8 @@ } }, "dash_shelf_all_label_other": { - "message": "Todos los idiomas, $COUNT$ palabras", - "description": "Accessible name of the All card.", + "message": "Todas, todos los idiomas, $COUNT$ palabras", + "description": "Accessible name of the All card. Starts with the card's visible text (dash_shelf_all, dash_shelf_all_sub, the count), in that order (WCAG 2.5.3).", "placeholders": { "count": { "content": "{count}" @@ -764,8 +764,8 @@ } }, "dash_shelf_card_label_one": { - "message": "$LANGUAGE$, $ENDONYM$, $COUNT$ palabra", - "description": "Accessible name of a language card. {language} in the interface language, {endonym} in its own.", + "message": "$ENDONYM$, $LANGUAGE$, $COUNT$ (palabra)", + "description": "Accessible name of a language card, in the order the card shows it (WCAG 2.5.3): {endonym} in the language itself, {language} in the interface language, then the count. The unit is in parentheses so the visible text stays an unbroken run of the name.", "placeholders": { "language": { "content": "{language}" @@ -779,8 +779,8 @@ } }, "dash_shelf_card_label_other": { - "message": "$LANGUAGE$, $ENDONYM$, $COUNT$ palabras", - "description": "Accessible name of a language card.", + "message": "$ENDONYM$, $LANGUAGE$, $COUNT$ (palabras)", + "description": "Accessible name of a language card, in the order the card shows it (WCAG 2.5.3): {endonym} in the language itself, {language} in the interface language, then the count. The unit is in parentheses so the visible text stays an unbroken run of the name.", "placeholders": { "language": { "content": "{language}" @@ -793,35 +793,9 @@ } } }, - "dash_shelf_card_label_hidden_one": { - "message": "$LANGUAGE$, $ENDONYM$, $COUNT$ palabra, oculta en las páginas", - "description": "Accessible name of a hidden language's card.", - "placeholders": { - "language": { - "content": "{language}" - }, - "endonym": { - "content": "{endonym}" - }, - "count": { - "content": "{count}" - } - } - }, - "dash_shelf_card_label_hidden_other": { - "message": "$LANGUAGE$, $ENDONYM$, $COUNT$ palabras, ocultas en las páginas", - "description": "Accessible name of a hidden language's card.", - "placeholders": { - "language": { - "content": "{language}" - }, - "endonym": { - "content": "{endonym}" - }, - "count": { - "content": "{count}" - } - } + "dash_shelf_hidden_label": { + "message": "oculto (en las páginas)", + "description": "Added to a hidden language card's accessible name. Starts with dash_shelf_hidden, the word the card shows (WCAG 2.5.3); the rest is in parentheses." }, "dash_shelf_week_one": { "message": "+$COUNT$ esta semana", diff --git a/extension/dashboard.js b/extension/dashboard.js index d6b42f6..1740211 100644 --- a/extension/dashboard.js +++ b/extension/dashboard.js @@ -642,11 +642,16 @@ "aria-label": extra.label, onclick: () => setParams({ lang: selected && lang ? null : lang || null }), }, + // The spaces keep the card's text in separate words ("Español Spanish 3"), which the + // name has to contain word for word (WCAG 2.5.3). The card and its foot are flex + // boxes, so the spaces aren't drawn. el("span", { class: "shelf-title", lang: lang || null, dir: "auto" }, title), + " ", el("span", { class: "shelf-sub" }, sub), + " ", el("span", { class: "shelf-foot" }, el("span", { class: "shelf-count num" }, I18n.formatNumber(count)), - meta)); + (meta ?? []).flatMap((m) => [" ", m]))); const li = el("li", { class: `shelf-item${extra.hidden ? " is-hidden" : ""}` }, main); if (extra.menu) { li.append(el("button", { @@ -665,9 +670,19 @@ const items = [card("", t("dash_shelf_all"), t("dash_shelf_all_sub"), total, null, { label: t("dash_shelf_all_label", { count: total }) })]; for (const e of entries) { const meta = []; - if (e.week) meta.push(el("span", { class: "shelf-week" }, t("dash_shelf_week", { count: e.week }))); - if (e.hidden) meta.push(el("span", { class: "shelf-hidden" }, icon("circle", 12), t("dash_shelf_hidden"))); - const label = t(e.hidden ? "dash_shelf_card_label_hidden" : "dash_shelf_card_label", { language: e.name, endonym: endonym(e.lang), count: e.count }); + // The name follows the card's visible text, in the same order, so it contains what a + // voice-control user reads off the card (WCAG 2.5.3 Label in Name). + const name = [t("dash_shelf_card_label", { language: e.name, endonym: endonym(e.lang), count: e.count })]; + if (e.week) { + const week = t("dash_shelf_week", { count: e.week }); + meta.push(el("span", { class: "shelf-week" }, week)); + name.push(week); + } + if (e.hidden) { + meta.push(el("span", { class: "shelf-hidden" }, icon("circle", 12), t("dash_shelf_hidden"))); + name.push(t("dash_shelf_hidden_label")); + } + const label = name.join(", "); items.push(card(e.lang, endonym(e.lang), e.name, e.count, meta, { label, hidden: e.hidden, menu: e })); } items.push(el("li", { class: "shelf-item" }, el("button", { class: "shelf-card shelf-start", type: "button", onclick: startLanguage }, diff --git a/extension/popup.js b/extension/popup.js index a7fd249..aecb065 100644 --- a/extension/popup.js +++ b/extension/popup.js @@ -482,6 +482,7 @@ }, icon(l.hidden ? "circle" : "check", 14), el("span", { class: "chip-label", lang: l.lang, dir: "auto" }, l.endonym), + " ", // a word break: 2.5.3 el("span", { class: "chip-count num", "aria-hidden": "true" }, I18n.formatNumber(l.count))); // On: a check; off: a hollow circle (06 §10), so state never relies on color. main.querySelector(".icon").classList.add("chip-glyph"); diff --git a/package-lock.json b/package-lock.json index 5a11380..3e71edf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,17 +8,17 @@ "devDependencies": { "@devicefarmer/adbkit": "file:scripts/no-adbkit", "@eslint/js": "10.0.1", - "@playwright/test": "1.65.0", + "@playwright/test": "1.65.1", "@stylistic/eslint-plugin": "5.10.0", - "axe-core": "4.13.0", + "axe-core": "4.14.1", "chrome-webstore-upload": "6.0.1", "chrome-webstore-upload-cli": "4.0.2", "cldr-core": "49.0.0", "cldr-localenames-full": "49.0.0", - "eslint": "10.14.0", + "eslint": "10.15.0", "eslint-plugin-no-unsanitized": "4.1.5", - "fake-indexeddb": "6.2.7", - "fast-check": "4.10.2", + "fake-indexeddb": "6.2.8", + "fast-check": "4.10.3", "fflate": "0.8.3", "globals": "17.14.0", "jsdom": "31.0.1", @@ -134,15 +134,15 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.23.5", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", - "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", + "version": "0.23.7", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.7.tgz", + "integrity": "sha512-Ix1tmZjA7/OmE7ROAfORe83hVnqlDzLpZVHFjHQt5mvLm1U03qMexpaxKqFIL362QV32SoPaZqmKQr3tdqFY2w==", "dev": true, "license": "Apache-2.0", "dependencies": { "@eslint/object-schema": "^3.0.5", "debug": "^4.3.1", - "minimatch": "^10.2.4" + "minimatch": "^11.0.5" }, "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" @@ -198,24 +198,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.21", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", - "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/@eslint/eslintrc/node_modules/eslint-visitor-keys": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", @@ -260,19 +242,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@eslint/eslintrc/node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -482,13 +451,13 @@ "license": "MIT" }, "node_modules/@playwright/test": { - "version": "1.65.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.65.0.tgz", - "integrity": "sha512-iGURLGuKDLakSEl7Pgfv8h7f+XLT+V861Wfhz0zlEl5nyFuKUopdkFBPKqTllTUp06aOwPuH8iuUEb3yp3MpbQ==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.65.1.tgz", + "integrity": "sha512-y+NCIRm2LvY4slUVWvGh1nujJ8RF/hEisIsq2mtUPgdQC4L701bq5hZGMhrpeXjACvwvO9tj5dJqhvM6TP9lbw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.65.0" + "playwright": "1.65.1" }, "bin": { "playwright": "cli.js" @@ -1235,9 +1204,9 @@ } }, "node_modules/axe-core": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.13.0.tgz", - "integrity": "sha512-UzGt8zg7Ny8djbYMhxl2zuEevVa7r2gJjYY5Lwr1xM7+XU2nd6CkIWFTVcCIbAP63vSz71NaVyyuSk9lHKcy0A==", + "version": "4.14.1", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.14.1.tgz", + "integrity": "sha512-FHfa+lmNjQZfJz1q8wKqIDwC6DExcHt/pkjNQb09a3NPjCKg2rhu5qb2S4r76ASyFNNtuFooJpZe37OgudVGtQ==", "dev": true, "license": "MPL-2.0", "engines": { @@ -1312,9 +1281,9 @@ } }, "node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.2.tgz", + "integrity": "sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw==", "dev": true, "license": "MIT", "dependencies": { @@ -2153,9 +2122,9 @@ } }, "node_modules/eslint": { - "version": "10.14.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.14.0.tgz", - "integrity": "sha512-T0pNsxkb9IKmtQjhpK3d7nWOpFv+YHuMbTJnSVMoQblF0onvXfErrtp4V1jHtsQPan7dKaGVD0q1WCXnzMF31A==", + "version": "10.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.15.0.tgz", + "integrity": "sha512-+5Wg4p+ze3sG1WErYgUO/3H1IQIfFBymVUA0Fo/XTeBOLS6UQIUekpSJ8sdRkn7O7wjh84b55w/roqavH2aScg==", "dev": true, "license": "MIT", "workspaces": [ @@ -2164,7 +2133,7 @@ "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.2", - "@eslint/config-array": "^0.23.5", + "@eslint/config-array": "^0.23.6", "@eslint/config-helpers": "^0.7.0", "@eslint/core": "^1.2.1", "@eslint/plugin-kit": "^0.7.3", @@ -2189,7 +2158,7 @@ "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "minimatch": "^10.2.6", + "minimatch": "^11.0.5", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, @@ -2332,9 +2301,9 @@ } }, "node_modules/fake-indexeddb": { - "version": "6.2.7", - "resolved": "https://registry.npmjs.org/fake-indexeddb/-/fake-indexeddb-6.2.7.tgz", - "integrity": "sha512-g0ghQ+BmU3CSZaHup5FigEAAtCmtNyxkrmID7OAeK2qONHghw1aQ2l2T1RxmfhP1H1tEXVRWArUTGVCk5832ww==", + "version": "6.2.8", + "resolved": "https://registry.npmjs.org/fake-indexeddb/-/fake-indexeddb-6.2.8.tgz", + "integrity": "sha512-mpVW/HLUqwKXJ6F/s0hMgdK1eQfM4ncTHDioNGHWL0WKV3VcZCoZq1NKgboBbAge07aRCO7L48yziKssL59XEQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -2342,9 +2311,9 @@ } }, "node_modules/fast-check": { - "version": "4.10.2", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.10.2.tgz", - "integrity": "sha512-iK2f+YrcmoeGqk6fA0ea2bptcu/itMIm4NfEozq6N25+aG6h7s5HZbB/k1aV7b5w5sFLMCbbtRUsTVR+BgC3xw==", + "version": "4.10.3", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.10.3.tgz", + "integrity": "sha512-SBaU6nhh+sXxb05r2IHAKfxnR/1Pu6MqtHYaewM1BY6V5xzOxOk+4yoWO7WfeeyZG1iArFE6/DO/7iLYMUuOJg==", "dev": true, "funding": [ { @@ -3466,9 +3435,9 @@ } }, "node_modules/minimatch": { - "version": "11.0.8", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz", - "integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==", + "version": "11.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.10.tgz", + "integrity": "sha512-L3/cjhQ5E6lft0VCp/2mO3Ic74RnutKy3rz7iGwp/6w1hKcO262g2rbfacFyw6eBig5OdI0nu5PpuA0/WQs9Tw==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -3887,13 +3856,13 @@ "license": "MIT" }, "node_modules/playwright": { - "version": "1.65.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.0.tgz", - "integrity": "sha512-F3AMWcR44qMBt4kq+6Kb6mX7bjGXshktKFOPULd7reED6ZJWevjbNRqysP7q+AATE9kdPEZBibex1BYsvpVoeA==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.1.tgz", + "integrity": "sha512-vJ1FuoOrNwOKHUIVEvSt3jT1L+wjjDpwhwIstKtfvTh8XIG4FG4bIFuvNdMxi81LGfAhUgUZleVFaOLY4RIUUw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.65.0" + "playwright-core": "1.65.1" }, "bin": { "playwright": "cli.js" @@ -3903,9 +3872,9 @@ } }, "node_modules/playwright-core": { - "version": "1.65.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.0.tgz", - "integrity": "sha512-vNSKgH6YqtN7cdT/L334zo0a+YwkrpicyrHJlWWPIm/Q+Nn2SWInil01oT0mbu96U4GgoRtCYQD9CzJQgju+lA==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.1.tgz", + "integrity": "sha512-hqPpz7blSMPxWVdoeE1yiBSzXsKiVOd2k+kjCvmUywD2GPO2Dd9HfcWnq9NN0GHbNZDFgZ9JfBFr+X5/BLo0qw==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index ce6f349..280a501 100644 --- a/package.json +++ b/package.json @@ -17,17 +17,17 @@ "devDependencies": { "@devicefarmer/adbkit": "file:scripts/no-adbkit", "@eslint/js": "10.0.1", - "@playwright/test": "1.65.0", + "@playwright/test": "1.65.1", "@stylistic/eslint-plugin": "5.10.0", - "axe-core": "4.13.0", + "axe-core": "4.14.1", "chrome-webstore-upload": "6.0.1", "chrome-webstore-upload-cli": "4.0.2", "cldr-core": "49.0.0", "cldr-localenames-full": "49.0.0", - "eslint": "10.14.0", + "eslint": "10.15.0", "eslint-plugin-no-unsanitized": "4.1.5", - "fake-indexeddb": "6.2.7", - "fast-check": "4.10.2", + "fake-indexeddb": "6.2.8", + "fast-check": "4.10.3", "fflate": "0.8.3", "globals": "17.14.0", "jsdom": "31.0.1", @@ -40,10 +40,10 @@ "shell-quote": "1.11.0", "@devicefarmer/adbkit": "$@devicefarmer/adbkit", "eslint": { - "minimatch": "11.0.8" + "minimatch": "11.0.10" }, "@eslint/config-array": { - "minimatch": "11.0.8" + "minimatch": "11.0.10" } } } diff --git a/test/dom/dashboard.test.mjs b/test/dom/dashboard.test.mjs index 7bd6e2d..712d774 100644 --- a/test/dom/dashboard.test.mjs +++ b/test/dom/dashboard.test.mjs @@ -184,7 +184,10 @@ describe("states (§11)", () => { assert.equal(cards[0].getAttribute("aria-pressed"), "true", "All is selected"); assert.equal(cards[1].querySelector(".shelf-title").textContent, "Русский"); assert.equal(cards[1].querySelector(".shelf-title").lang, "ru"); - assert.equal(cards[1].getAttribute("aria-label"), "Russian, Русский, 5 words"); + // The name leads with the card's visible text, in its order (WCAG 2.5.3 Label in Name). + assert.equal(cards[0].getAttribute("aria-label"), `All, every language, ${cards[0].querySelector(".shelf-count").textContent} words`); + assert.equal(cards[1].getAttribute("aria-label"), "Русский, Russian, 5 (words), +2 this week"); + assert.equal(cards[1].textContent, "Русский Russian 5 +2 this week", "the card's text keeps its words apart"); assert.equal(d.$("#app").dataset.ready, "true"); }); diff --git a/test/dom/popup.test.mjs b/test/dom/popup.test.mjs index a0b94b4..31005cc 100644 --- a/test/dom/popup.test.mjs +++ b/test/dom/popup.test.mjs @@ -186,6 +186,7 @@ describe("states", () => { assert.deepEqual(chips.map((c) => c.querySelector(".chip-label").textContent), ["Русский", "العربية", "Español", "日本語"]); assert.equal(chips[0].getAttribute("aria-label"), "Russian, Русский, 3 words, shown"); assert.equal(chips[3].getAttribute("aria-label"), "Japanese, 日本語, 1 word, shown"); + assert.equal(chips[0].textContent, "Русский 3", "the chip's text keeps its words apart, so the name contains it (WCAG 2.5.3)"); assert.equal(chips[0].getAttribute("aria-pressed"), "true"); assert.equal(chips[1].querySelector(".chip-label").lang, "ar"); assert.deepEqual(chips.map((c) => c.tabIndex), [0, -1, -1, -1], "one tab stop for the chip toolbar"); diff --git a/test/helpers/a11y-checks.mjs b/test/helpers/a11y-checks.mjs index 8e8e72e..e60c8cf 100644 --- a/test/helpers/a11y-checks.mjs +++ b/test/helpers/a11y-checks.mjs @@ -68,6 +68,15 @@ async function expectedStops(page) { export async function tabWalk(page, { max = 250 } = {}) { await page.evaluate(describeFn); await page.addStyleTag({ content: "*, *::before, *::after { caret-color: transparent !important; }" }).catch(() => {}); + // Every scroll position, so the walk leaves the page as it found it. Tab scrolls each + // stop into view; without this, the checks that run next (axe in the other theme) see + // whatever the last stop left, such as a scrolling row stopped at its end with a card + // half outside it, and axe reads only the on-screen part of that card's text. + await page.evaluate(() => { + globalThis.__kScroll = [document.scrollingElement, ...document.querySelectorAll("*")] + .filter((n) => n && (n.scrollTop || n.scrollLeft || n.scrollHeight > n.clientHeight || n.scrollWidth > n.clientWidth)) + .map((n) => [n, n.scrollLeft, n.scrollTop]); + }); // Start at the top of the page (or of the open modal layer): a focusable marker put first // in the body sets the browser's sequential focus starting point, then goes away. await page.evaluate(() => { @@ -191,6 +200,10 @@ export async function tabWalk(page, { max = 250 } = {}) { if (left.get(e.name)) left.set(e.name, left.get(e.name) - 1); else problems.push(`not reachable with Tab: ${e.name}`); } + await page.evaluate(() => { + for (const [n, left, top] of globalThis.__kScroll ?? []) if (n.isConnected) n.scrollTo({ left, top, behavior: "instant" }); + delete globalThis.__kScroll; + }); return { stops, problems }; }