@uuv/a11y
Version:
A javascript lib for running a11y validation based on multiple reference(RGAA, etc)
127 lines (126 loc) • 4.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const model_1 = require("../../../model");
const query_1 = require("../../../query");
exports.default = [
model_1.AutoCheckA11yRule.from({
criterion: "8.1",
wcag: "4.1.1 A",
id: "8.1.1",
elementType: "doctype",
query: new query_1.DoctypeQuery(),
description: "current page has no doctype or a doctype different to html",
help: "add <!DOCTYPE html> before html tag in the current page"
}),
model_1.AutoCheckA11yRule.from({
criterion: "8.1",
wcag: "4.1.1 A",
id: "8.1.2",
elementType: "doctype",
query: new query_1.DoctypeQuery(),
description: "current page has no doctype or a doctype different to html",
help: "add <!DOCTYPE html> before html tag in the current page"
}),
model_1.AutoCheckA11yRule.from({
criterion: "8.1",
wcag: "4.1.1 A",
id: "8.1.3",
elementType: "doctype",
query: new query_1.DoctypeQuery(),
description: "current page has no doctype or a doctype different to html",
help: "add <!DOCTYPE html> before html tag in the current page"
}),
model_1.AutoCheckA11yRule.from({
criterion: "8.3",
wcag: "3.1.1 A",
id: "8.3.1",
elementType: "lang",
query: new query_1.ByTagQuery([
"html:not([lang]):not([xml\\:lang])"
]),
description: "current page has no language specified",
help: "add lang attribute to html tag"
}),
model_1.ManualCheckA11yRule.from({
criterion: "8.4",
wcag: "3.1.1 A",
id: "8.4.1",
elementType: "lang",
query: new query_1.ByTagQuery([
"html[lang]",
"html[xml\\:lang]"
]),
description: "if present, attributes lang, xml:lang must be relevant",
help: "adapt these attributes to be relevant"
}),
model_1.AutoCheckA11yRule.from({
criterion: "8.5",
wcag: "2.4.2 A",
id: "8.5.1",
elementType: "title",
query: new query_1.ByTagQuery([
"html:not(:has(title))"
]),
description: "current page has no title tag",
help: "add a title tag to the current page"
}),
model_1.ManualCheckA11yRule.from({
criterion: "8.6",
wcag: "2.4.2 A",
id: "8.6.1",
elementType: "mandatory - title",
query: new query_1.ByTagQuery([
"title"
]),
attributes: [],
description: "if present, title tag must be relevant",
help: "adapt this tag content"
}),
model_1.ManualCheckA11yRule.from({
criterion: "8.7",
wcag: "3.1.2 AA",
id: "8.7.1",
elementType: "lang",
query: new query_1.ByTagQuery([
"html"
]),
attributes: [],
description: "if present, language switch must be specified",
help: "wrap concerned text with lang or xml:lang attribute"
}),
model_1.ManualCheckA11yRule.from({
criterion: "8.8",
wcag: "3.1.2 AA",
id: "8.8.1",
elementType: "lang",
query: new query_1.ByTagQuery([
":not(html)[lang]",
":not(html)[xml\\:lang]"
]),
attributes: [],
description: "if present, language switch must be revelant",
help: "check concerned lang or xml:lang attribute"
}),
model_1.AutoCheckA11yRule.from({
criterion: "8.10",
wcag: "1.3.2 A",
id: "8.10.1",
elementType: "mandatory - reading",
query: new query_1.ByTagQuery([
"[dir]:not([dir='rtl'], [dir='ltr'], [dir='auto'])"
]),
description: "if present, dir attribute must be compliant",
help: "adapt value of dir attribute"
}),
model_1.ManualCheckA11yRule.from({
criterion: "8.10",
wcag: "1.3.2 A",
id: "8.10.2",
elementType: "mandatory - reading",
query: new query_1.ByTagQuery([
"[dir='rtl'], [dir='ltr']"
]),
description: "if present, dir attribute must be compliant",
help: "adapt value of dir attribute"
})
];