@surea11y/core 1.4.0 → 1.5.0
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 +88 -7
- package/README.md +19 -3
- package/bin/surea11y-core.js +0 -0
- package/docs/API_STABILITY.md +2 -2
- package/docs/ARIA_DEPRECATION.md +95 -0
- package/docs/ENGINE_OPTIONS.md +14 -10
- package/docs/I18N.md +176 -20
- package/docs/INTEGRATION.md +28 -6
- package/docs/LIMITATIONS.md +1 -1
- package/docs/OUTPUT_SCHEMA.md +13 -3
- package/docs/REPORT.md +2 -0
- package/docs/RULE_AUTHORING.md +53 -0
- package/docs/RULE_CATALOG.md +6 -6
- package/docs/TROUBLESHOOTING.md +2 -2
- package/package.json +8 -1
- package/src/checks/automatic/aria-allowed-attr.js +661 -99
- package/src/checks/automatic/aria-allowed-role.js +14 -16
- package/src/checks/automatic/aria-braille-equivalent.js +17 -19
- package/src/checks/automatic/aria-conditional-attr.js +17 -19
- package/src/checks/automatic/aria-deprecated-role.js +122 -41
- package/src/checks/automatic/aria-hidden-body.js +2 -9
- package/src/checks/automatic/aria-hidden-focus.js +99 -18
- package/src/checks/automatic/aria-prohibited-attr.js +54 -55
- package/src/checks/automatic/aria-prohibited-children.js +26 -26
- package/src/checks/automatic/aria-required-attr.js +14 -17
- package/src/checks/automatic/aria-required-children.js +17 -20
- package/src/checks/automatic/aria-required-parent.js +17 -20
- package/src/checks/automatic/aria-roles-valid.js +66 -27
- package/src/checks/automatic/aria-valid-attr-value.js +18 -21
- package/src/checks/automatic/aria-valid-attr.js +14 -17
- package/src/checks/automatic/autocomplete-valid.js +52 -18
- package/src/checks/automatic/avoid-inline-spacing.js +192 -34
- package/src/checks/automatic/binary-control-name-present.js +30 -24
- package/src/checks/automatic/button-name-present.js +73 -45
- package/src/checks/automatic/canvas-text-alternative-present.js +15 -8
- package/src/checks/automatic/combobox-name-present.js +23 -18
- package/src/checks/automatic/css-orientation-lock.js +22 -22
- package/src/checks/automatic/definition-list-children-valid.js +18 -21
- package/src/checks/automatic/deprecated-elements-not-used.js +14 -16
- package/src/checks/automatic/dialog-name-present.js +24 -19
- package/src/checks/automatic/dlitem-parent-valid.js +15 -17
- package/src/checks/automatic/duplicate-id-aria.js +45 -37
- package/src/checks/automatic/form-control-programmatic-label-present.js +48 -4
- package/src/checks/automatic/form-control-single-label.js +109 -43
- package/src/checks/automatic/html-xml-lang-mismatch.js +2 -9
- package/src/checks/automatic/iframe-focusable-content.js +29 -31
- package/src/checks/automatic/iframe-name-present.js +15 -17
- package/src/checks/automatic/iframe-title-unique.js +18 -23
- package/src/checks/automatic/img-alt-present.js +16 -9
- package/src/checks/automatic/input-image-alt-present.js +99 -48
- package/src/checks/automatic/label-in-name.js +102 -33
- package/src/checks/automatic/language-page-present.js +5 -1
- package/src/checks/automatic/link-in-text-block.js +19 -21
- package/src/checks/automatic/link-name-present.js +75 -47
- package/src/checks/automatic/list-children-valid.js +15 -17
- package/src/checks/automatic/listbox-name-present.js +23 -18
- package/src/checks/automatic/listitem-parent-valid.js +14 -17
- package/src/checks/automatic/menuitem-name-present.js +24 -19
- package/src/checks/automatic/meta-refresh-no-exceptions.js +44 -18
- package/src/checks/automatic/meta-refresh-timing-absent.js +44 -21
- package/src/checks/automatic/meta-viewport-zoom-enabled.js +51 -32
- package/src/checks/automatic/meter-name-present.js +24 -19
- package/src/checks/automatic/nested-interactive-controls-absent.js +179 -51
- package/src/checks/automatic/object-text-alternative-present.js +14 -7
- package/src/checks/automatic/option-name-present.js +24 -19
- package/src/checks/automatic/progressbar-name-present.js +27 -22
- package/src/checks/automatic/searchbox-name-present.js +27 -18
- package/src/checks/automatic/server-side-image-map-absent.js +15 -18
- package/src/checks/automatic/slider-name-present.js +26 -19
- package/src/checks/automatic/spinbutton-name-present.js +27 -18
- package/src/checks/automatic/summary-name-present.js +24 -19
- package/src/checks/automatic/tab-name-present.js +24 -19
- package/src/checks/automatic/table-headers-attr-valid.js +15 -17
- package/src/checks/automatic/table-th-has-data-cells.js +82 -25
- package/src/checks/automatic/target-size-minimum.js +104 -81
- package/src/checks/automatic/td-has-header.js +15 -20
- package/src/checks/automatic/textbox-name-present.js +23 -18
- package/src/checks/automatic/tooltip-name-present.js +24 -19
- package/src/checks/automatic/treeitem-name-present.js +24 -19
- package/src/checks/automatic/valid-lang.js +31 -20
- package/src/checks/manual/accesskeys-manual.js +18 -19
- package/src/checks/manual/aria-checked-state-mismatch-manual.js +19 -22
- package/src/checks/{automatic/bypass-blocks-present.js → manual/bypass-blocks-present-manual.js} +98 -44
- package/src/checks/manual/empty-heading-manual.js +15 -17
- package/src/checks/manual/empty-table-header-manual.js +27 -30
- package/src/checks/manual/form-control-programmatic-label-quality-manual.js +2 -9
- package/src/checks/manual/heading-order-manual.js +17 -22
- package/src/checks/manual/image-redundant-alt-manual.js +14 -17
- package/src/checks/manual/input-image-alt-decorative-manual.js +24 -0
- package/src/checks/manual/label-title-only-manual.js +15 -17
- package/src/checks/manual/landmark-banner-is-top-level-manual.js +25 -39
- package/src/checks/manual/landmark-contentinfo-is-top-level-manual.js +21 -27
- package/src/checks/manual/landmark-main-is-top-level-manual.js +14 -17
- package/src/checks/manual/landmark-no-duplicate-banner-manual.js +2 -7
- package/src/checks/manual/landmark-no-duplicate-contentinfo-manual.js +2 -7
- package/src/checks/manual/landmark-no-duplicate-main-manual.js +2 -7
- package/src/checks/manual/landmark-one-main-manual.js +2 -9
- package/src/checks/manual/landmark-unique-manual.js +22 -27
- package/src/checks/manual/link-name-quality-manual.js +15 -17
- package/src/checks/manual/meta-viewport-large-manual.js +14 -17
- package/src/checks/manual/mouse-only-event-handlers-manual.js +17 -19
- package/src/checks/manual/page-has-heading-one-manual.js +2 -9
- package/src/checks/manual/presentation-role-conflict-manual.js +19 -21
- package/src/checks/manual/region-manual.js +13 -6
- package/src/checks/manual/scope-attr-valid-manual.js +14 -17
- package/src/checks/manual/skip-link-manual.js +39 -47
- package/src/checks/manual/tabindex-manual.js +14 -17
- package/src/checks/manual/table-duplicate-name-manual.js +14 -17
- package/src/core.js +8818 -4330
- package/src/report.js +14 -0
- package/src/sarif.js +2 -2
- package/surea11y.browser.js +4023 -3911
- package/surea11y.i18n.de.js +22 -0
- package/surea11y.i18n.es.js +22 -0
- package/surea11y.i18n.fr.js +22 -0
|
@@ -184,59 +184,51 @@ function runInPage(ctx) {
|
|
|
184
184
|
const unusableByGeometry = !!geometryReasonCode;
|
|
185
185
|
if (!unusableByAcc && !unusableByGeometry) continue;
|
|
186
186
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
occurrences.push(
|
|
188
|
+
helpers.reportOccurrence(el, {
|
|
189
|
+
summary: 'This skip link points to a target that exists but is not currently usable.',
|
|
190
|
+
hint: 'Point this skip link to a target that is exposed and usable as a navigation destination.',
|
|
191
|
+
i18n: {
|
|
192
|
+
summaryKey: 'skipLink_summary_unusableTarget_cantTell',
|
|
193
|
+
hintKey: 'skipLink_hint_unusableTarget_cantTell',
|
|
194
|
+
params: { href }
|
|
195
|
+
},
|
|
196
|
+
data: {
|
|
197
|
+
details: {
|
|
198
|
+
reasonCode: 'SKIP_LINK_TARGET_UNUSABLE',
|
|
199
|
+
href,
|
|
200
|
+
unusableReasonCode: unusableByAcc ? 'ACC_TREE_INELIGIBLE' : geometryReasonCode,
|
|
201
|
+
targetSelector: helpers.buildSelector ? helpers.buildSelector(target) : null,
|
|
202
|
+
geometryCheckEnabled: geometrySupported
|
|
203
|
+
},
|
|
204
|
+
visibilityFilter: {
|
|
205
|
+
targetSet: 'acc',
|
|
206
|
+
accEligible: accEligibility.eligible,
|
|
207
|
+
reasons: accEligibility.reasons
|
|
208
|
+
},
|
|
209
|
+
targetGeometry: geometryEligibility
|
|
210
|
+
? { eligible: geometryEligibility.eligible, reasons: geometryEligibility.reasons }
|
|
211
|
+
: { eligible: null, reasons: [] }
|
|
212
|
+
}
|
|
213
|
+
})
|
|
214
|
+
);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
191
217
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
hint: 'Point this skip link to a target that is exposed and usable as a navigation destination.',
|
|
218
|
+
occurrences.push(
|
|
219
|
+
helpers.reportOccurrence(el, {
|
|
220
|
+
summary: "This skip link's target does not exist.",
|
|
221
|
+
hint: "Point the skip link's href at an id that exists in the document, or add the missing target element.",
|
|
197
222
|
i18n: {
|
|
198
|
-
summaryKey: '
|
|
199
|
-
hintKey: '
|
|
223
|
+
summaryKey: 'skipLink_summary_cantTell',
|
|
224
|
+
hintKey: 'skipLink_hint_cantTell',
|
|
200
225
|
params: { href }
|
|
201
226
|
},
|
|
202
227
|
data: {
|
|
203
|
-
details: {
|
|
204
|
-
reasonCode: 'SKIP_LINK_TARGET_UNUSABLE',
|
|
205
|
-
href,
|
|
206
|
-
unusableReasonCode: unusableByAcc ? 'ACC_TREE_INELIGIBLE' : geometryReasonCode,
|
|
207
|
-
targetSelector: helpers.buildSelector ? helpers.buildSelector(target) : null,
|
|
208
|
-
geometryCheckEnabled: geometrySupported
|
|
209
|
-
},
|
|
210
|
-
visibilityFilter: {
|
|
211
|
-
targetSet: 'acc',
|
|
212
|
-
accEligible: accEligibility.eligible,
|
|
213
|
-
reasons: accEligibility.reasons
|
|
214
|
-
},
|
|
215
|
-
targetGeometry: geometryEligibility
|
|
216
|
-
? { eligible: geometryEligibility.eligible, reasons: geometryEligibility.reasons }
|
|
217
|
-
: { eligible: null, reasons: [] }
|
|
228
|
+
details: { reasonCode: 'SKIP_LINK_TARGET_MISSING', href }
|
|
218
229
|
}
|
|
219
|
-
})
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
const stableSelector = helpers.buildSelector ? helpers.buildSelector(el) : 'html';
|
|
224
|
-
const html = helpers.getOuterHtmlSnippet ? helpers.getOuterHtmlSnippet(el) : el.outerHTML || '';
|
|
225
|
-
|
|
226
|
-
occurrences.push({
|
|
227
|
-
selector: stableSelector,
|
|
228
|
-
html,
|
|
229
|
-
summary: "This skip link's target does not exist.",
|
|
230
|
-
hint: "Point the skip link's href at an id that exists in the document, or add the missing target element.",
|
|
231
|
-
i18n: {
|
|
232
|
-
summaryKey: 'skipLink_summary_cantTell',
|
|
233
|
-
hintKey: 'skipLink_hint_cantTell',
|
|
234
|
-
params: { href }
|
|
235
|
-
},
|
|
236
|
-
data: {
|
|
237
|
-
details: { reasonCode: 'SKIP_LINK_TARGET_MISSING', href }
|
|
238
|
-
}
|
|
239
|
-
});
|
|
230
|
+
})
|
|
231
|
+
);
|
|
240
232
|
}
|
|
241
233
|
|
|
242
234
|
if (applicableCount === 0) {
|
|
@@ -62,23 +62,20 @@ function runInPage(ctx) {
|
|
|
62
62
|
|
|
63
63
|
if (n <= 0) continue;
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
details: { reasonCode: 'TABINDEX_POSITIVE', value: n }
|
|
80
|
-
}
|
|
81
|
-
});
|
|
65
|
+
occurrences.push(
|
|
66
|
+
helpers.reportOccurrence(el, {
|
|
67
|
+
summary: 'This element has a positive tabindex, overriding the natural tab order.',
|
|
68
|
+
hint: 'Use tabindex="0" (or a negative value to remove from tab order) instead of a positive number; fix the DOM order if a different tab order is needed.',
|
|
69
|
+
i18n: {
|
|
70
|
+
summaryKey: 'tabindex_summary_cantTell',
|
|
71
|
+
hintKey: 'tabindex_hint_cantTell',
|
|
72
|
+
params: { value: String(n) }
|
|
73
|
+
},
|
|
74
|
+
data: {
|
|
75
|
+
details: { reasonCode: 'TABINDEX_POSITIVE', value: n }
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
);
|
|
82
79
|
}
|
|
83
80
|
|
|
84
81
|
if (applicableCount === 0) {
|
|
@@ -73,23 +73,20 @@ function runInPage(ctx) {
|
|
|
73
73
|
|
|
74
74
|
if (captionText.toLowerCase() !== summary.toLowerCase()) continue;
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
details: { reasonCode: 'TABLE_CAPTION_SUMMARY_DUPLICATE' }
|
|
91
|
-
}
|
|
92
|
-
});
|
|
76
|
+
occurrences.push(
|
|
77
|
+
helpers.reportOccurrence(el, {
|
|
78
|
+
summary: "This table's caption duplicates its summary attribute.",
|
|
79
|
+
hint: 'Remove the redundant summary attribute, or make it provide different information than the caption.',
|
|
80
|
+
i18n: {
|
|
81
|
+
summaryKey: 'tableDuplicateName_summary_cantTell',
|
|
82
|
+
hintKey: 'tableDuplicateName_hint_cantTell',
|
|
83
|
+
params: {}
|
|
84
|
+
},
|
|
85
|
+
data: {
|
|
86
|
+
details: { reasonCode: 'TABLE_CAPTION_SUMMARY_DUPLICATE' }
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
);
|
|
93
90
|
}
|
|
94
91
|
|
|
95
92
|
if (applicableCount === 0) {
|