Skip to content

Commit

Permalink
Merge pull request #2976 from dequelabs/release-4.2.2
Browse files Browse the repository at this point in the history
chore(release): 4.2.2
  • Loading branch information
WilcoFiers authored Jun 3, 2021
2 parents a4188ab + 4e24d7b commit a6fcb75
Show file tree
Hide file tree
Showing 46 changed files with 1,829 additions and 1,189 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
extends: ['prettier'],
parserOptions: {
ecmaVersion: 9
ecmaVersion: 2021
},
env: {
node: true,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-master-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
create_sync_pull_request:
runs-on: ubuntu-latest
steps:
- uses: dequelabs/action-sync-branches@v1.0.0
- uses: dequelabs/action-sync-branches@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pr-title: "chore: merge master into develop"
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

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.2.2](https://github.com/dequelabs/axe-core/compare/v4.2.1...v4.2.2) (2021-06-03)

### Bug Fixes

- **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))
- **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))
- **meta-viewport:** test that a user-scalable number does not prevent zoom ([048c5c1](https://github.com/dequelabs/axe-core/commit/048c5c18c8245a43721a12237ac5f07f5b4a856b))
- JS error in @axe-core/react caused by stale reference to heading ([3afda4e](https://github.com/dequelabs/axe-core/commit/3afda4effc4a099632138c5874ab305baaa5934a))

### [4.2.1](https://github.com/dequelabs/axe-core/compare/v4.2.0...v4.2.1) (2021-05-18)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axe-core",
"version": "4.2.1",
"version": "4.2.2",
"contributors": [
{
"name": "David Sturley",
Expand Down
5 changes: 4 additions & 1 deletion build/cherry-pick.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ let targetVersion = releaseType === 'patch' ? version : `${major}.${minor}.0`;
// get all commits from a branch
function getCommits(branch) {
const stdout = execSync(`git log ${branch || ''} --abbrev-commit`).toString();
const allCommits = stdout.split('commit ').filter(commit => !!commit);
const allCommits = stdout
.split(/commit (?=[\w\d]{8}[\n\r])/)
.filter(commit => !!commit);

// parse commits
const commits = [];
Expand Down Expand Up @@ -93,6 +95,7 @@ function getCommits(branch) {
// filter merge commits and any types that don't match the release type
if (
!merge &&
subject &&
!subject.startsWith('merge branch') &&
scope !== 'release' &&
commitType[releaseType] &&
Expand Down
114 changes: 57 additions & 57 deletions doc/rule-descriptions.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/standards-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ The [`htmlElms`](../lib/standards/html-elms.js) object defines valid HTML elemen

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

### Structure

Expand Down
28 changes: 16 additions & 12 deletions lib/checks/aria/aria-prohibited-attr-evaluate.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,40 @@ import standards from '../../standards';
* @return {Boolean} True if the element uses any prohibited ARIA attributes. False otherwise.
*/
function ariaProhibitedAttrEvaluate(node, options = {}, virtualNode) {
const { elementsAllowedAriaLabel = [] } = options;
const prohibitedList = listProhibitedAttrs(virtualNode, elementsAllowedAriaLabel);

const extraElementsAllowedAriaLabel = options.elementsAllowedAriaLabel || [];

const prohibitedList = listProhibitedAttrs(
virtualNode,
extraElementsAllowedAriaLabel
);

const prohibited = prohibitedList.filter(attrName => {
if (!virtualNode.attrNames.includes(attrName)) {
return false;
}
return sanitize(virtualNode.attr(attrName)) !== ''
return sanitize(virtualNode.attr(attrName)) !== '';
});

if (prohibited.length === 0) {
return false;
}

this.data(prohibited);
const hasTextContent = sanitize(subtreeText(virtualNode)) !== ''
const hasTextContent = sanitize(subtreeText(virtualNode)) !== '';
// Don't fail if there is text content to announce
return hasTextContent ? undefined : true;
}

function listProhibitedAttrs(virtualNode, elementsAllowedAriaLabel) {
const role = getRole(virtualNode);
const roleSpec = standards.ariaRoles[role]
const role = getRole(virtualNode, { chromium: true });
const roleSpec = standards.ariaRoles[role];
if (roleSpec) {
return roleSpec.prohibitedAttrs || [];
}
const { nodeName } = virtualNode.props
if (elementsAllowedAriaLabel.includes(nodeName)) {
return []

const { nodeName } = virtualNode.props;
if (!!role || elementsAllowedAriaLabel.includes(nodeName)) {
return [];
}
return ['aria-label', 'aria-labelledby'];
}
Expand Down
15 changes: 1 addition & 14 deletions lib/checks/aria/aria-prohibited-attr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,7 @@
"id": "aria-prohibited-attr",
"evaluate": "aria-prohibited-attr-evaluate",
"options": {
"elementsAllowedAriaLabel": [
"audio",
"applet",
"canvas",
"dl",
"embed",
"iframe",
"input",
"label",
"meter",
"object",
"svg",
"video"
]
"elementsAllowedAriaLabel": ["applet", "input"]
},
"metadata": {
"impact": "serious",
Expand Down
12 changes: 12 additions & 0 deletions lib/checks/mobile/meta-viewport-scale-evaluate.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ function metaViewportScaleEvaluate(node, options, virtualNode) {
return false;
}

const userScalableAsFloat = parseFloat(result['user-scalable']);
if (
!lowerBound &&
result['user-scalable'] &&
(userScalableAsFloat || userScalableAsFloat === 0) &&
userScalableAsFloat > -1 &&
userScalableAsFloat < 1
) {
this.data('user-scalable');
return false;
}

if (
result['maximum-scale'] &&
parseFloat(result['maximum-scale']) < scaleMinimum
Expand Down
Loading

0 comments on commit a6fcb75

Please sign in to comment.