@surea11y/core 1.3.0 → 1.4.1
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 +87 -2
- package/README.md +109 -35
- package/bin/surea11y-core.js +20 -0
- package/docs/API_STABILITY.md +26 -0
- package/docs/ARIA_DEPRECATION.md +95 -0
- package/docs/CI_INTEGRATIONS.md +7 -7
- package/docs/ENGINE_OPTIONS.md +1 -1
- package/docs/I18N.md +12 -9
- package/docs/INTEGRATION.md +1 -1
- package/docs/LIMITATIONS.md +1 -1
- package/docs/REPORT.md +1 -1
- package/docs/RULE_CATALOG.md +6 -6
- package/package.json +52 -16
- package/src/baseline.js +0 -0
- package/src/checks/automatic/area-alt-present.js +4 -6
- package/src/checks/automatic/aria-allowed-attr.js +663 -134
- package/src/checks/automatic/aria-allowed-role.js +2 -0
- package/src/checks/automatic/aria-braille-equivalent.js +2 -0
- package/src/checks/automatic/aria-conditional-attr.js +8 -7
- package/src/checks/automatic/aria-deprecated-role.js +107 -38
- package/src/checks/automatic/aria-hidden-body.js +6 -4
- package/src/checks/automatic/aria-hidden-focus.js +12 -13
- package/src/checks/automatic/aria-prohibited-attr.js +98 -105
- package/src/checks/automatic/aria-prohibited-children.js +56 -87
- package/src/checks/automatic/aria-required-attr.js +6 -7
- package/src/checks/automatic/aria-required-children.js +7 -10
- package/src/checks/automatic/aria-required-parent.js +20 -25
- package/src/checks/automatic/aria-role-name-present.js +2 -0
- package/src/checks/automatic/aria-roles-valid.js +33 -6
- package/src/checks/automatic/aria-valid-attr-value.js +18 -15
- package/src/checks/automatic/aria-valid-attr.js +2 -0
- package/src/checks/automatic/autocomplete-valid.js +39 -1
- package/src/checks/automatic/avoid-inline-spacing.js +181 -20
- package/src/checks/automatic/binary-control-name-present.js +13 -3
- package/src/checks/automatic/button-name-present.js +54 -21
- package/src/checks/automatic/canvas-text-alternative-present.js +17 -8
- package/src/checks/automatic/combobox-name-present.js +10 -1
- package/src/checks/automatic/contrast-computable.js +2 -0
- package/src/checks/automatic/contrast-enhanced.js +2 -0
- package/src/checks/automatic/contrast-minimum.js +2 -0
- package/src/checks/automatic/css-orientation-lock.js +21 -27
- package/src/checks/automatic/definition-list-children-valid.js +6 -6
- package/src/checks/automatic/deprecated-elements-not-used.js +4 -2
- package/src/checks/automatic/dialog-name-present.js +18 -11
- package/src/checks/automatic/dlitem-parent-valid.js +2 -0
- package/src/checks/automatic/duplicate-id-aria.js +4 -3
- package/src/checks/automatic/embed-text-alternative-present.js +2 -0
- package/src/checks/automatic/form-control-programmatic-label-present.js +50 -4
- package/src/checks/automatic/form-control-single-label.js +110 -43
- package/src/checks/automatic/html-xml-lang-mismatch.js +2 -0
- package/src/checks/automatic/iframe-focusable-content.js +246 -18
- package/src/checks/automatic/iframe-name-present.js +2 -0
- package/src/checks/automatic/iframe-title-unique.js +3 -1
- package/src/checks/automatic/img-alt-present.js +23 -18
- package/src/checks/automatic/input-image-alt-present.js +101 -52
- package/src/checks/automatic/label-in-name.js +97 -27
- package/src/checks/automatic/language-page-present.js +7 -1
- package/src/checks/automatic/link-in-text-block.js +2 -0
- package/src/checks/automatic/link-name-present.js +52 -17
- package/src/checks/automatic/list-children-valid.js +14 -24
- package/src/checks/automatic/listbox-name-present.js +10 -1
- package/src/checks/automatic/listitem-parent-valid.js +30 -7
- package/src/checks/automatic/menuitem-name-present.js +10 -1
- package/src/checks/automatic/meta-refresh-no-exceptions.js +33 -4
- package/src/checks/automatic/meta-refresh-timing-absent.js +32 -4
- package/src/checks/automatic/meta-viewport-zoom-enabled.js +39 -15
- package/src/checks/automatic/meter-name-present.js +12 -4
- package/src/checks/automatic/nested-interactive-controls-absent.js +177 -25
- package/src/checks/automatic/object-text-alternative-present.js +16 -7
- package/src/checks/automatic/option-name-present.js +10 -1
- package/src/checks/automatic/page-title-present.js +2 -0
- package/src/checks/automatic/progressbar-name-present.js +16 -11
- package/src/checks/automatic/role-img-alt-present.js +4 -4
- package/src/checks/automatic/searchbox-name-present.js +10 -1
- package/src/checks/automatic/server-side-image-map-absent.js +4 -3
- package/src/checks/automatic/slider-name-present.js +13 -2
- package/src/checks/automatic/spinbutton-name-present.js +10 -1
- package/src/checks/automatic/summary-name-present.js +10 -1
- package/src/checks/automatic/svg-image-text-alternative-present.js +2 -0
- package/src/checks/automatic/svg-text-alternative-present.js +17 -5
- package/src/checks/automatic/tab-name-present.js +10 -1
- package/src/checks/automatic/table-headers-attr-valid.js +3 -2
- package/src/checks/automatic/table-th-has-data-cells.js +69 -6
- package/src/checks/automatic/target-size-minimum.js +5 -0
- package/src/checks/automatic/td-has-header.js +24 -1
- package/src/checks/automatic/textbox-name-present.js +10 -1
- package/src/checks/automatic/tooltip-name-present.js +10 -1
- package/src/checks/automatic/treeitem-name-present.js +10 -1
- package/src/checks/automatic/valid-lang.js +18 -3
- package/src/checks/automatic/video-poster-text-alternative-present.js +2 -0
- package/src/checks/manual/accesskeys-manual.js +3 -1
- package/src/checks/manual/area-alt-decorative-manual.js +2 -0
- package/src/checks/manual/area-alt-quality-manual.js +2 -0
- package/src/checks/manual/aria-checked-state-mismatch-manual.js +14 -23
- package/src/checks/manual/aria-text-manual.js +6 -5
- package/src/checks/manual/bypass-blocks-present-manual.js +279 -0
- package/src/checks/manual/canvas-text-alternative-quality-manual.js +2 -0
- package/src/checks/manual/css-hidden-focus.js +184 -9
- package/src/checks/manual/embed-text-alternative-quality-manual.js +18 -13
- package/src/checks/manual/empty-heading-manual.js +17 -17
- package/src/checks/manual/empty-table-header-manual.js +52 -25
- package/src/checks/manual/focus-order-semantics-manual.js +16 -4
- package/src/checks/manual/form-control-programmatic-label-quality-manual.js +2 -0
- package/src/checks/manual/heading-order-manual.js +28 -1
- package/src/checks/manual/identical-links-same-purpose-manual.js +2 -0
- package/src/checks/manual/image-redundant-alt-manual.js +21 -1
- package/src/checks/manual/img-alt-decorative-manual.js +2 -0
- package/src/checks/manual/img-alt-quality-manual.js +2 -0
- package/src/checks/manual/input-image-alt-decorative-manual.js +26 -0
- package/src/checks/manual/input-image-alt-quality-manual.js +2 -0
- package/src/checks/manual/label-title-only-manual.js +29 -22
- package/src/checks/manual/landmark-banner-is-top-level-manual.js +51 -55
- package/src/checks/manual/landmark-contentinfo-is-top-level-manual.js +44 -31
- package/src/checks/manual/landmark-main-is-top-level-manual.js +41 -24
- package/src/checks/manual/landmark-no-duplicate-banner-manual.js +16 -23
- package/src/checks/manual/landmark-no-duplicate-contentinfo-manual.js +14 -21
- package/src/checks/manual/landmark-no-duplicate-main-manual.js +10 -13
- package/src/checks/manual/landmark-one-main-manual.js +12 -23
- package/src/checks/manual/landmark-unique-manual.js +37 -52
- package/src/checks/manual/link-name-quality-manual.js +2 -0
- package/src/checks/manual/media-transcript-present-manual.js +2 -0
- package/src/checks/manual/meta-viewport-large-manual.js +3 -1
- package/src/checks/manual/mouse-only-event-handlers-manual.js +2 -0
- package/src/checks/manual/no-autoplay-audio-manual.js +2 -0
- package/src/checks/manual/object-text-alternative-quality-manual.js +2 -0
- package/src/checks/manual/p-as-heading-manual.js +2 -0
- package/src/checks/manual/page-has-heading-one-manual.js +12 -11
- package/src/checks/manual/page-title-patterns-manual.js +2 -0
- package/src/checks/manual/presentation-role-conflict-manual.js +51 -37
- package/src/checks/manual/region-manual.js +27 -36
- package/src/checks/manual/scope-attr-valid-manual.js +3 -1
- package/src/checks/manual/scrollable-region-focusable-manual.js +2 -0
- package/src/checks/manual/skip-link-manual.js +7 -6
- package/src/checks/manual/svg-text-alternative-quality-manual.js +2 -0
- package/src/checks/manual/tabindex-manual.js +3 -1
- package/src/checks/manual/table-duplicate-name-manual.js +5 -4
- package/src/checks/manual/table-fake-caption-manual.js +24 -3
- package/src/checks/manual/video-caption-manual.js +2 -0
- package/src/checks/manual-review.js +2 -0
- package/src/core.js +11820 -3317
- package/src/index.js +2 -0
- package/src/report.js +51 -9
- package/src/sarif.js +20 -5
- package/surea11y.browser.js +4943 -1388
- package/bin/core.js +0 -473
- package/docs/CLI.md +0 -128
- package/src/catalogs/composites.wcag.js +0 -454
- package/src/checks/automatic/bypass-blocks-present.js +0 -215
- package/src/checks/rules-and-tags.full.csv +0 -19
- package/src/checks/rules-and-tags.full.json +0 -259
- package/src/core/aria-helpers.js +0 -1211
- package/src/core/contrast-helpers.js +0 -1302
- package/src/core/dom-helpers.js +0 -4493
- package/src/core/dom-runner.js +0 -787
- package/src/core/frame-messaging.js +0 -261
- package/src/core/frame-scan.js +0 -190
- package/src/core/rollup-composites.js +0 -127
- package/src/core/rule-meta.js +0 -176
- package/src/coverage/wcag-facets.js +0 -1079
- package/src/coverage/wcag-version-map.js +0 -84
- package/src/i18n/en.js +0 -1228
- package/src/i18n/fr.js +0 -1185
- package/src/policy/contracts.js +0 -18
- package/src/policy/resolvePolicy.js +0 -59
- package/src/policy/schemas/engine-options.schema.json +0 -103
- package/src/policy/schemas/policy-contract.schema.json +0 -40
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Canonical WCAG-version-introduction map for Success Criteria.
|
|
5
|
-
*
|
|
6
|
-
* PURPOSE
|
|
7
|
-
* -------
|
|
8
|
-
* WCAG 2.1 and 2.2 are each a superset of the version before them -- they add new
|
|
9
|
-
* Success Criteria, never remove or renumber existing ones (with the sole exception
|
|
10
|
-
* of 4.1.1 Parsing, deprecated/removed in 2.2, which this engine does not implement
|
|
11
|
-
* as a rule either way). This module lists exactly which SCs were newly introduced in
|
|
12
|
-
* each version; every SC not listed here is WCAG 2.0 baseline.
|
|
13
|
-
*
|
|
14
|
-
* This is the single source of truth used by the rule-authoring consistency test
|
|
15
|
-
* (`tests/coverage/wcag-version-tags.test.js`) to verify every rule's `meta.tags`
|
|
16
|
-
* carries the version-correct `wcag2*`/`wcag21*`/`wcag22*` prefix for its `wcagSc`.
|
|
17
|
-
*
|
|
18
|
-
* `src/core/dom-runner.js`'s `buildCompositeDef` needs the identical list to compute
|
|
19
|
-
* composite tags, but has to keep its own literal copy rather than import this module --
|
|
20
|
-
* `runCore` is inlined into `core.js` via `Function.prototype.toString()`, so it cannot
|
|
21
|
-
* reference anything outside its own function body at runtime. If you change the lists
|
|
22
|
-
* below, update that literal too.
|
|
23
|
-
*
|
|
24
|
-
* SOURCE: W3C WCAG 2.1 and 2.2 "Success Criteria" tables (each SC's own "Introduced in
|
|
25
|
-
* version" note), cross-checked against a widely-used reference engine's own
|
|
26
|
-
* `wcag21a`/`wcag21aa`/`wcag22aa`-tagged rules (e.g. `autocomplete-valid` <-> that
|
|
27
|
-
* engine's SC-1.3.5 rule carries `wcag21aa` with no `wcag2aa`; `target-size-minimum`
|
|
28
|
-
* <-> its SC-2.5.8 rule carries `wcag22aa` alone) -- that engine never tags a rule
|
|
29
|
-
* with more than one version prefix, matching the
|
|
30
|
-
* "each SC belongs to exactly one origin version" model this file encodes.
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
// SCs newly introduced in WCAG 2.1 (not present in WCAG 2.0).
|
|
34
|
-
const WCAG21_NEW_SCS = [
|
|
35
|
-
'1.3.4', // Orientation (AA)
|
|
36
|
-
'1.3.5', // Identify Input Purpose (AA)
|
|
37
|
-
'1.3.6', // Identify Purpose (AAA)
|
|
38
|
-
'1.4.10', // Reflow (AA)
|
|
39
|
-
'1.4.11', // Non-text Contrast (AA)
|
|
40
|
-
'1.4.12', // Text Spacing (AA)
|
|
41
|
-
'1.4.13', // Content on Hover or Focus (AA)
|
|
42
|
-
'2.1.4', // Character Key Shortcuts (A)
|
|
43
|
-
'2.2.6', // Timeouts (AAA)
|
|
44
|
-
'2.3.3', // Animation from Interactions (AAA)
|
|
45
|
-
'2.5.1', // Pointer Gestures (A)
|
|
46
|
-
'2.5.2', // Pointer Cancellation (A)
|
|
47
|
-
'2.5.3', // Label in Name (A)
|
|
48
|
-
'2.5.4', // Motion Actuation (A)
|
|
49
|
-
'2.5.5', // Target Size -- Enhanced (AAA)
|
|
50
|
-
'2.5.6', // Concurrent Input Mechanisms (AAA)
|
|
51
|
-
'4.1.3' // Status Messages (AA)
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
// SCs newly introduced in WCAG 2.2 (not present in WCAG 2.0 or 2.1).
|
|
55
|
-
const WCAG22_NEW_SCS = [
|
|
56
|
-
'2.4.11', // Focus Not Obscured (Minimum) (AA)
|
|
57
|
-
'2.4.12', // Focus Not Obscured (Enhanced) (AAA)
|
|
58
|
-
'2.4.13', // Focus Appearance (AAA)
|
|
59
|
-
'2.5.7', // Dragging Movements (AA)
|
|
60
|
-
'2.5.8', // Target Size (Minimum) (AA)
|
|
61
|
-
'3.2.6', // Consistent Help (A)
|
|
62
|
-
'3.3.7', // Redundant Entry (A)
|
|
63
|
-
'3.3.8', // Accessible Authentication (Minimum) (AA)
|
|
64
|
-
'3.3.9' // Accessible Authentication (Enhanced) (AAA)
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
function introducedInVersion(sc) {
|
|
68
|
-
const s = String(sc || '').trim();
|
|
69
|
-
if (WCAG22_NEW_SCS.includes(s)) return '2.2';
|
|
70
|
-
if (WCAG21_NEW_SCS.includes(s)) return '2.1';
|
|
71
|
-
return '2.0';
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Given a rule/composite's wcagSc list, returns the runOnly.tags prefix
|
|
75
|
-
// ('wcag2' | 'wcag21' | 'wcag22') it should be tagged with -- a 2.2-origin SC wins
|
|
76
|
-
// over a 2.1-origin one if a rule/composite ever spans both (rare; none do today).
|
|
77
|
-
function versionTagPrefixForScs(wcagScList) {
|
|
78
|
-
const list = Array.isArray(wcagScList) ? wcagScList.map(String) : [];
|
|
79
|
-
if (list.some((sc) => WCAG22_NEW_SCS.includes(sc))) return 'wcag22';
|
|
80
|
-
if (list.some((sc) => WCAG21_NEW_SCS.includes(sc))) return 'wcag21';
|
|
81
|
-
return 'wcag2';
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
module.exports = { WCAG21_NEW_SCS, WCAG22_NEW_SCS, introducedInVersion, versionTagPrefixForScs };
|