From 58b76a60eef56826425d06ecf5e16277f184ff2b Mon Sep 17 00:00:00 2001 From: Hugo Giraudel Date: Fri, 1 Dec 2017 13:51:53 +0100 Subject: [PATCH 1/4] fix(commons/aria): allow aria-required on radio role https://github.com/dequelabs/axe-core/issues/540 --- lib/commons/aria/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commons/aria/index.js b/lib/commons/aria/index.js index 18b4168834..679a0cdf2a 100644 --- a/lib/commons/aria/index.js +++ b/lib/commons/aria/index.js @@ -617,7 +617,7 @@ lookupTables.role = { 'radio': { type: 'widget', attributes: { - allowed: ['aria-checked', 'aria-selected', 'aria-posinset', 'aria-setsize'], + allowed: ['aria-checked', 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-required'], }, owned: null, nameFrom: ['author', 'contents'], From 3e21c6e63a7449acd362c2a66a34a8a865d4530b Mon Sep 17 00:00:00 2001 From: Hugo Giraudel Date: Fri, 1 Dec 2017 16:25:55 +0100 Subject: [PATCH 2/4] fix(commons/aria): allow aria-required on checkbox role --- lib/commons/aria/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commons/aria/index.js b/lib/commons/aria/index.js index 679a0cdf2a..ed88d832a4 100644 --- a/lib/commons/aria/index.js +++ b/lib/commons/aria/index.js @@ -249,7 +249,7 @@ lookupTables.role = { 'checkbox': { type: 'widget', attributes: { - allowed: ['aria-checked'] + allowed: ['aria-checked', 'aria-required'] }, owned: null, nameFrom: ['author', 'contents'], From a3de5457b91ce192eb5cb86b7718d492d4f7f67c Mon Sep 17 00:00:00 2001 From: Hugo Giraudel Date: Fri, 1 Dec 2017 16:43:30 +0100 Subject: [PATCH 3/4] test(commons/aria): add test to ensure allowed attributes do not report --- test/checks/aria/allowed-attr.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/checks/aria/allowed-attr.js b/test/checks/aria/allowed-attr.js index 91a05f5429..7ff80fd54e 100644 --- a/test/checks/aria/allowed-attr.js +++ b/test/checks/aria/allowed-attr.js @@ -107,4 +107,16 @@ describe('aria-allowed-attr', function () { }); -}); \ No newline at end of file + it('should not report on allowed attributes', function () { + var node = document.createElement('div'); + node.id = 'test'; + node.tabIndex = 1; + node.setAttribute('role', 'radio'); + node.setAttribute('aria-required', 'true'); + fixture.appendChild(node); + + assert.isTrue(checks['aria-allowed-attr'].evaluate.call(checkContext, node)); + assert.isNull(checkContext._data); + }); + +}); From 92b3fbaf8fb0bd40464ca8a2cee290a5379a1607 Mon Sep 17 00:00:00 2001 From: Hugo Giraudel Date: Fri, 1 Dec 2017 16:49:47 +0100 Subject: [PATCH 4/4] test(commons/aria): add integration test to allow aria-required on radio and checkbox roles --- test/integration/rules/aria-allowed-attr/passes.html | 6 ++++++ test/integration/rules/aria-allowed-attr/passes.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/integration/rules/aria-allowed-attr/passes.html b/test/integration/rules/aria-allowed-attr/passes.html index 90f5387c48..0e4d329a0a 100644 --- a/test/integration/rules/aria-allowed-attr/passes.html +++ b/test/integration/rules/aria-allowed-attr/passes.html @@ -136,3 +136,9 @@
ok
+ + + + + + diff --git a/test/integration/rules/aria-allowed-attr/passes.json b/test/integration/rules/aria-allowed-attr/passes.json index d6e9ea5ece..7673ecaf5d 100644 --- a/test/integration/rules/aria-allowed-attr/passes.json +++ b/test/integration/rules/aria-allowed-attr/passes.json @@ -11,6 +11,7 @@ ["#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"], ["#pass68"] + ["#pass64"], ["#pass65"], ["#pass66"], ["#pass67"], ["#pass68"], ["#pass69"], ["#pass70"], + ["#pass71"], ["#pass72"] ] }