@ngbracket/a11y-devtools 0.15.7 → 0.15.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/report/headless.js +11 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to `@ngbracket/a11y-devtools` are documented here.
|
|
4
4
|
This project adheres to [Semantic Versioning](https://semver.org/).
|
|
5
5
|
|
|
6
|
+
## 0.15.8
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- Report mode now checks colour contrast below the fold when the app runs the
|
|
11
|
+
in-app overlay. The overlay's tab-order path is drawn on a fixed SVG that
|
|
12
|
+
runs past the bottom of the viewport. axe counted it as covering the text
|
|
13
|
+
there, so its contrast check returned "needs review" instead of a result,
|
|
14
|
+
and report mode doesn't list those. Contrast problems on parts of a page
|
|
15
|
+
below the report's 900px-tall viewport could go unreported, in light and
|
|
16
|
+
dark passes. Report mode now hides the overlay before it scans. On the
|
|
17
|
+
public demo this brings back two dark-mode contrast failures the dark pass
|
|
18
|
+
had missed.
|
|
19
|
+
|
|
6
20
|
## 0.15.7
|
|
7
21
|
|
|
8
22
|
### Fixed
|
package/dist/report/headless.js
CHANGED
|
@@ -3,6 +3,7 @@ import { createRequire } from 'node:module';
|
|
|
3
3
|
import { dirname, resolve } from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { detectTabTrap } from '../keyboard/focus-walk.js';
|
|
6
|
+
import { OVERLAY_EXCLUDE_SELECTOR } from '../overlay.js';
|
|
6
7
|
import { findingsNotIn } from './baseline.js';
|
|
7
8
|
async function loadPlaywright() {
|
|
8
9
|
try {
|
|
@@ -59,6 +60,15 @@ async function walkForFocusTrap(page, frameworkPrefixes) {
|
|
|
59
60
|
}
|
|
60
61
|
/** Settle time after switching a class/attribute theme, so colour transitions finish before axe reads them. */
|
|
61
62
|
const THEME_SETTLE_MS = 300;
|
|
63
|
+
/**
|
|
64
|
+
* Hides the in-app overlay (if the app runs it) for the headless scan. Its
|
|
65
|
+
* tab-order path is a fixed SVG that overflows the viewport, and axe's
|
|
66
|
+
* color-contrast counts it as covering text below the fold: that text came
|
|
67
|
+
* back "needs review" instead of pass/fail, so its contrast was never
|
|
68
|
+
* reported. Excluding the overlay from axe's context isn't enough; the exclude
|
|
69
|
+
* stops axe checking the overlay, not seeing it.
|
|
70
|
+
*/
|
|
71
|
+
const HIDE_OVERLAY_CSS = `${OVERLAY_EXCLUDE_SELECTOR} { display: none !important; }`;
|
|
62
72
|
/** Scan every route in one colour scheme, in its own browser context. */
|
|
63
73
|
async function scanPass(browser, colorScheme, config) {
|
|
64
74
|
const { baseUrl, routes, labels, waitMs, axeOptions, inPageScript, frameworkPrefixes } = config;
|
|
@@ -92,6 +102,7 @@ async function scanPass(browser, colorScheme, config) {
|
|
|
92
102
|
}
|
|
93
103
|
if (config.beforeScan)
|
|
94
104
|
await config.beforeScan(page, { colorScheme, route });
|
|
105
|
+
await page.addStyleTag({ content: HIDE_OVERLAY_CSS });
|
|
95
106
|
await page.addScriptTag({ content: inPageScript });
|
|
96
107
|
const findings = (await page.evaluate((args) => {
|
|
97
108
|
const w = window;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngbracket/a11y-devtools",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.8",
|
|
4
4
|
"description": "Finds accessibility problems in Angular apps and names the component behind each one. A dev overlay, or headless reports for CI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Duncan Faulkner",
|