Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [DO NOT MERGE] v4.4.0 diff #8

Closed
wants to merge 56 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
da2deae
changed package name to denote DAISY fork
danielweck Jan 19, 2021
bdcf58d
initial patching (scripts/axe-patch-is-aria-role-allowed.js scripts/a…
danielweck Jan 19, 2021
5830ea9
Mocha fast bail
danielweck Jan 19, 2021
8b3740d
semver is same as Axe Core but with DAISY addon suffix. Also added NP…
danielweck Jan 19, 2021
723b98a
semver is reflected in auto-generated doc
danielweck Jan 19, 2021
2e70235
added unit tests for implicit/explicit and DPUB role parsing
danielweck Jan 19, 2021
4ce706d
Scoped NPM package name, and files selection for NPM publish
danielweck Jan 19, 2021
1c9a0b2
NPM public publish
danielweck Jan 19, 2021
6590f7f
Merge branch 'v4.1.1_DAISY' into v4.1.2_DAISY
danielweck Feb 16, 2021
ea67596
rules MD
danielweck Feb 16, 2021
e04a57a
ignore epub:type
danielweck Feb 18, 2021
af3e209
Merge branch 'v4.1.2_DAISY' into v4.1.3_DAISY
danielweck Mar 10, 2021
161d97e
Unit tests require package.json version without canary or arbitrary e…
danielweck Mar 10, 2021
2a6ab7e
landmark-one-main now with page-no-duplicate-main in addition to page…
danielweck Mar 10, 2021
dae726f
doc: landmark-one-main now with page-no-duplicate-main in addition to…
danielweck Mar 10, 2021
2b5bb2d
intermediary commit (Axe hook seems to stash things in the working co…
danielweck Mar 10, 2021
6121f22
main element and div with role
danielweck Mar 10, 2021
10be613
added unit test for landmark-no-duplicate-main to pass content with n…
danielweck Mar 10, 2021
72707cf
matching-aria-role check port (untranslated)
danielweck Mar 10, 2021
45529c1
epub-type-has-matching-role pagebreak-label ported from Ace (translat…
danielweck Mar 10, 2021
5e5e6a7
working XHTML unit tests for EPUB in Axe! (port from Ace)
danielweck Mar 11, 2021
e460f1d
page-break label test (check)
danielweck Mar 11, 2021
da8e26c
Merge branch 'v4.1.3_DAISY' into v4.1.4_DAISY
danielweck Apr 6, 2021
908db3d
fixed semantic versioning handling (major.minor.patch-prerelease.buil…
danielweck Apr 6, 2021
9d64963
fixed dd, dt, dl, dfn lookup table
danielweck Apr 6, 2021
2565b38
re-instated DAISY mods
danielweck Apr 6, 2021
d61e3dd
DAISY landmark-one-main rule really is "has a unique main landmark ..…
danielweck Apr 6, 2021
e8e5645
get role type is super class role now (DAISY patch)
danielweck Apr 6, 2021
20748a7
super class role checks
danielweck Apr 6, 2021
3ce8040
owned roles fix for biblioentry and doc-endnote
danielweck Apr 6, 2021
4140347
DPUB ARIA 1.1 align https://w3c.github.io/dpub-aria/#changelog
danielweck Apr 7, 2021
05d0726
DPUB ARIA 1.1. deprecate doc-biblioentry and doc-endnote
danielweck Apr 7, 2021
c5005ba
further relaxation of doc-endnote and doc-biblioentry (deprecated in …
danielweck Apr 7, 2021
7673aaa
version bump and URL update
danielweck Apr 7, 2021
1a8dd7a
fixes landmark-unique (DPUB roles) https://github.com/daisy/ace/issue…
danielweck Apr 7, 2021
d159e51
version bump
danielweck Apr 7, 2021
09b6abe
Axe landmark unique fixes (weird DOM parser bug ignores some element …
danielweck Apr 7, 2021
a8d882a
added unit test for landmark unique (broken DOM parser it seems)
danielweck Apr 7, 2021
491abc8
final round of fixes for landmark unique (rule filter takes precedenc…
danielweck Apr 7, 2021
21375e0
version bump
danielweck Apr 7, 2021
f1eee5b
Merge branch 'v4.1.4_DAISY' into v4.2.3_DAISY
danielweck Jun 23, 2021
3c08e8c
added missing NPM publish files
danielweck Jun 23, 2021
6cf8250
removed unnecessary files
danielweck Jun 23, 2021
8144048
removed another useless file
danielweck Jun 23, 2021
205efb0
dpub roles were not taken into account for aria-label prohibited attr…
danielweck Jun 23, 2021
73d2cd9
version bump
danielweck Jun 23, 2021
9017f37
Merge branch 'v4.2.3_DAISY' into v4.3.3_DAISY
danielweck Aug 30, 2021
19dd52c
doc update (auto-gen)
danielweck Aug 30, 2021
6b68cb1
ChromeDriver version update (90 -> 92)
danielweck Aug 30, 2021
327b8c0
'null' origin fix, see https://github.com/daisy/ace/issues/358#issuec…
danielweck Sep 14, 2021
4b0dd53
version bump to 4.3.3-canary.2
danielweck Sep 14, 2021
4b536ef
Merge branch 'v4.3.3_DAISY' into v4.3.5_DAISY
danielweck Nov 4, 2021
16b88b9
auto-generated rules doc
danielweck Nov 4, 2021
aacc525
Firefox and Chrome tests pass
danielweck Nov 4, 2021
c7040a0
Merge branch 'v4.3.5_DAISY' into v4.4.0_BASE
danielweck Feb 2, 2022
d36c2e0
fixed Axe's upstream deprecation bug
danielweck Feb 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
epub-type-has-matching-role pagebreak-label ported from Ace (translat…
…ed now)
danielweck committed Mar 10, 2021
commit 45529c184a42926334595ec88718bd59f046dd4a
44 changes: 44 additions & 0 deletions lib/core/public/configure.js
Original file line number Diff line number Diff line change
@@ -245,6 +245,50 @@ function configure(spec) {
});
}

// DAISY-AXE
if (!spec.rules) {
spec.rules = [];
}
spec.rules.push({
id: 'pagebreak-label',
// selector: '[*|type~="pagebreak"], [role~="doc-pagebreak"]',
// eslint-disable-next-line no-unused-vars
matches: function matches(node, virtualNode, context) {
return (
(node.hasAttribute('role') &&
node
.getAttribute('role')
.match(/\S+/g)
.includes('doc-pagebreak')) ||
(node.hasAttributeNS('http://www.idpf.org/2007/ops', 'type') &&
node
.getAttributeNS('http://www.idpf.org/2007/ops', 'type')
.match(/\S+/g)
.includes('pagebreak'))
);
},
any: ['aria-label', 'non-empty-title'],
metadata: {
description: 'Ensure page markers have an accessible label'
},
tags: ['cat.epub']
});
spec.rules.push({
id: 'epub-type-has-matching-role',
// selector: '[*|type]',
// eslint-disable-next-line no-unused-vars
matches: function matches(node, virtualNode, context) {
return node.hasAttributeNS('http://www.idpf.org/2007/ops', 'type');
},
any: ['matching-aria-role'],
metadata: {
help: 'ARIA role should be used in addition to epub:type',
description: 'Ensure the element has an ARIA role matching its epub:type'
},
tags: ['best-practice']
});
// DAISY-AXE

const modifiedRules = [];
if (spec.rules) {
if (!Array.isArray(spec.rules)) {
11 changes: 11 additions & 0 deletions locales/da.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"lang": "da",
"rules": {
"epub-type-has-matching-role": {
"desc": "Sikrer at elementet har en ARIA rolle, som matcher 'epub:type'",
"help": "ARIA rolle skal være til stede og matche den angivne 'epub:type'"
},
"pagebreak-label": {
"desc": "Sikrer at sidemarkører har en tilgængelig etiket ('label')"
},
"accesskeys": {
"description": "",
"help": "Værdien for attributten 'accesskey' skal være unik"
@@ -323,6 +330,10 @@
}
},
"checks": {
"matching-aria-role": {
"fail": "Elementet har ingen ARIA rolle, som matcher 'epub:type'",
"pass": "Elementet har en ARIA rolle, som matcher 'epub:type'"
},
"abstractrole": {
"pass": "Abstrakte roller er ikke brugt",
"fail": "Abstrakte roller bør ikke bruges"
11 changes: 11 additions & 0 deletions locales/de.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"lang": "de",
"rules": {
"epub-type-has-matching-role": {
"desc": "Ensure the element has an ARIA role matching its epub:type",
"help": "ARIA role should be used in addition to epub:type"
},
"pagebreak-label": {
"desc": "Ensure page markers have an accessible label"
},
"accesskeys": {
"description": "",
"help": "Der Wert des accesskey-Attributes muss einzigartig sein."
@@ -251,6 +258,10 @@
}
},
"checks": {
"matching-aria-role": {
"pass": "Element has an ARIA role matching its epub:type",
"fail": "Element has no ARIA role matching its epub:type"
},
"abstractrole": {
"pass": "",
"fail": "Abstrakte ARIA-Rollen dürfen nicht direkt verwendet werden."
11 changes: 11 additions & 0 deletions locales/es.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"lang": "es",
"rules": {
"epub-type-has-matching-role": {
"desc": "Asegurarse de que el elemento tiene un rol ARIA que corresponda a su epub:type",
"help": "Debería usarse ARIA role, además de epub:type"
},
"pagebreak-label": {
"desc": "Garantizar que los marcadores de página tienen una etiqueta accesible"
},
"accesskeys": {
"description": "Garantiza que cada valor para el atributo accesskey es único",
"help": "El valor del atributo accesskey debe ser único"
@@ -319,6 +326,10 @@
}
},
"checks": {
"matching-aria-role": {
"fail": "El elemento no tiene un rol ARIA que corresponda a su epub:type",
"pass": "El elemento tiene un rol ARIA que corresponde a su epub:type"
},
"abstractrole": {
"pass": "No se usan 'abstract roles'",
"fail": "Los 'abstract roles' no se pueden usar directamente"
11 changes: 11 additions & 0 deletions locales/eu.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"lang": "eu",
"rules": {
"epub-type-has-matching-role": {
"desc": "Ensure the element has an ARIA role matching its epub:type",
"help": "ARIA role should be used in addition to epub:type"
},
"pagebreak-label": {
"desc": "Ensure page markers have an accessible label"
},
"accesskeys": {
"description": "Accesskey atributurako balio bakoitza bakarra dela bermatzen du",
"help": "Accesskey atributuaren balioak bakarra izan behar du"
@@ -319,6 +326,10 @@
}
},
"checks": {
"matching-aria-role": {
"pass": "Element has an ARIA role matching its epub:type",
"fail": "Element has no ARIA role matching its epub:type"
},
"abstractrole": {
"pass": "Ez dira 'abstract rolak' erabiltzen",
"fail": "'abstract rolak 'ezin dira zuzenean erabili"
11 changes: 11 additions & 0 deletions locales/fr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"lang": "fr",
"rules": {
"epub-type-has-matching-role": {
"desc": "Vérifie qu’un élément a un rôle ARIA correspondant à son epub:type",
"help": "Un rôle ARIA devrait être spécifié en plus de l’epub:type"
},
"pagebreak-label": {
"desc": "Vérifie que les sauts de page ont un label accessible"
},
"accesskeys": {
"description": "Vérifier que chaque valeur de l’attribut accesskey est unique",
"help": "La valeur de l’attribut accesskey doit être unique"
@@ -327,6 +334,10 @@
}
},
"checks": {
"matching-aria-role": {
"fail": "L’élément n’a pas de rôle ARIA correspondant à son epub:type",
"pass": "L’élément a un rôle ARIA correspondant à son epub:type"
},
"abstractrole": {
"pass": "Les rôles abstraits ne sont pas utilisés",
"fail": "Les rôles abstraits ne peuvent pas être utilisés directement"
11 changes: 11 additions & 0 deletions locales/ja.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"lang": "ja",
"rules": {
"epub-type-has-matching-role": {
"desc": "Ensure the element has an ARIA role matching its epub:type",
"help": "ARIA role should be used in addition to epub:type"
},
"pagebreak-label": {
"desc": "Ensure page markers have an accessible label"
},
"accesskeys": {
"description": "すべてのaccesskey属性値が一意であることを確認します",
"help": "accesskey属性値は一意でなければなりません"
@@ -339,6 +346,10 @@
}
},
"checks": {
"matching-aria-role": {
"pass": "Element has an ARIA role matching its epub:type",
"fail": "Element has no ARIA role matching its epub:type"
},
"abstractrole": {
"pass": "抽象ロールは使用されていません",
"fail": {
11 changes: 11 additions & 0 deletions locales/ko.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"lang": "ko",
"rules": {
"epub-type-has-matching-role": {
"desc": "Ensure the element has an ARIA role matching its epub:type",
"help": "ARIA role should be used in addition to epub:type"
},
"pagebreak-label": {
"desc": "Ensure page markers have an accessible label"
},
"accesskeys": {
"description": "모든 accesskey 속성 값이 고유한지 확인합니다.",
"help": "accesskey 속성 값은 고유해야 합니다."
@@ -319,6 +326,10 @@
}
},
"checks": {
"matching-aria-role": {
"pass": "Element has an ARIA role matching its epub:type",
"fail": "Element has no ARIA role matching its epub:type"
},
"abstractrole": {
"pass": "추상 역할은 직접 사용하지 않습니다.",
"fail": "추상 역할은 직접 사용할 수 없습니다."
11 changes: 11 additions & 0 deletions locales/nl.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"lang": "nl",
"checks": {
"matching-aria-role": {
"pass": "Element has an ARIA role matching its epub:type",
"fail": "Element has no ARIA role matching its epub:type"
},
"abstractrole": {
"pass": "Er zijn geen abstracte rollen (role) gebruikt",
"fail": "Gebruik geen abstracte rollen (role)"
@@ -19,6 +23,13 @@
}
},
"rules": {
"epub-type-has-matching-role": {
"desc": "Ensure the element has an ARIA role matching its epub:type",
"help": "ARIA role should be used in addition to epub:type"
},
"pagebreak-label": {
"desc": "Ensure page markers have an accessible label"
},
"aria-required-attr": {
"description": "Zorg dat elementen met ARIA rollen (role) de vereiste ARIA attributen hebben",
"help": "Voorzien de vereiste ARIA attributen"
11 changes: 11 additions & 0 deletions locales/pt_BR.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"lang": "pt_BR",
"rules": {
"epub-type-has-matching-role": {
"desc": "Certifique-se de que o elemento tem um ARIA 'role' correspondente ao seu epub:type",
"help": "Um ARIA 'role' deve ser usado em conjunto com o epub:type"
},
"pagebreak-label": {
"desc": "Certifique-se de que os marcadores de páginas tenham um rótulo acessível"
},
"accesskeys": {
"description": "Certifique-se de que cada valor do atributo 'acesskey' é único",
"help": "O valor do atributo 'accesskey' deve ser único"
@@ -339,6 +346,10 @@
}
},
"checks": {
"matching-aria-role": {
"fail": "O elemento não tem um ARIA 'role' correspondente ao seu epub:type",
"pass": "O elemento tem um ARIA 'role' correspondente ao seu epub:type"
},
"abstractrole": {
"pass": "As funções abstratas não são utilizadas",
"fail": {