Skip to content

Commit a6fcb75

Browse files
authored
Merge pull request #2976 from dequelabs/release-4.2.2
chore(release): 4.2.2
2 parents a4188ab + 4e24d7b commit a6fcb75

46 files changed

Lines changed: 1829 additions & 1189 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
extends: ['prettier'],
33
parserOptions: {
4-
ecmaVersion: 9
4+
ecmaVersion: 2021
55
},
66
env: {
77
node: true,

.github/workflows/sync-master-develop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
create_sync_pull_request:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: dequelabs/action-sync-branches@v1.0.0
10+
- uses: dequelabs/action-sync-branches@v1
1111
with:
1212
github-token: ${{ secrets.GITHUB_TOKEN }}
1313
pr-title: "chore: merge master into develop"

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
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.
44

5+
### [4.2.2](https://github.com/dequelabs/axe-core/compare/v4.2.1...v4.2.2) (2021-06-03)
6+
7+
### Bug Fixes
8+
9+
- **aria-allowed-attr:** allow aria-posinset and aria-setsize on row elements for treegrids ([#2952](https://github.com/dequelabs/axe-core/issues/2952)) ([3023e69](https://github.com/dequelabs/axe-core/commit/3023e697b85c13f18f2cbb46b202400d8ce6a10d))
10+
- **heading-order:** Prevent crash on page with iframes but no headings ([#2965](https://github.com/dequelabs/axe-core/issues/2965)) ([4b7db37](https://github.com/dequelabs/axe-core/commit/4b7db3763735891972b8a13d6622fa30a687f3cb))
11+
- **meta-viewport:** test that a user-scalable number does not prevent zoom ([048c5c1](https://github.com/dequelabs/axe-core/commit/048c5c18c8245a43721a12237ac5f07f5b4a856b))
12+
- JS error in @axe-core/react caused by stale reference to heading ([3afda4e](https://github.com/dequelabs/axe-core/commit/3afda4effc4a099632138c5874ab305baaa5934a))
13+
514
### [4.2.1](https://github.com/dequelabs/axe-core/compare/v4.2.0...v4.2.1) (2021-05-18)
615

716
### Bug Fixes

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "axe-core",
3-
"version": "4.2.1",
3+
"version": "4.2.2",
44
"contributors": [
55
{
66
"name": "David Sturley",

build/cherry-pick.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ let targetVersion = releaseType === 'patch' ? version : `${major}.${minor}.0`;
4848
// get all commits from a branch
4949
function getCommits(branch) {
5050
const stdout = execSync(`git log ${branch || ''} --abbrev-commit`).toString();
51-
const allCommits = stdout.split('commit ').filter(commit => !!commit);
51+
const allCommits = stdout
52+
.split(/commit (?=[\w\d]{8}[\n\r])/)
53+
.filter(commit => !!commit);
5254

5355
// parse commits
5456
const commits = [];
@@ -93,6 +95,7 @@ function getCommits(branch) {
9395
// filter merge commits and any types that don't match the release type
9496
if (
9597
!merge &&
98+
subject &&
9699
!subject.startsWith('merge branch') &&
97100
scope !== 'release' &&
98101
commitType[releaseType] &&

doc/rule-descriptions.md

Lines changed: 57 additions & 57 deletions
Large diffs are not rendered by default.

doc/standards-object.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ The [`htmlElms`](../lib/standards/html-elms.js) object defines valid HTML elemen
9595

9696
- `aria-allowed-attr` - Checks if the attribute can be used on the element from the `noAriaAttrs` property.
9797
- `aria-allowed-role` - Checks if the role can be used on the HTML element from the `allowedRoles` property.
98-
- `aria-required-attrs` - Checks if any required attrs are defied implicitly on the element from the `implicitAttrs` property.
98+
- `aria-required-attrs` - Checks if any required attrs are defined implicitly on the element from the `implicitAttrs` property.
9999

100100
### Structure
101101

lib/checks/aria/aria-prohibited-attr-evaluate.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,40 @@ import standards from '../../standards';
2727
* @return {Boolean} True if the element uses any prohibited ARIA attributes. False otherwise.
2828
*/
2929
function ariaProhibitedAttrEvaluate(node, options = {}, virtualNode) {
30-
const { elementsAllowedAriaLabel = [] } = options;
31-
const prohibitedList = listProhibitedAttrs(virtualNode, elementsAllowedAriaLabel);
32-
30+
const extraElementsAllowedAriaLabel = options.elementsAllowedAriaLabel || [];
31+
32+
const prohibitedList = listProhibitedAttrs(
33+
virtualNode,
34+
extraElementsAllowedAriaLabel
35+
);
36+
3337
const prohibited = prohibitedList.filter(attrName => {
3438
if (!virtualNode.attrNames.includes(attrName)) {
3539
return false;
3640
}
37-
return sanitize(virtualNode.attr(attrName)) !== ''
41+
return sanitize(virtualNode.attr(attrName)) !== '';
3842
});
3943

4044
if (prohibited.length === 0) {
4145
return false;
4246
}
43-
47+
4448
this.data(prohibited);
45-
const hasTextContent = sanitize(subtreeText(virtualNode)) !== ''
49+
const hasTextContent = sanitize(subtreeText(virtualNode)) !== '';
4650
// Don't fail if there is text content to announce
4751
return hasTextContent ? undefined : true;
4852
}
4953

5054
function listProhibitedAttrs(virtualNode, elementsAllowedAriaLabel) {
51-
const role = getRole(virtualNode);
52-
const roleSpec = standards.ariaRoles[role]
55+
const role = getRole(virtualNode, { chromium: true });
56+
const roleSpec = standards.ariaRoles[role];
5357
if (roleSpec) {
5458
return roleSpec.prohibitedAttrs || [];
5559
}
56-
57-
const { nodeName } = virtualNode.props
58-
if (elementsAllowedAriaLabel.includes(nodeName)) {
59-
return []
60+
61+
const { nodeName } = virtualNode.props;
62+
if (!!role || elementsAllowedAriaLabel.includes(nodeName)) {
63+
return [];
6064
}
6165
return ['aria-label', 'aria-labelledby'];
6266
}

lib/checks/aria/aria-prohibited-attr.json

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,7 @@
22
"id": "aria-prohibited-attr",
33
"evaluate": "aria-prohibited-attr-evaluate",
44
"options": {
5-
"elementsAllowedAriaLabel": [
6-
"audio",
7-
"applet",
8-
"canvas",
9-
"dl",
10-
"embed",
11-
"iframe",
12-
"input",
13-
"label",
14-
"meter",
15-
"object",
16-
"svg",
17-
"video"
18-
]
5+
"elementsAllowedAriaLabel": ["applet", "input"]
196
},
207
"metadata": {
218
"impact": "serious",

lib/checks/mobile/meta-viewport-scale-evaluate.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ function metaViewportScaleEvaluate(node, options, virtualNode) {
4545
return false;
4646
}
4747

48+
const userScalableAsFloat = parseFloat(result['user-scalable']);
49+
if (
50+
!lowerBound &&
51+
result['user-scalable'] &&
52+
(userScalableAsFloat || userScalableAsFloat === 0) &&
53+
userScalableAsFloat > -1 &&
54+
userScalableAsFloat < 1
55+
) {
56+
this.data('user-scalable');
57+
return false;
58+
}
59+
4860
if (
4961
result['maximum-scale'] &&
5062
parseFloat(result['maximum-scale']) < scaleMinimum

0 commit comments

Comments
 (0)