From 9b4d2eea4fcb2c48bab71e442da3a588b3893853 Mon Sep 17 00:00:00 2001 From: Marcy Sutton Date: Wed, 6 Sep 2017 07:59:28 -0700 Subject: [PATCH] Additional ARIA 1.1. support and tests (#509) * feat(ARIA 1.1): Allow row-index, setsize and posinset on more roles * test(aria): aria-haspopup, aria-modal for 1.1 * style(test/aria): add line breaks for readability * test(aria): add missing roles and properties --- lib/commons/aria/index.js | 12 +- .../rules/aria-allowed-attr/passes.html | 200 +++++++++---- .../rules/aria-allowed-attr/passes.json | 2 +- .../rules/aria-roles/aria-roles.html | 106 +++---- .../rules/aria-roles/aria-roles.json | 2 +- .../aria-valid-attr-value.html | 280 +++++++++--------- .../aria-valid-attr-value.json | 3 +- .../aria-valid-attr/aria-valid-attr.html | 43 +-- .../aria-valid-attr/aria-valid-attr.json | 3 +- 9 files changed, 369 insertions(+), 282 deletions(-) diff --git a/lib/commons/aria/index.js b/lib/commons/aria/index.js index 2e844d8b14..3ffbf1b94a 100644 --- a/lib/commons/aria/index.js +++ b/lib/commons/aria/index.js @@ -200,7 +200,7 @@ lookupTables.role = { 'article': { type: 'structure', attributes: { - allowed: ['aria-expanded'] + allowed: ['aria-expanded', 'aria-posinset', 'aria-setsize'] }, owned: null, nameFrom: ['author'], @@ -523,7 +523,9 @@ lookupTables.role = { }, 'menuitem': { type: 'widget', - attributes: null, + attributes: { + allowed: ['aria-posinset', 'aria-setsize'] + }, owned: null, nameFrom: ['author', 'contents'], context: ['menu', 'menubar'], @@ -532,7 +534,7 @@ lookupTables.role = { 'menuitemcheckbox': { type: 'widget', attributes: { - allowed: ['aria-checked'] + allowed: ['aria-checked', 'aria-posinset', 'aria-setsize'] }, owned: null, nameFrom: ['author', 'contents'], @@ -643,7 +645,7 @@ lookupTables.role = { 'row': { type: 'structure', attributes: { - allowed: ['aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowcount'] + allowed: ['aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowcount', 'aria-rowindex'] }, owned: { one: ['cell', 'columnheader', 'rowheader', 'gridcell'] @@ -773,7 +775,7 @@ lookupTables.role = { 'tab': { type: 'widget', attributes: { - allowed: ['aria-selected', 'aria-expanded'] + allowed: ['aria-selected', 'aria-expanded', 'aria-setsize', 'aria-posinset'] }, owned: null, nameFrom: ['author', 'contents'], diff --git a/test/integration/rules/aria-allowed-attr/passes.html b/test/integration/rules/aria-allowed-attr/passes.html index f8187f9dfa..e10c84d156 100644 --- a/test/integration/rules/aria-allowed-attr/passes.html +++ b/test/integration/rules/aria-allowed-attr/passes.html @@ -1,68 +1,138 @@ - -
ok
-
ok
-
ok
- -
ok
- -
ok
-
ok
- - -
ok
- -
ok
-
ok
-
ok
-
ok
-
ok
-
ok
-
ok
- -
ok
-
ok
-
ok
-
ok
-
ok
-
ok
-
ok
-
ok
- - -
ok
-
ok
- -
ok
-
ok
-
ok
- -
ok
-
ok
-
ok
-
ok
-
ok
-
ok
- - -
ok
-
ok
-
ok
- -
ok
-
ok
-
ok
-
ok
- - -
ok
-
ok
-
ok
-
ok
-
ok
- -
ok
-
ok
- + + +
ok
+ +
ok
+ +
ok
+ + + +
ok
+ + + +
ok
+ +
ok
+ + + + + +
ok
+ + + +
ok
+ +
ok
+ +
ok
+ +
ok
+ +
ok
+ +
ok
+ +
ok
+ +
ok
+ + + +
ok
+ +
ok
+ +
ok
+ +
ok
+ +
ok
+ +
ok
+ +
ok
+ +
ok
+ + + + + + + +
ok
+ +
ok
+ + + +
ok
+ +
ok
+ +
ok
+ + + +
ok
+ +
ok
+ +
ok
+ +
ok
+ +
ok
+ +
ok
+ + + + + +
ok
+ +
ok
+ +
ok
+ + + +
ok
+ +
ok
+ +
ok
+ +
ok
+ + + + + +
ok
+ +
ok
+ +
ok
+ +
ok
+ +
ok
+ + + +
ok
+ +
ok
+ +
ok
+ + diff --git a/test/integration/rules/aria-allowed-attr/passes.json b/test/integration/rules/aria-allowed-attr/passes.json index d7beec65bf..13ad56f7b0 100644 --- a/test/integration/rules/aria-allowed-attr/passes.json +++ b/test/integration/rules/aria-allowed-attr/passes.json @@ -11,6 +11,6 @@ ["#pass43"], ["#pass44"], ["#pass45"], ["#pass46"], ["#pass47"], ["#pass48"], ["#pass49"], ["#pass50"], ["#pass51"], ["#pass52"], ["#pass53"], ["#pass54"], ["#pass55"], ["#pass56"], ["#pass57"], ["#pass58"], ["#pass59"], ["#pass60"], ["#pass61"], ["#pass62"], ["#pass63"], - ["#pass64"], ["#pass65"] + ["#pass64"], ["#pass65"], ["#pass66"], ["#pass67"], ["#pass68"] ] } \ No newline at end of file diff --git a/test/integration/rules/aria-roles/aria-roles.html b/test/integration/rules/aria-roles/aria-roles.html index 563a345448..c27c2ea4b5 100644 --- a/test/integration/rules/aria-roles/aria-roles.html +++ b/test/integration/rules/aria-roles/aria-roles.html @@ -15,58 +15,60 @@
ok
ok
-
ok
-
ok
-
ok
-
ok
-
ok
- -
ok
-
ok
-
ok
-
ok
-
ok
-
ok
-
ok
-
ok
- - - -
ok
-
ok
- -
ok
-
ok
- -
ok
- -
ok
-
ok
-
ok
-
ok
-
ok
-
ok
- - -
ok
-
ok
-
ok
- -
ok
-
ok
-
ok
-
ok
- - -
ok
-
ok
-
ok
-
ok
-
ok
-
ok
- -
ok
-
ok
+
ok
+
ok
+
ok
+
ok
+
ok
+
ok
+ +
ok
+
ok
+
ok
+
ok
+
ok
+
ok
+
ok
+
ok
+ + + +
ok
+
ok
+ +
ok
+
ok
+ +
ok
+ +
ok
+
ok
+
ok
+
ok
+
ok
+
ok
+ + +
ok
+
ok
+
ok
+ +
ok
+
ok
+
ok
+
ok
+
ok
+ + +
ok
+
ok
+
ok
+
ok
+
ok
+
ok
+ +
ok
+
ok
diff --git a/test/integration/rules/aria-roles/aria-roles.json b/test/integration/rules/aria-roles/aria-roles.json index e420a015ae..e3d49f6ea4 100644 --- a/test/integration/rules/aria-roles/aria-roles.json +++ b/test/integration/rules/aria-roles/aria-roles.json @@ -15,6 +15,6 @@ ["#pass43"], ["#pass44"], ["#pass45"], ["#pass46"], ["#pass47"], ["#pass48"], ["#pass49"], ["#pass50"], ["#pass51"], ["#pass52"], ["#pass53"], ["#pass54"], ["#pass55"], ["#pass56"], ["#pass57"], ["#pass58"], ["#pass59"], ["#pass60"], ["#pass61"], ["#pass62"], ["#pass63"], - ["#pass64"], ["#pass65"], ["#pass66"], ["#pass67"] + ["#pass64"], ["#pass65"], ["#pass66"], ["#pass67"], ["#pass68"], ["#pass69"] ] } \ No newline at end of file diff --git a/test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.html b/test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.html index cbd34691ae..54be03617a 100644 --- a/test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.html +++ b/test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.html @@ -100,143 +100,151 @@

Possible False Positives

hi
hi
- -
hi
- -
hi
-
hi
-
hi
-
hi
- -
hi
- -
hi
-
hi
-
hi
- -
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
- -
hi
-
hi
-
hi
- -
hi
-
hi
- -
hi
-
hi
- -
hi
-
hi
- -
hi
-
hi
-
hi
- -
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
- -
hi
-
hi
-
hi
-
hi
- -
hi
-
hi
- -
hi
-
hi
-
hi
-
hi
- -
hi
-
hi
- -
hi
-
hi
-
hi
- -
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
- -
hi
-
hi
-
hi
-
hi
- -
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
- -
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+ +
hi
+ +
hi
+
hi
+
hi
+
hi
+ +
hi
+ +
hi
+
hi
+
hi
+ +
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+ +
hi
+
hi
+
hi
+ +
hi
+
hi
+ +
hi
+
hi
+ +
hi
+
hi
+ +
hi
+
hi
+ +
hi
+
hi
+
hi
+ +
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+ +
hi
+
hi
+
hi
+
hi
+ +
hi
+
hi
+ +
hi
+
hi
+
hi
+
hi
+ +
hi
+
hi
+ +
hi
+
hi
+
hi
+ +
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+ +
hi
+
hi
+
hi
+
hi
+ +
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+ +
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
Hi
Hi2
diff --git a/test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.json b/test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.json index b168b90a9a..3bbbfbe1d4 100644 --- a/test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.json +++ b/test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.json @@ -30,6 +30,7 @@ ["#pass133"], ["#pass134"], ["#pass135"], ["#pass136"], ["#pass137"], ["#pass138"], ["#pass139"], ["#pass140"], ["#pass141"], ["#pass142"], ["#pass143"], ["#pass144"], ["#pass145"], ["#pass146"], ["#pass147"], ["#pass148"], ["#pass149"], ["#pass150"], ["#pass151"], ["#pass152"], ["#pass153"], - ["#pass154"], ["#pass155"], ["#pass156"], ["#pass157"], ["#pass158"], ["#pass159"], ["#pass160"] + ["#pass154"], ["#pass155"], ["#pass156"], ["#pass157"], ["#pass158"], ["#pass159"], ["#pass160"], + ["#pass161"], ["#pass162"], ["#pass163"], ["#pass164"], ["#pass165"], ["#pass166"], ["#pass167"] ] } diff --git a/test/integration/rules/aria-valid-attr/aria-valid-attr.html b/test/integration/rules/aria-valid-attr/aria-valid-attr.html index 796afc4dfa..d0b8f4cc6b 100644 --- a/test/integration/rules/aria-valid-attr/aria-valid-attr.html +++ b/test/integration/rules/aria-valid-attr/aria-valid-attr.html @@ -27,25 +27,28 @@

Possible False Positives

hi
hi
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
-
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
+
hi
diff --git a/test/integration/rules/aria-valid-attr/aria-valid-attr.json b/test/integration/rules/aria-valid-attr/aria-valid-attr.json index 5ebde74b6f..201a16b117 100644 --- a/test/integration/rules/aria-valid-attr/aria-valid-attr.json +++ b/test/integration/rules/aria-valid-attr/aria-valid-attr.json @@ -10,6 +10,7 @@ ["#pass8"], ["#pass9"], ["#pass10"], ["#pass11"], ["#pass12"], ["#pass13"], ["#pass14"], ["#pass15"], ["#pass16"], ["#pass17"], ["#pass18"], ["#pass19"], ["#pass20"], ["#pass21"], ["#pass22"], ["#pass23"], ["#pass24"], ["#pass25"], ["#pass26"], ["#pass27"], ["#pass28"], - ["#pass29"], ["#pass30"], ["#pass31"], ["#pass32"], ["#pass33"], ["#pass34"], ["#pass35"] + ["#pass29"], ["#pass30"], ["#pass31"], ["#pass32"], ["#pass33"], ["#pass34"], ["#pass35"], + ["#pass36"], ["#pass37"], ["#pass38"] ] }