@uuv/a11y 1.0.0-beta.2 → 1.0.0-beta.21

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +168 -0
  2. package/CONTRIBUTING.md +46 -0
  3. package/LICENSE +1 -1
  4. package/README.md +32 -249
  5. package/STRUCTURE.md +10 -0
  6. package/bundle/uuv-a11y.bundle.js +2 -2
  7. package/bundle/uuv-a11y.bundle.js.LICENSE.txt +1 -19
  8. package/dist/CHANGELOG.md +169 -0
  9. package/dist/CONTRIBUTING.md +46 -0
  10. package/dist/README.md +32 -249
  11. package/dist/STRUCTURE.md +10 -0
  12. package/dist/lib/engine/engine.js +28 -16
  13. package/dist/lib/model/index.d.ts +1 -1
  14. package/dist/lib/model/index.js +1 -1
  15. package/dist/lib/model/result.d.ts +2 -1
  16. package/dist/lib/model/rule.d.ts +0 -7
  17. package/dist/lib/model/rule.js +0 -2
  18. package/dist/lib/query/00-query.d.ts +6 -1
  19. package/dist/lib/query/00-query.js +10 -0
  20. package/dist/lib/query/accessible-name.query.d.ts +4 -2
  21. package/dist/lib/query/accessible-name.query.js +10 -7
  22. package/dist/lib/query/by-role.query.d.ts +4 -3
  23. package/dist/lib/query/by-role.query.js +22 -6
  24. package/dist/lib/query/by-sibling.query.d.ts +12 -0
  25. package/dist/lib/query/by-sibling.query.js +100 -0
  26. package/dist/lib/query/by-tag.query.d.ts +2 -2
  27. package/dist/lib/query/by-tag.query.js +4 -5
  28. package/dist/lib/query/compliant-attributes/attribut-specification.d.ts +34 -0
  29. package/dist/lib/query/compliant-attributes/attribut-specification.js +96 -0
  30. package/dist/lib/query/compliant-attributes/attribute-checker.d.ts +47 -0
  31. package/dist/lib/query/compliant-attributes/attribute-checker.js +73 -0
  32. package/dist/lib/query/compliant-attributes/compliant-attributes.query.d.ts +9 -0
  33. package/dist/lib/query/compliant-attributes/compliant-attributes.query.js +24 -0
  34. package/dist/lib/query/doctype.query.d.ts +2 -2
  35. package/dist/lib/query/doctype.query.js +2 -1
  36. package/dist/lib/query/form.query.d.ts +2 -2
  37. package/dist/lib/query/index.d.ts +7 -0
  38. package/dist/lib/query/index.js +7 -0
  39. package/dist/lib/query/operators/and-query.d.ts +8 -0
  40. package/dist/lib/query/operators/and-query.js +25 -0
  41. package/dist/lib/query/operators/operator-query.d.ts +8 -0
  42. package/dist/lib/query/operators/operator-query.js +14 -0
  43. package/dist/lib/query/operators/or-query.d.ts +8 -0
  44. package/dist/lib/query/operators/or-query.js +24 -0
  45. package/dist/lib/reference/rgaa/coverage/coverage-statement.json +56 -17
  46. package/dist/lib/reference/rgaa/rules/1-image.d.ts +0 -1
  47. package/dist/lib/reference/rgaa/rules/1-image.js +51 -77
  48. package/dist/lib/reference/rgaa/rules/11-form.d.ts +0 -1
  49. package/dist/lib/reference/rgaa/rules/11-form.js +0 -1
  50. package/dist/lib/reference/rgaa/rules/2-frame.d.ts +0 -1
  51. package/dist/lib/reference/rgaa/rules/2-frame.js +8 -7
  52. package/dist/lib/reference/rgaa/rules/3-color.d.ts +0 -1
  53. package/dist/lib/reference/rgaa/rules/3-color.js +0 -3
  54. package/dist/lib/reference/rgaa/rules/5-table.d.ts +12 -1
  55. package/dist/lib/reference/rgaa/rules/5-table.js +292 -1
  56. package/dist/lib/reference/rgaa/rules/6-link.d.ts +12 -1
  57. package/dist/lib/reference/rgaa/rules/6-link.js +147 -1
  58. package/dist/lib/reference/rgaa/rules/8-required-element.d.ts +0 -1
  59. package/dist/lib/reference/rgaa/rules/8-required-element.js +57 -9
  60. package/dist/lib/reference/rgaa/selector-helper.d.ts +40 -1
  61. package/dist/lib/reference/rgaa/selector-helper.js +82 -10
  62. package/dist/package.json +15 -4
  63. package/package.json +15 -4
@@ -1,3 +1,294 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = [];
3
+ const model_1 = require("../../../model");
4
+ const query_1 = require("../../../query");
5
+ const selector_helper_1 = require("../selector-helper");
6
+ exports.default = [
7
+ model_1.AutoCheckA11yRule.from({
8
+ criterion: "5.1",
9
+ wcag: "1.3.1 A",
10
+ id: "5.1.1",
11
+ elementType: "table",
12
+ query: new query_1.CompliantAttributesQuery(new query_1.ByTagQuery(selector_helper_1.table.noCaption.buildSelector(selector_helper_1.table.selector.complex, "")), [
13
+ query_1.AttributeChecker.emptyAttribute("summary"),
14
+ query_1.AttributeChecker.emptyHtmlNodeTargetedByTheAttribute("aria-describedby"),
15
+ ]),
16
+ description: "Table tag without summary",
17
+ help: "set a summary to table"
18
+ }),
19
+ model_1.AutoCheckA11yRule.from({
20
+ criterion: "5.1",
21
+ wcag: "1.3.1 A",
22
+ id: "5.1.1",
23
+ elementType: "table",
24
+ query: new query_1.CompliantAttributesQuery(new query_1.ByTagQuery(selector_helper_1.table.noCaption.buildSelector(selector_helper_1.table.hasComplexHeader.buildSelector([], "table"), "")), [
25
+ query_1.AttributeChecker.emptyHtmlNodeTargetedByTheAttribute("aria-describedby"),
26
+ ]),
27
+ description: "Element with role table without summary",
28
+ help: "set a summary to table"
29
+ }),
30
+ model_1.ManualCheckA11yRule.from({
31
+ criterion: "5.2",
32
+ wcag: "1.3.1 A",
33
+ id: "5.2.1",
34
+ elementType: "table",
35
+ query: new query_1.ByTagQuery([
36
+ ...selector_helper_1.table.caption.buildSelector(selector_helper_1.table.selector.complex, ""),
37
+ ...selector_helper_1.table.summary.buildSelector(selector_helper_1.table.selector.complex, ""),
38
+ ...selector_helper_1.table.ariaDescribedBy.buildSelector(selector_helper_1.table.selector.complex, ""),
39
+ ...selector_helper_1.table.caption.buildSelector(selector_helper_1.table.hasComplexHeader.buildSelector([], "table"), ""),
40
+ ...selector_helper_1.table.summary.buildSelector(selector_helper_1.table.hasComplexHeader.buildSelector([], "table"), ""),
41
+ ...selector_helper_1.table.ariaDescribedBy.buildSelector(selector_helper_1.table.hasComplexHeader.buildSelector([], "table"), "")
42
+ ]),
43
+ description: "if present, attributes summary(before html5), aria-describedby or child tag <caption> must be relevant",
44
+ attributes: [
45
+ "summary",
46
+ "aria-describedby",
47
+ "child:caption"
48
+ ],
49
+ help: "adapt these attributes to be relevant"
50
+ }),
51
+ model_1.ManualCheckA11yRule.from({
52
+ criterion: "5.3",
53
+ wcag: "1.3.2 A, 4.1.2 A",
54
+ id: "5.3.1",
55
+ elementType: "table",
56
+ query: new query_1.ByTagQuery([
57
+ selector_helper_1.table.selector.withFormatting,
58
+ ]),
59
+ description: "table with presentation role must have revelant content",
60
+ attributes: [
61
+ "child:td"
62
+ ],
63
+ help: "adapt these <td> children content to be relevant"
64
+ }),
65
+ model_1.AutoCheckA11yRule.from({
66
+ criterion: "5.4",
67
+ wcag: "1.3.1 A",
68
+ id: "5.4.1",
69
+ elementType: "table",
70
+ query: new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
71
+ ...selector_helper_1.table.noCaption.buildSelector([selector_helper_1.table.selector.withData], "table"),
72
+ ]), [
73
+ query_1.AttributeChecker.emptyAttribute("title"),
74
+ query_1.AttributeChecker.emptyAttribute("aria-label"),
75
+ query_1.AttributeChecker.emptyHtmlNodeTargetedByTheAttribute("aria-labelledby"),
76
+ ]),
77
+ description: "table must have title",
78
+ attributes: [
79
+ "child:caption",
80
+ "title",
81
+ "aria-label",
82
+ "aria-labelledby"
83
+ ],
84
+ help: "set one of these attributes"
85
+ }),
86
+ model_1.ManualCheckA11yRule.from({
87
+ criterion: "5.5",
88
+ wcag: "1.3.1 A",
89
+ id: "5.5.1",
90
+ elementType: "table",
91
+ query: new query_1.ByTagQuery([
92
+ ...selector_helper_1.table.caption.buildSelector([selector_helper_1.table.selector.withData], "table"),
93
+ ...selector_helper_1.table.title.buildSelector([selector_helper_1.table.selector.withData], "table"),
94
+ ...selector_helper_1.table.ariaLabel.buildSelector([selector_helper_1.table.selector.withData], "table"),
95
+ ...selector_helper_1.table.ariaLabelledBy.buildSelector([selector_helper_1.table.selector.withData], "table"),
96
+ ]),
97
+ description: "table must have a revelant title",
98
+ attributes: [
99
+ "child:caption",
100
+ "title",
101
+ "aria-label",
102
+ "aria-labelledby"
103
+ ],
104
+ help: "adapt one of these attributes to be revelant"
105
+ }),
106
+ model_1.ManualCheckA11yRule.from({
107
+ criterion: "5.6",
108
+ wcag: "1.3.1 A",
109
+ id: "5.6.1",
110
+ elementType: "table",
111
+ query: new query_1.ByTagQuery([
112
+ selector_helper_1.table.selector.withData, "[role=table]"
113
+ ]),
114
+ description: "table column header must be set properly",
115
+ help: "each table column header must be set with tag <th> or role=\"columnheader\""
116
+ }),
117
+ model_1.ManualCheckA11yRule.from({
118
+ criterion: "5.6",
119
+ wcag: "1.3.1 A",
120
+ id: "5.6.2",
121
+ elementType: "table",
122
+ query: new query_1.ByTagQuery([
123
+ selector_helper_1.table.selector.withData, "[role=table]"
124
+ ]),
125
+ description: "table line header must be set properly",
126
+ help: "each table line header must be set with tag <th> or role=\"rowheader\""
127
+ }),
128
+ model_1.ManualCheckA11yRule.from({
129
+ criterion: "5.6",
130
+ wcag: "1.3.1 A",
131
+ id: "5.6.3",
132
+ elementType: "table",
133
+ query: new query_1.ByTagQuery([
134
+ selector_helper_1.table.selector.withData, "[role=table]"
135
+ ]),
136
+ description: "each header does not apply to the entire row or column must be set properly"
137
+ }),
138
+ model_1.ManualCheckA11yRule.from({
139
+ criterion: "5.6",
140
+ wcag: "1.3.1 A",
141
+ id: "5.6.4",
142
+ elementType: "table",
143
+ query: new query_1.ByTagQuery([
144
+ selector_helper_1.table.selector.withData, "[role=table]"
145
+ ]),
146
+ description: "each cell associated with several headers structured using a <th> or <td> tag"
147
+ }),
148
+ model_1.AutoCheckA11yRule.from({
149
+ criterion: "5.7",
150
+ wcag: "1.3.1 A",
151
+ id: "5.7.1",
152
+ elementType: "table",
153
+ query: new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
154
+ ...selector_helper_1.table.thColumnHeader.buildSelector([selector_helper_1.table.selector.withData], "table"),
155
+ ]), [
156
+ query_1.AttributeChecker.notUniqueId(),
157
+ query_1.AttributeChecker.emptyAttribute("scope"),
158
+ query_1.AttributeChecker.notEquals("role", ["rowheader", "columnheader"])
159
+ ]),
160
+ description: "Table column header attributes",
161
+ help: "Correctly set table column header attributes"
162
+ }),
163
+ model_1.AutoCheckA11yRule.from({
164
+ criterion: "5.7",
165
+ wcag: "1.3.1 A",
166
+ id: "5.7.1",
167
+ elementType: "table",
168
+ query: new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
169
+ ...selector_helper_1.table.thRowHeader.buildSelector([selector_helper_1.table.selector.withData], "table"),
170
+ ]), [
171
+ query_1.AttributeChecker.notUniqueId(),
172
+ query_1.AttributeChecker.emptyAttribute("scope"),
173
+ query_1.AttributeChecker.notEquals("role", ["rowheader", "columnheader"])
174
+ ]),
175
+ description: "Table row header attributes",
176
+ help: "Correctly set table row header attributes"
177
+ }),
178
+ model_1.AutoCheckA11yRule.from({
179
+ criterion: "5.7",
180
+ wcag: "1.3.1 A",
181
+ id: "5.7.2",
182
+ elementType: "table",
183
+ query: new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
184
+ ...selector_helper_1.table.thColumnHeader.buildSelector([selector_helper_1.table.selector.withData], "table"),
185
+ ]), [
186
+ query_1.AttributeChecker.notEmptyAttribute("scope"),
187
+ query_1.AttributeChecker.notEquals("scope", ["col"])
188
+ ]),
189
+ description: "Table column header scope attribute",
190
+ help: "Set table column header scope attribute to col"
191
+ }),
192
+ model_1.AutoCheckA11yRule.from({
193
+ criterion: "5.7",
194
+ wcag: "1.3.1 A",
195
+ id: "5.7.2",
196
+ elementType: "table",
197
+ query: new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
198
+ ...selector_helper_1.table.thRowHeader.buildSelector([selector_helper_1.table.selector.withData], "table"),
199
+ ]), [
200
+ query_1.AttributeChecker.notEmptyAttribute("scope"),
201
+ query_1.AttributeChecker.notEquals("scope", ["row"])
202
+ ]),
203
+ description: "Table row header scope attribute",
204
+ help: "Set table column header scope attribute to row"
205
+ }),
206
+ model_1.AutoCheckA11yRule.from({
207
+ criterion: "5.7",
208
+ wcag: "1.3.1 A",
209
+ id: "5.7.3",
210
+ elementType: "table",
211
+ query: new query_1.OrQuery([
212
+ new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
213
+ "table:not([role=presentation]) tr:not(:first-child) th:not(:first-child)"
214
+ ]), [
215
+ query_1.AttributeChecker.notUniqueId()
216
+ ]),
217
+ new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
218
+ "table:not([role=presentation]) tr:not(:first-child) th:not(:first-child)"
219
+ ]), [
220
+ query_1.AttributeChecker.notEmptyAttribute("scope")
221
+ ]),
222
+ new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
223
+ "table:not([role=presentation]) tr:not(:first-child) th:not(:first-child)"
224
+ ]), [
225
+ query_1.AttributeChecker.equals("role", ["rowheader", "columnheader"])
226
+ ])
227
+ ]),
228
+ description: "each header does not apply to the entire row or column must be set properly"
229
+ }),
230
+ model_1.ManualCheckA11yRule.from({
231
+ criterion: "5.7",
232
+ wcag: "1.3.1 A",
233
+ id: "5.7.4",
234
+ elementType: "table",
235
+ query: new query_1.ByTagQuery([
236
+ selector_helper_1.table.selector.withData, "[role=table]"
237
+ ]),
238
+ description: "Each cell associated with several headers, the header attribute must be filled in correctly.",
239
+ help: "Each cell associated with several headers, the header attribute must contain the list of ids referring to the target headers."
240
+ }),
241
+ model_1.AutoCheckA11yRule.from({
242
+ criterion: "5.7",
243
+ wcag: "1.3.1 A",
244
+ id: "5.7.5",
245
+ elementType: "table",
246
+ query: new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
247
+ "table:not([role=presentation]) tr:first-child th",
248
+ "[role=table] tr:first-child th"
249
+ ]), [
250
+ query_1.AttributeChecker.notEmptyAttribute("role"),
251
+ query_1.AttributeChecker.notEquals("role", ["columnheader"])
252
+ ]),
253
+ description: "Table column header role attribute",
254
+ help: "Set table column header role attribute to 'columnheader'"
255
+ }),
256
+ model_1.AutoCheckA11yRule.from({
257
+ criterion: "5.7",
258
+ wcag: "1.3.1 A",
259
+ id: "5.7.5",
260
+ elementType: "table",
261
+ query: new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
262
+ "table:not([role=presentation]) tr:not(:first-child) th:first-child",
263
+ "[role=table] tr:not(:first-child) th:first-child"
264
+ ]), [
265
+ query_1.AttributeChecker.notEmptyAttribute("role"),
266
+ query_1.AttributeChecker.notEquals("role", ["rowheader"])
267
+ ]),
268
+ description: "Table row header role attribute",
269
+ help: "Set table row header role attribute to 'rowheader'"
270
+ }),
271
+ model_1.AutoCheckA11yRule.from({
272
+ criterion: "5.8",
273
+ wcag: "1.3.1 A",
274
+ id: "5.8.1",
275
+ elementType: "table",
276
+ query: new query_1.ByTagQuery([
277
+ selector_helper_1.table.selector.withFormatting + "[summary]",
278
+ selector_helper_1.table.selector.withFormatting + ":has(caption)",
279
+ selector_helper_1.table.selector.withFormatting + ":has(thead)",
280
+ selector_helper_1.table.selector.withFormatting + ":has(th)",
281
+ selector_helper_1.table.selector.withFormatting + ":has(tfoot)",
282
+ selector_helper_1.table.selector.withFormatting + " :has(> [role=rowheader])",
283
+ selector_helper_1.table.selector.withFormatting + " :has(> [role=columnheader])",
284
+ selector_helper_1.table.selector.withFormatting + " td[scope]",
285
+ selector_helper_1.table.selector.withFormatting + " td[headers]",
286
+ selector_helper_1.table.selector.withFormatting + " td[axis]",
287
+ ]),
288
+ description: "table with presentation role must have revelant content",
289
+ attributes: [
290
+ "child:td"
291
+ ],
292
+ help: "adapt these <td> children content to be relevant"
293
+ })
294
+ ];
@@ -1,2 +1,13 @@
1
- declare const _default: never[];
1
+ import { AutoCheckA11yRule } from "../../../model";
2
+ declare const _default: (AutoCheckA11yRule & {
3
+ attributes?: string[] | undefined;
4
+ criterion: string;
5
+ wcag: string;
6
+ id: string;
7
+ elementType: string;
8
+ query: import("../../../query").Query;
9
+ description?: string | undefined;
10
+ help?: string | string[] | undefined;
11
+ shouldNotExist?: boolean | undefined;
12
+ })[];
2
13
  export default _default;
@@ -1,3 +1,149 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = [];
3
+ const model_1 = require("../../../model");
4
+ const query_1 = require("../../../query");
5
+ const SELECTOR_ALL_LINK = [
6
+ "a",
7
+ "[role=link]"
8
+ ];
9
+ const SELECTOR_LINK_TEXT = [
10
+ ":not(svg) > a[href]:not(:has(img)):not(:has([role=img])):not(:has(object)):not(:has(canvas)):not(:has(svg))",
11
+ ":not(svg) > [role=link]:not(:has(img)):not(:has([role=img])):not(:has(object)):not(:has(canvas)):not(:has(svg))"
12
+ ];
13
+ const SELECTOR_LINK_CONTAINING_IMAGE = [
14
+ ":not(svg) > a[href]:has(img)",
15
+ ":not(svg) > a[href]:has([role=img])",
16
+ ":not(svg) > a[href]:has(area[href])",
17
+ ":not(svg) > a[href]:has(object)",
18
+ ":not(svg) > a[href]:has(canvas)",
19
+ ":not(svg) > a[href]:has(svg)",
20
+ ":not(svg) > [role=link]:has(img)",
21
+ ":not(svg) > [role=link]:has([role=img])",
22
+ ":not(svg) > [role=link]:has(area[href])",
23
+ ":not(svg) > [role=link]:has(object)",
24
+ ":not(svg) > [role=link]:has(canvas)",
25
+ ":not(svg) > [role=link]:has(svg)"
26
+ ];
27
+ const SELECTOR_LINK_SVG = [
28
+ "svg:has(a[href])",
29
+ "svg:has(a[xlink-href])"
30
+ ];
31
+ const IMAGE_LINK_QUERY = new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
32
+ ...SELECTOR_LINK_CONTAINING_IMAGE
33
+ ]), [
34
+ query_1.AttributeChecker.emptyText()
35
+ ]);
36
+ const COMPOSITE_LINK_QUERY = new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
37
+ ...SELECTOR_LINK_CONTAINING_IMAGE
38
+ ]), [
39
+ query_1.AttributeChecker.notEmptyText()
40
+ ]);
41
+ exports.default = [
42
+ model_1.AutoCheckA11yRule.from({
43
+ criterion: "6.1",
44
+ wcag: "1.1.1 A, 2.4.4 A, 2.5.3 A",
45
+ id: "6.1.1",
46
+ elementType: "link",
47
+ query: new query_1.AccessibleNameQuery(new query_1.ByTagQuery([
48
+ ...SELECTOR_LINK_TEXT
49
+ ]), true),
50
+ description: "text link must be explicit",
51
+ help: "Check link accessible name or link context"
52
+ }),
53
+ model_1.ManualCheckA11yRule.from({
54
+ criterion: "6.1",
55
+ wcag: "1.1.1 A, 2.4.4 A, 2.5.3 A",
56
+ id: "6.1.1",
57
+ elementType: "link",
58
+ query: new query_1.AccessibleNameQuery(new query_1.ByTagQuery([
59
+ ...SELECTOR_LINK_TEXT
60
+ ]), false),
61
+ description: "text link must be explicit",
62
+ help: "Check link accessible name or link context"
63
+ }),
64
+ model_1.AutoCheckA11yRule.from({
65
+ criterion: "6.1",
66
+ wcag: "1.1.1 A, 2.4.4 A, 2.5.3 A",
67
+ id: "6.1.2",
68
+ elementType: "link",
69
+ query: new query_1.AccessibleNameQuery(IMAGE_LINK_QUERY, true),
70
+ description: "image link must be explicit",
71
+ help: "Check link accessible name or link context"
72
+ }),
73
+ model_1.ManualCheckA11yRule.from({
74
+ criterion: "6.1",
75
+ wcag: "1.1.1 A, 2.4.4 A, 2.5.3 A",
76
+ id: "6.1.2",
77
+ elementType: "link",
78
+ query: new query_1.AccessibleNameQuery(IMAGE_LINK_QUERY, false),
79
+ description: "image link must be explicit",
80
+ help: "Check link accessible name or link context"
81
+ }),
82
+ model_1.ManualCheckA11yRule.from({
83
+ criterion: "6.1",
84
+ wcag: "1.1.1 A, 2.4.4 A, 2.5.3 A",
85
+ id: "6.1.3",
86
+ elementType: "link",
87
+ query: new query_1.AccessibleNameQuery(COMPOSITE_LINK_QUERY, false),
88
+ description: "image link must be explicit",
89
+ help: "Check link accessible name or link context"
90
+ }),
91
+ model_1.AutoCheckA11yRule.from({
92
+ criterion: "6.1",
93
+ wcag: "1.1.1 A, 2.4.4 A, 2.5.3 A",
94
+ id: "6.1.4",
95
+ elementType: "link",
96
+ query: new query_1.AccessibleNameQuery(new query_1.ByTagQuery([
97
+ ...SELECTOR_LINK_SVG
98
+ ]), true),
99
+ description: "svg link must be explicit",
100
+ help: "Check link accessible name or link context"
101
+ }),
102
+ model_1.ManualCheckA11yRule.from({
103
+ criterion: "6.1",
104
+ wcag: "1.1.1 A, 2.4.4 A, 2.5.3 A",
105
+ id: "6.1.4",
106
+ elementType: "link",
107
+ query: new query_1.AccessibleNameQuery(new query_1.ByTagQuery([
108
+ ...SELECTOR_LINK_SVG
109
+ ]), false),
110
+ description: "svg link must be explicit",
111
+ help: "Check link accessible name or link context"
112
+ }),
113
+ model_1.AutoCheckA11yRule.from({
114
+ criterion: "6.1",
115
+ wcag: "1.1.1 A, 2.4.4 A, 2.5.3 A",
116
+ id: "6.1.5",
117
+ elementType: "link",
118
+ query: new query_1.CompliantAttributesQuery(new query_1.ByTagQuery([
119
+ ...SELECTOR_LINK_TEXT,
120
+ ...SELECTOR_LINK_CONTAINING_IMAGE
121
+ ]), [
122
+ query_1.AttributeChecker.accessibleNameNotContainsVisibleText()
123
+ ]),
124
+ description: "Accessible name must contains visible text for text link and image link",
125
+ help: "Accessible name must contains visible text for text link and image link"
126
+ }),
127
+ model_1.ManualCheckA11yRule.from({
128
+ criterion: "6.1",
129
+ wcag: "1.1.1 A, 2.4.4 A, 2.5.3 A",
130
+ id: "6.1.5",
131
+ elementType: "link",
132
+ query: new query_1.ByTagQuery([
133
+ ...SELECTOR_LINK_SVG
134
+ ]),
135
+ description: "Accessible name must contains visible text for svg link",
136
+ help: "Accessible name must contains visible text for svg link"
137
+ }),
138
+ model_1.AutoCheckA11yRule.from({
139
+ criterion: "6.2",
140
+ wcag: "1.1.1 A, 2.4.4 A",
141
+ id: "6.2.1",
142
+ elementType: "link",
143
+ query: new query_1.AccessibleNameQuery(new query_1.ByTagQuery([
144
+ ...SELECTOR_ALL_LINK
145
+ ]), true),
146
+ description: "Every link must have an accessible name",
147
+ help: "Every link must have an accessible name"
148
+ })
149
+ ];
@@ -1,7 +1,6 @@
1
1
  import { AutoCheckA11yRule } from "../../../model";
2
2
  declare const _default: (AutoCheckA11yRule & {
3
3
  attributes?: string[] | undefined;
4
- reference: string;
5
4
  criterion: string;
6
5
  wcag: string;
7
6
  id: string;
@@ -4,17 +4,33 @@ const model_1 = require("../../../model");
4
4
  const query_1 = require("../../../query");
5
5
  exports.default = [
6
6
  model_1.AutoCheckA11yRule.from({
7
- reference: "RGAA",
8
7
  criterion: "8.1",
9
8
  wcag: "4.1.1 A",
10
9
  id: "8.1.1",
11
10
  elementType: "doctype",
12
11
  query: new query_1.DoctypeQuery(),
13
12
  description: "current page has no doctype or a doctype different to html",
14
- help: "add <!DOCTYPE html> in the current page"
13
+ help: "add <!DOCTYPE html> before html tag in the current page"
14
+ }),
15
+ model_1.AutoCheckA11yRule.from({
16
+ criterion: "8.1",
17
+ wcag: "4.1.1 A",
18
+ id: "8.1.2",
19
+ elementType: "doctype",
20
+ query: new query_1.DoctypeQuery(),
21
+ description: "current page has no doctype or a doctype different to html",
22
+ help: "add <!DOCTYPE html> before html tag in the current page"
23
+ }),
24
+ model_1.AutoCheckA11yRule.from({
25
+ criterion: "8.1",
26
+ wcag: "4.1.1 A",
27
+ id: "8.1.3",
28
+ elementType: "doctype",
29
+ query: new query_1.DoctypeQuery(),
30
+ description: "current page has no doctype or a doctype different to html",
31
+ help: "add <!DOCTYPE html> before html tag in the current page"
15
32
  }),
16
33
  model_1.AutoCheckA11yRule.from({
17
- reference: "RGAA",
18
34
  criterion: "8.3",
19
35
  wcag: "3.1.1 A",
20
36
  id: "8.3.1",
@@ -26,7 +42,6 @@ exports.default = [
26
42
  help: "add lang attribute to html tag"
27
43
  }),
28
44
  model_1.ManualCheckA11yRule.from({
29
- reference: "RGAA",
30
45
  criterion: "8.4",
31
46
  wcag: "3.1.1 A",
32
47
  id: "8.4.1",
@@ -39,19 +54,17 @@ exports.default = [
39
54
  help: "adapt these attributes to be relevant"
40
55
  }),
41
56
  model_1.AutoCheckA11yRule.from({
42
- reference: "RGAA",
43
57
  criterion: "8.5",
44
58
  wcag: "2.4.2 A",
45
59
  id: "8.5.1",
46
60
  elementType: "title",
47
61
  query: new query_1.ByTagQuery([
48
- "title"
62
+ "html:not(:has(title))"
49
63
  ]),
50
64
  description: "current page has no title tag",
51
65
  help: "add a title tag to the current page"
52
66
  }),
53
67
  model_1.ManualCheckA11yRule.from({
54
- reference: "RGAA",
55
68
  criterion: "8.6",
56
69
  wcag: "2.4.2 A",
57
70
  id: "8.6.1",
@@ -63,8 +76,32 @@ exports.default = [
63
76
  description: "if present, title tag must be relevant",
64
77
  help: "adapt this tag content"
65
78
  }),
79
+ model_1.ManualCheckA11yRule.from({
80
+ criterion: "8.7",
81
+ wcag: "3.1.2 AA",
82
+ id: "8.7.1",
83
+ elementType: "lang",
84
+ query: new query_1.ByTagQuery([
85
+ "html"
86
+ ]),
87
+ attributes: [],
88
+ description: "if present, language switch must be specified",
89
+ help: "wrap concerned text with lang or xml:lang attribute"
90
+ }),
91
+ model_1.ManualCheckA11yRule.from({
92
+ criterion: "8.8",
93
+ wcag: "3.1.2 AA",
94
+ id: "8.8.1",
95
+ elementType: "lang",
96
+ query: new query_1.ByTagQuery([
97
+ ":not(html)[lang]",
98
+ ":not(html)[xml\\:lang]"
99
+ ]),
100
+ attributes: [],
101
+ description: "if present, language switch must be revelant",
102
+ help: "check concerned lang or xml:lang attribute"
103
+ }),
66
104
  model_1.AutoCheckA11yRule.from({
67
- reference: "RGAA",
68
105
  criterion: "8.10",
69
106
  wcag: "1.3.2 A",
70
107
  id: "8.10.1",
@@ -72,7 +109,18 @@ exports.default = [
72
109
  query: new query_1.ByTagQuery([
73
110
  "[dir]:not([dir='rtl'], [dir='ltr'], [dir='auto'])"
74
111
  ]),
75
- description: "if present, dir attribute must be relevant",
112
+ description: "if present, dir attribute must be compliant",
113
+ help: "adapt value of dir attribute"
114
+ }),
115
+ model_1.ManualCheckA11yRule.from({
116
+ criterion: "8.10",
117
+ wcag: "1.3.2 A",
118
+ id: "8.10.2",
119
+ elementType: "mandatory - reading",
120
+ query: new query_1.ByTagQuery([
121
+ "[dir='rtl'], [dir='ltr']"
122
+ ]),
123
+ description: "if present, dir attribute must be compliant",
76
124
  help: "adapt value of dir attribute"
77
125
  })
78
126
  ];
@@ -3,7 +3,6 @@ declare class SelectorRule {
3
3
  readonly ATTRIBUTES: string[];
4
4
  constructor(SELECTOR: string, ATTRIBUTES: string[]);
5
5
  buildSelectorWithAttributes(): string[];
6
- buildSelectorWithoutAttributes(): string;
7
6
  }
8
7
  export declare const informativeContent: {
9
8
  image: SelectorRule;
@@ -14,4 +13,44 @@ export declare const informativeContent: {
14
13
  svg: SelectorRule;
15
14
  canvas: SelectorRule;
16
15
  };
16
+ export declare const siblingElement: {
17
+ button: SelectorRule;
18
+ a: SelectorRule;
19
+ };
20
+ /** CSS SELECTOR HELPER *******/
21
+ declare class CssSelectorRule {
22
+ readonly attributes: string[];
23
+ readonly selector: string;
24
+ readonly role: string;
25
+ constructor(attributes: string[], selector?: string, role?: string);
26
+ buildSelector(overrideSelector?: string[], overrideRole?: string | undefined): string[];
27
+ }
28
+ export declare const commonCssSelector: {
29
+ ariaDescribedBy: string[];
30
+ title: string[];
31
+ ariaLabelledBy: string[];
32
+ ariaLabel: string[];
33
+ };
34
+ export declare const tableCssSelector: {
35
+ complexTh: string[];
36
+ complexRowHeader: string[];
37
+ complexColumnHeader: string[];
38
+ };
39
+ export declare const table: {
40
+ selector: {
41
+ withFormatting: string;
42
+ complex: string[];
43
+ withData: string;
44
+ };
45
+ noCaption: CssSelectorRule;
46
+ caption: CssSelectorRule;
47
+ summary: CssSelectorRule;
48
+ ariaDescribedBy: CssSelectorRule;
49
+ title: CssSelectorRule;
50
+ ariaLabel: CssSelectorRule;
51
+ ariaLabelledBy: CssSelectorRule;
52
+ thColumnHeader: CssSelectorRule;
53
+ thRowHeader: CssSelectorRule;
54
+ hasComplexHeader: CssSelectorRule;
55
+ };
17
56
  export {};