From e138fd6a00a8da6c48a74a614adc5dae8f2044e1 Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Fri, 29 Oct 2021 10:24:09 -0600 Subject: [PATCH 1/2] fix(aria-allowed-attr): revert violation for non-global ARIA attrs on element without role (#3243) --- lib/checks/aria/aria-allowed-attr-evaluate.js | 2 +- test/checks/aria/allowed-attr.js | 12 ++++++++++++ .../rules/aria-allowed-attr/failures.html | 4 ++-- .../rules/aria-allowed-attr/failures.json | 1 - 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/checks/aria/aria-allowed-attr-evaluate.js b/lib/checks/aria/aria-allowed-attr-evaluate.js index add21f2b7b..9d309437bf 100644 --- a/lib/checks/aria/aria-allowed-attr-evaluate.js +++ b/lib/checks/aria/aria-allowed-attr-evaluate.js @@ -69,7 +69,7 @@ function ariaAllowedAttrEvaluate(node, options, virtualNode) { ariaAttr.forEach(attr => { preChecks[attr] = validateRowAttrs; }); - if (allowed) { + if (role && allowed) { for (let i = 0; i < attrs.length; i++) { const attrName = attrs[i]; if (validateAttr(attrName) && preChecks[attrName]?.()) { diff --git a/test/checks/aria/allowed-attr.js b/test/checks/aria/allowed-attr.js index cd90e79dcf..a221956733 100644 --- a/test/checks/aria/allowed-attr.js +++ b/test/checks/aria/allowed-attr.js @@ -59,6 +59,18 @@ describe('aria-allowed-attr', function() { assert.isNull(checkContext._data); }); + it('should return true for non-global attributes if there is no role', function() { + var vNode = queryFixture( + '
' + ); + + assert.isTrue( + axe.testUtils + .getCheckEvaluate('aria-allowed-attr') + .call(checkContext, null, null, vNode) + ); + }); + it('should not report on invalid attributes', function() { var vNode = queryFixture( '' diff --git a/test/integration/rules/aria-allowed-attr/failures.html b/test/integration/rules/aria-allowed-attr/failures.html index 66dd65de84..4a5ed02109 100644 --- a/test/integration/rules/aria-allowed-attr/failures.html +++ b/test/integration/rules/aria-allowed-attr/failures.html @@ -28,12 +28,12 @@ - +> -->
diff --git a/test/integration/rules/aria-allowed-attr/failures.json b/test/integration/rules/aria-allowed-attr/failures.json index 99d8d731af..1d00054e6c 100644 --- a/test/integration/rules/aria-allowed-attr/failures.json +++ b/test/integration/rules/aria-allowed-attr/failures.json @@ -31,7 +31,6 @@ ["#fail27"], ["#fail28"], ["#fail29"], - ["#fail30"], ["#fail35"], ["#fail36"], ["#fail37"], From d9ce5fb65dc8b69841b4ff7b680b32ff7c258eb2 Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Fri, 29 Oct 2021 10:38:26 -0600 Subject: [PATCH 2/2] chore(release): 4.3.5 --- CHANGELOG.md | 6 ++++++ bower.json | 2 +- package-lock.json | 2 +- package.json | 2 +- sri-history.json | 4 ++++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1a58fe83a..1f50ed1d93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [4.3.5](https://github.com/dequelabs/axe-core/compare/v4.3.4...v4.3.5) (2021-10-29) + +### Bug Fixes + +- **aria-allowed-attr:** revert violation for non-global ARIA attrs on element without role ([#3243](https://github.com/dequelabs/axe-core/issues/3243)) ([e138fd6](https://github.com/dequelabs/axe-core/commit/e138fd6a00a8da6c48a74a614adc5dae8f2044e1)) + ### [4.3.4](https://github.com/dequelabs/axe-core/compare/v4.3.3...v4.3.4) (2021-10-22) ### Bug Fixes diff --git a/bower.json b/bower.json index b5d9f3cc7e..aa7a303f2c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "axe-core", - "version": "4.3.4", + "version": "4.3.5", "contributors": [ { "name": "David Sturley", diff --git a/package-lock.json b/package-lock.json index 9354e17931..cd8dfc06ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "axe-core", - "version": "4.3.4", + "version": "4.3.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0c77d0f03b..2e7f0f5b86 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "axe-core", "description": "Accessibility engine for automated Web UI testing", - "version": "4.3.4", + "version": "4.3.5", "license": "MPL-2.0", "engines": { "node": ">=4" diff --git a/sri-history.json b/sri-history.json index 606aead07e..584dc3bbe1 100644 --- a/sri-history.json +++ b/sri-history.json @@ -290,5 +290,9 @@ "4.3.4": { "axe.js": "sha256-C62RaRaF4cx65nFcFNMq5qhRPs0K3syB/x32hxSnDFM=", "axe.min.js": "sha256-Qw1EkY/ShOt08vZ7tZXSskZI3bQ6HGw9t9F6Rq05MAo=" + }, + "4.3.5": { + "axe.js": "sha256-pBzsgJIL4mZHcw50O3sj5f1ZYkMYLG659lHq6Qrkuzc=", + "axe.min.js": "sha256-PVZfyAKgcOWwy7tmB01H7BVjKLjtFW5QO94AIXxWkcw=" } }