Skip to content

Commit ffa6669

Browse files
authored
Merge pull request #2140 from dequelabs/release-3.5.3
chore: release 3.5.3
2 parents 15ff7eb + 37e48e2 commit ffa6669

35 files changed

Lines changed: 536 additions & 158 deletions

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
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+
### [3.5.3](https://github.com/dequelabs/axe-core/compare/v3.5.2...v3.5.3) (2020-03-31)
6+
7+
### Bug Fixes
8+
9+
- **meta-viewport:** parse negative and string values for `maximum-scale` ([#2137](https://github.com/dequelabs/axe-core/issues/2137)) ([8c92472](https://github.com/dequelabs/axe-core/commit/8c92472397676d44b333cf50ad1a9413b9783c2c))
10+
- **respondable:** ignore reflected messages from iframes ([#2134](https://github.com/dequelabs/axe-core/issues/2134)) ([3ab9f21](https://github.com/dequelabs/axe-core/commit/3ab9f21414d8f4195ac95ffca8f0ce52258539b0))
11+
- **header-present:** update verbiage to use heading instead of header ([#2132](https://github.com/dequelabs/axe-core/issues/2132)) ([8890063](https://github.com/dequelabs/axe-core/commit/889006397329a35a170f4a3d24c55c3c4fd758fc))
12+
- **color-contrast:** mark more punctuations for review ([#2126](https://github.com/dequelabs/axe-core/issues/2126)) ([dc98afc](https://github.com/dequelabs/axe-core/commit/dc98afc841c86e4b7b771bbb1171152a151c3e5b))
13+
- **unicode:** detect supplementary private use area A ([#2102](https://github.com/dequelabs/axe-core/issues/2102)) ([f1739c2](https://github.com/dequelabs/axe-core/commit/f1739c21efdf5cf6fddf425d1c72b056757f3ba1))
14+
- **definition-list:** Mention <div> is allowed to group content in <dl> ([#2098](https://github.com/dequelabs/axe-core/issues/2098)) ([76b1a9f](https://github.com/dequelabs/axe-core/commit/76b1a9f7f244e43f63351c46d91fc8b27040ba98))
15+
- **td-headers-attr:** mark as needs review if headers attr is empty ([#2096](https://github.com/dequelabs/axe-core/issues/2096)) ([699b566](https://github.com/dequelabs/axe-core/commit/699b566111cfed2a4ebeade35346a49bcb3546c7))
16+
- **td-has-headers:** don't fail for empty headers attribute ([#2095](https://github.com/dequelabs/axe-core/issues/2095)) ([7952a37](https://github.com/dequelabs/axe-core/commit/7952a377b960c2403c8d4758a9f35ebe525549fe))
17+
- **th-has-data-cells:** fail when data cell points to a different header ([#2094](https://github.com/dequelabs/axe-core/issues/2094)) ([d3bd416](https://github.com/dequelabs/axe-core/commit/d3bd416a3df7324231f17ff9e1e20dc6342c7aa5))
18+
- **has-lang:** update message to indicate that xml:lang is not valid on HTML pages ([#2093](https://github.com/dequelabs/axe-core/issues/2093)) ([c3a7de2](https://github.com/dequelabs/axe-core/commit/c3a7de206baf77c0b25c8c095119393b1dc85f0f))
19+
- **page-no-duplicate-contentinfo:** do not fail when first element is inside landmark ([#2092](https://github.com/dequelabs/axe-core/issues/2092)) ([eca7e05](https://github.com/dequelabs/axe-core/commit/eca7e05cc6ff750855bcb219833967a9d7087679))
20+
521
### [3.5.2](https://github.com/dequelabs/axe-core/compare/v3.5.1...v3.5.2) (2020-03-06)
622

723
### Bug Fixes

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,16 @@ Now include the javascript file in each of your iframes in your fixtures or test
5050
Now insert calls at each point in your tests where a new piece of UI becomes visible or exposed:
5151

5252
```js
53-
axe.run()
54-
.then(results => {
55-
if (results.violations.length) {
56-
throw new Error('Accessibility issues found')
57-
}
58-
})
59-
.catch(err => {
60-
console.error('Something bad happened:', err.message)
61-
})
53+
axe
54+
.run()
55+
.then(results => {
56+
if (results.violations.length) {
57+
throw new Error('Accessibility issues found');
58+
}
59+
})
60+
.catch(err => {
61+
console.error('Something bad happened:', err.message);
62+
});
6263
```
6364

6465
## Supported Browsers

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": "3.5.2",
3+
"version": "3.5.3",
44
"contributors": [
55
{
66
"name": "David Sturley",

doc/API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ axe.run(context, options, (err, results) => {
268268
By default, `axe.run` will test the entire document. The context object is an optional parameter that can be used to specify which element should and which should not be tested. It can be passed one of the following:
269269

270270
1. An element reference that represents the portion of the document that must be analyzed
271-
- Example: To limit analysis to the `<div id="content">` element: `document.getElementById("content")`
271+
- Example: To limit analysis to the `<div id="content">` element: `document.getElementById("content")`
272272
1. A NodeList such as returned by `document.querySelectorAll`.
273273
1. A [CSS selector](./developer-guide.md#supported-css-selectors) that selects the portion(s) of the document that must be analyzed.
274274
1. An include-exclude object (see below)

doc/rule-descriptions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
| [image-alt](https://dequeuniversity.com/rules/axe/3.5/image-alt?application=RuleDescription) | Ensures &lt;img&gt; elements have alternate text or a role of none or presentation | Critical | cat.text-alternatives, wcag2a, wcag111, section508, section508.22.a | failure |
4545
| [input-button-name](https://dequeuniversity.com/rules/axe/3.5/input-button-name?application=RuleDescription) | Ensures input buttons have discernible text | Critical | cat.name-role-value, wcag2a, wcag412, section508, section508.22.a | failure |
4646
| [input-image-alt](https://dequeuniversity.com/rules/axe/3.5/input-image-alt?application=RuleDescription) | Ensures &lt;input type=&quot;image&quot;&gt; elements have alternate text | Critical | cat.text-alternatives, wcag2a, wcag111, section508, section508.22.a | failure |
47-
| [label](https://dequeuniversity.com/rules/axe/3.5/label?application=RuleDescription) | Ensures every form element has a label | Minor, Critical | cat.forms, wcag2a, wcag332, wcag131, section508, section508.22.n | failure |
47+
| [label](https://dequeuniversity.com/rules/axe/3.5/label?application=RuleDescription) | Ensures every form element has a label | Minor, Critical | cat.forms, wcag2a, wcag412, wcag131, section508, section508.22.n | failure |
4848
| [link-name](https://dequeuniversity.com/rules/axe/3.5/link-name?application=RuleDescription) | Ensures links have discernible text | Serious | cat.name-role-value, wcag2a, wcag412, wcag244, section508, section508.22.a | failure |
4949
| [list](https://dequeuniversity.com/rules/axe/3.5/list?application=RuleDescription) | Ensures that lists are structured correctly | Serious | cat.structure, wcag2a, wcag131 | failure |
5050
| [listitem](https://dequeuniversity.com/rules/axe/3.5/listitem?application=RuleDescription) | Ensures &lt;li&gt; elements are used semantically | Serious | cat.structure, wcag2a, wcag131 | failure |
@@ -55,7 +55,7 @@
5555
| [scrollable-region-focusable](https://dequeuniversity.com/rules/axe/3.5/scrollable-region-focusable?application=RuleDescription) | Elements that have scrollable content should be accessible by keyboard | Moderate | wcag2a, wcag211 | failure |
5656
| [server-side-image-map](https://dequeuniversity.com/rules/axe/3.5/server-side-image-map?application=RuleDescription) | Ensures that server-side image maps are not used | Minor | cat.text-alternatives, wcag2a, wcag211, section508, section508.22.f | needs&nbsp;review |
5757
| [svg-img-alt](https://dequeuniversity.com/rules/axe/3.5/svg-img-alt?application=RuleDescription) | Ensures svg elements with an img, graphics-document or graphics-symbol role have an accessible text | Serious | cat.text-alternatives, wcag2a, wcag111, section508, section508.22.a | failure |
58-
| [td-headers-attr](https://dequeuniversity.com/rules/axe/3.5/td-headers-attr?application=RuleDescription) | Ensure that each cell in a table using the headers refers to another cell in that table | Serious | cat.tables, wcag2a, wcag131, section508, section508.22.g | failure |
58+
| [td-headers-attr](https://dequeuniversity.com/rules/axe/3.5/td-headers-attr?application=RuleDescription) | Ensure that each cell in a table using the headers refers to another cell in that table | Serious | cat.tables, wcag2a, wcag131, section508, section508.22.g | failure, needs&nbsp;review |
5959
| [th-has-data-cells](https://dequeuniversity.com/rules/axe/3.5/th-has-data-cells?application=RuleDescription) | Ensure that each table header in a data table refers to data cells | Serious | cat.tables, wcag2a, wcag131, section508, section508.22.g | failure, needs&nbsp;review |
6060
| [valid-lang](https://dequeuniversity.com/rules/axe/3.5/valid-lang?application=RuleDescription) | Ensures lang attributes have valid values | Serious | cat.language, wcag2aa, wcag312 | failure |
6161
| [video-caption](https://dequeuniversity.com/rules/axe/3.5/video-caption?application=RuleDescription) | Ensures &lt;video&gt; elements have captions | Critical | cat.text-alternatives, wcag2a, wcag122, section508, section508.22.a | needs&nbsp;review |

lib/checks/keyboard/page-no-duplicate.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ axe._cache.set(key, true);
1515
let elms = axe.utils.querySelectorAllFilter(
1616
axe._tree[0],
1717
options.selector,
18-
elm => elm !== virtualNode && axe.commons.dom.isVisible(elm.actualNode)
18+
elm => axe.commons.dom.isVisible(elm.actualNode)
1919
);
2020

2121
// Filter elements that, within certain contexts, don't map their role.
@@ -29,6 +29,8 @@ if (typeof options.nativeScopeFilter === 'string') {
2929
});
3030
}
3131

32-
this.relatedNodes(elms.map(elm => elm.actualNode));
32+
this.relatedNodes(
33+
elms.filter(elm => elm !== virtualNode).map(elm => elm.actualNode)
34+
);
3335

34-
return elms.length === 0;
36+
return elms.length <= 1;

lib/checks/language/has-lang.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ const { isXHTML } = axe.utils;
33
const langValue = (node.getAttribute(`lang`) || '').trim();
44
const xmlLangValue = (node.getAttribute(`xml:lang`) || '').trim();
55

6-
if (!langValue && !isXHTML(document)) {
6+
if (!langValue && xmlLangValue && !isXHTML(document)) {
7+
this.data({
8+
messageKey: 'noXHTML'
9+
});
710
return false;
811
}
912

10-
return !!(langValue || xmlLangValue);
13+
if (!(langValue || xmlLangValue)) {
14+
this.data({
15+
messageKey: 'noLang'
16+
});
17+
return false;
18+
}
19+
20+
return true;

lib/checks/language/has-lang.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"impact": "serious",
66
"messages": {
77
"pass": "The <html> element has a lang attribute",
8-
"fail": "The <html> element does not have a lang attribute"
8+
"fail": {
9+
"noXHTML": "The xml:lang attribute is not valid on HTML pages, use the lang attribute.",
10+
"noLang": "The <html> element does not have a lang attribute"
11+
}
912
}
1013
}
1114
}

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

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
1-
options = options || {};
2-
var params,
3-
content = node.getAttribute('content') || '',
4-
parsedParams = content.split(/[;,]/),
5-
result = {},
6-
minimum = options.scaleMinimum || 2,
7-
lowerBound = options.lowerBound || false;
8-
9-
for (var i = 0, l = parsedParams.length; i < l; i++) {
10-
params = parsedParams[i].split('=');
11-
var key = params.shift().toLowerCase();
12-
if (key && params.length) {
13-
result[key.trim()] = params
14-
.shift()
15-
.trim()
16-
.toLowerCase();
17-
}
1+
const { scaleMinimum = 2, lowerBound = false } = options || {};
2+
3+
const content = node.getAttribute('content') || '';
4+
if (!content) {
5+
return true;
186
}
197

8+
const result = content.split(/[;,]/).reduce((out, item) => {
9+
const contentValue = item.trim();
10+
if (!contentValue) {
11+
return out;
12+
}
13+
14+
const [key, value] = contentValue.split('=');
15+
const curatedKey = key.toLowerCase().trim();
16+
let curatedValue = value.toLowerCase().trim();
17+
18+
// convert `yes` to `1`
19+
if (curatedKey === 'maximum-scale' && curatedValue === 'yes') {
20+
curatedValue = 1;
21+
}
22+
// when negative ignore key
23+
if (curatedKey === 'maximum-scale' && parseFloat(curatedValue) < 0) {
24+
return out;
25+
}
26+
27+
out[curatedKey] = curatedValue;
28+
return out;
29+
}, {});
30+
2031
if (
2132
lowerBound &&
2233
result['maximum-scale'] &&
@@ -30,7 +41,10 @@ if (!lowerBound && result['user-scalable'] === 'no') {
3041
return false;
3142
}
3243

33-
if (result['maximum-scale'] && parseFloat(result['maximum-scale']) < minimum) {
44+
if (
45+
result['maximum-scale'] &&
46+
parseFloat(result['maximum-scale']) < scaleMinimum
47+
) {
3448
this.data('maximum-scale');
3549
return false;
3650
}

lib/checks/navigation/header-present.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"metadata": {
55
"impact": "serious",
66
"messages": {
7-
"pass": "Page has a header",
8-
"fail": "Page does not have a header"
7+
"pass": "Page has a heading",
8+
"fail": "Page does not have a heading"
99
}
1010
}
1111
}

0 commit comments

Comments
 (0)