@ngbracket/a11y-devtools 0.18.4 → 0.18.5
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 +20 -0
- package/dist/inpage.global.js +1 -2
- package/dist/overlay.js +6 -2
- package/dist/report/headless.js +8 -6
- package/dist/toggle.js +6 -1
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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.18.5
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- The dashed line joining the tab-order badges is drawn opaque. At 70% opacity
|
|
11
|
+
the teal blended to about 2.5:1 on a white page, under the 3:1 that WCAG
|
|
12
|
+
1.4.11 asks of non-text content. Opaque, it measures 3.93:1 on white, 3.61:1
|
|
13
|
+
on #f5f5f5, 3.5:1 on #2d2d2d and 5.34:1 on black. On a mid-tone page it can
|
|
14
|
+
still fall under 3:1.
|
|
15
|
+
- The tab-order layer is clipped to the viewport. When the path ran past the
|
|
16
|
+
bottom of the window, axe's color-contrast check treated it as covering the
|
|
17
|
+
text below the fold and returned "needs review" for that text. A
|
|
18
|
+
low-contrast paragraph under the path was not reported as a violation.
|
|
19
|
+
Report mode already hid the overlay before scanning and still does, because
|
|
20
|
+
the app it scans may run an older overlay.
|
|
21
|
+
- The on/off pill and its menu now sit in a region labelled "Accessibility
|
|
22
|
+
developer tools". A page scan that doesn't exclude the overlay, such as an
|
|
23
|
+
axe browser extension, reported the pill under the best-practice `region`
|
|
24
|
+
rule as content outside any landmark.
|
|
25
|
+
|
|
6
26
|
## 0.18.4
|
|
7
27
|
|
|
8
28
|
### Fixed
|
package/dist/inpage.global.js
CHANGED
|
@@ -34350,14 +34350,13 @@
|
|
|
34350
34350
|
width: "100%",
|
|
34351
34351
|
height: "100%",
|
|
34352
34352
|
pointerEvents: "none",
|
|
34353
|
-
overflow: "
|
|
34353
|
+
overflow: "hidden"
|
|
34354
34354
|
});
|
|
34355
34355
|
const connector = doc.createElementNS(SVG_NS, "polyline");
|
|
34356
34356
|
connector.setAttribute("fill", "none");
|
|
34357
34357
|
connector.setAttribute("stroke", TAB_ORDER_COLOR);
|
|
34358
34358
|
connector.setAttribute("stroke-width", "2");
|
|
34359
34359
|
connector.setAttribute("stroke-dasharray", "4 3");
|
|
34360
|
-
connector.setAttribute("opacity", "0.7");
|
|
34361
34360
|
svg.appendChild(connector);
|
|
34362
34361
|
container.appendChild(svg);
|
|
34363
34362
|
const axPanel = doc.createElement("div");
|
package/dist/overlay.js
CHANGED
|
@@ -72,6 +72,8 @@ export function createOverlay(options = {}) {
|
|
|
72
72
|
const releaseTopLayer = keepInTopLayer(container, { document: doc });
|
|
73
73
|
// The tab-order connector lives on its own SVG layer under the badges, so the
|
|
74
74
|
// findings highlights and the tab-order path render and clear independently.
|
|
75
|
+
// Clipped to the viewport: a path left to overflow it covers text below the
|
|
76
|
+
// fold, and axe's color-contrast then gives up on that text ("needs review").
|
|
75
77
|
const svg = doc.createElementNS(SVG_NS, 'svg');
|
|
76
78
|
svg.setAttribute(OVERLAY_ATTR, '');
|
|
77
79
|
Object.assign(svg.style, {
|
|
@@ -80,14 +82,16 @@ export function createOverlay(options = {}) {
|
|
|
80
82
|
width: '100%',
|
|
81
83
|
height: '100%',
|
|
82
84
|
pointerEvents: 'none',
|
|
83
|
-
overflow: '
|
|
85
|
+
overflow: 'hidden',
|
|
84
86
|
});
|
|
87
|
+
// Drawn opaque so the line passes 3:1 for non-text contrast: the teal is
|
|
88
|
+
// 3.93:1 on white, 3.61:1 on #f5f5f5, 3.5:1 on #2d2d2d and 5.34:1 on black.
|
|
89
|
+
// At 0.7 opacity it blended to about 2.5:1 on white.
|
|
85
90
|
const connector = doc.createElementNS(SVG_NS, 'polyline');
|
|
86
91
|
connector.setAttribute('fill', 'none');
|
|
87
92
|
connector.setAttribute('stroke', TAB_ORDER_COLOR);
|
|
88
93
|
connector.setAttribute('stroke-width', '2');
|
|
89
94
|
connector.setAttribute('stroke-dasharray', '4 3');
|
|
90
|
-
connector.setAttribute('opacity', '0.7');
|
|
91
95
|
svg.appendChild(connector);
|
|
92
96
|
container.appendChild(svg); // under the badges, which are appended later
|
|
93
97
|
// The Focus preview panel: a fixed card that follows focus. Hidden
|
package/dist/report/headless.js
CHANGED
|
@@ -61,12 +61,14 @@ async function walkForFocusTrap(page, frameworkPrefixes) {
|
|
|
61
61
|
/** Settle time after switching a class/attribute theme, so colour transitions finish before axe reads them. */
|
|
62
62
|
const THEME_SETTLE_MS = 300;
|
|
63
63
|
/**
|
|
64
|
-
* Hides the in-app overlay (if the app runs it) for the headless scan.
|
|
65
|
-
* tab-order path
|
|
66
|
-
* color-contrast
|
|
67
|
-
* back "needs review" instead of pass/fail, so its contrast was never
|
|
68
|
-
* reported.
|
|
69
|
-
*
|
|
64
|
+
* Hides the in-app overlay (if the app runs it) for the headless scan. Up to
|
|
65
|
+
* 0.18.4 its tab-order path was a fixed SVG that overflowed the viewport, and
|
|
66
|
+
* axe's color-contrast counted it as covering text below the fold: that text
|
|
67
|
+
* came back "needs review" instead of pass/fail, so its contrast was never
|
|
68
|
+
* reported. The SVG is clipped to the viewport since 0.18.5, but the app being
|
|
69
|
+
* scanned may run an older overlay than this report, so the hide stays.
|
|
70
|
+
* Excluding the overlay from axe's context isn't enough; the exclude stops axe
|
|
71
|
+
* checking the overlay, not seeing it.
|
|
70
72
|
*/
|
|
71
73
|
const HIDE_OVERLAY_CSS = `${OVERLAY_EXCLUDE_SELECTOR} { display: none !important; }`;
|
|
72
74
|
/** Scan every route in one colour scheme, in its own browser context. */
|
package/dist/toggle.js
CHANGED
|
@@ -214,8 +214,13 @@ export function createTogglePill(options) {
|
|
|
214
214
|
pointerEvents: 'none',
|
|
215
215
|
zIndex: '2147483647',
|
|
216
216
|
});
|
|
217
|
-
// The switch, the optional menu button and its panel sit together in a corner
|
|
217
|
+
// The switch, the optional menu button and its panel sit together in a corner,
|
|
218
|
+
// in a labelled region so a page scan doesn't report the pill as content
|
|
219
|
+
// outside any landmark (axe's `region` rule). The region's name differs from
|
|
220
|
+
// the switch's, so tabbing in doesn't announce "a11y devtools" twice.
|
|
218
221
|
const group = doc.createElement('div');
|
|
222
|
+
group.setAttribute('role', 'region');
|
|
223
|
+
group.setAttribute('aria-label', 'Accessibility developer tools');
|
|
219
224
|
Object.assign(group.style, {
|
|
220
225
|
position: 'fixed',
|
|
221
226
|
[vertical]: '12px',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngbracket/a11y-devtools",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.5",
|
|
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",
|
|
@@ -90,6 +90,9 @@
|
|
|
90
90
|
"rxjs": "^7.8.2",
|
|
91
91
|
"tslib": "^2.8.1",
|
|
92
92
|
"typescript": "^6.0.3",
|
|
93
|
-
"vitest": "^4.1.
|
|
93
|
+
"vitest": "^4.1.12"
|
|
94
|
+
},
|
|
95
|
+
"overrides": {
|
|
96
|
+
"vite": "^8.3.5"
|
|
94
97
|
}
|
|
95
98
|
}
|