Skip to content

Commit

Permalink
Merge pull request dequelabs#2083 from dequelabs/release-3.5.2
Browse files Browse the repository at this point in the history
chore: Release 3.5.2
  • Loading branch information
WilcoFiers committed Mar 9, 2020
2 parents 2771425 + 6aaae7f commit 15ff7eb
Show file tree
Hide file tree
Showing 51 changed files with 1,160 additions and 259 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

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.

### [3.5.2](https://github.com/dequelabs/axe-core/compare/v3.5.1...v3.5.2) (2020-03-06)

### Bug Fixes

- **aria-allowed-role:** allow role=spinbutton on input[type=tel](<[635445b](https://github.com/dequelabs/axe-core/commit/635445ba6da7bc197bcdee6fb1a9d9dc81e43941)>)
- **color-contrast:** ignore form elements that move text outside of node using text-indent ([#2044](https://github.com/dequelabs/axe-core/issues/2044)) ([85cc6ab](https://github.com/dequelabs/axe-core/commit/85cc6abd7f919a7311c6da01a41853cbfd539508))
- **commons:** handle node(s) contained by SVG document when de… ([#2054](https://github.com/dequelabs/axe-core/issues/2054)) ([bf4c9bf](https://github.com/dequelabs/axe-core/commit/bf4c9bff2953b1ac7f40dbb1d0bd1986c1caa673))
- **getCheckMessage:** add API to return check message ([#2066](https://github.com/dequelabs/axe-core/issues/2066)) ([e216322](https://github.com/dequelabs/axe-core/commit/e216322183c8b064ebfd748fea785b8c2fe78b16))
- **has-lang:** fail check when `xml:lang` is used in HTML docum… ([#2053](https://github.com/dequelabs/axe-core/issues/2053)) ([e07aaea](https://github.com/dequelabs/axe-core/commit/e07aaea86bc9460a2d9f568637b4a77d33094ed6))
- **label-content-name-mismatch:** ignore non `widget` aria role(s) & do not use deprecated `lookupTable.rolesOfType` ([#2022](https://github.com/dequelabs/axe-core/issues/2022)) ([89bd84c](https://github.com/dequelabs/axe-core/commit/89bd84c4a9846dc31a660eda6b274329e7ac70b5))
- **package-lock:** change @deque/doT from agora to npm ([#2058](https://github.com/dequelabs/axe-core/issues/2058)) ([c03c0e5](https://github.com/dequelabs/axe-core/commit/c03c0e5ffc3ea1b49607355fa9d6f2e2faf0ebd1))
- **page-has-heading-one:** find screen-reader only headings ([#2065](https://github.com/dequelabs/axe-core/issues/2065)) ([f808a12](https://github.com/dequelabs/axe-core/commit/f808a12261269719534ae52c878d1700fb70053e))
- **region:** ignore direct child text nodes of body ([#2050](https://github.com/dequelabs/axe-core/issues/2050)) ([fde31d0](https://github.com/dequelabs/axe-core/commit/fde31d03d24820f681b257c4c42b98f25b2877ec))
- **skip-link:** identify as skip-link only if the link is offscreen ([#2079](https://github.com/dequelabs/axe-core/issues/2079)) ([241e1d0](https://github.com/dequelabs/axe-core/commit/241e1d0715398a39c2e502ddb781f5fc29987dde))
- check `invaildrole` fails only when all roles are invalid ([#2075](https://github.com/dequelabs/axe-core/issues/2075)) ([989b317](https://github.com/dequelabs/axe-core/commit/989b31788b08b6514dd4b606162193d4dd168be9))
- ignore empty, whitespace or undefined `role` for rule `ari… ([#2077](https://github.com/dequelabs/axe-core/issues/2077)) ([dbd3c02](https://github.com/dequelabs/axe-core/commit/dbd3c0211b05641f366dfe2fe9c2124cad9e5e3a))
- update tags for rule `area-alt` ([#2051](https://github.com/dequelabs/axe-core/issues/2051)) ([7db231f](https://github.com/dequelabs/axe-core/commit/7db231f2ff2b70a4e8e6f7aababe0871764ece96))

### [3.5.1](https://github.com/dequelabs/axe-core/compare/v3.5.0...v3.5.1) (2020-02-12)

### Bug Fixes
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ Now include the javascript file in each of your iframes in your fixtures or test
Now insert calls at each point in your tests where a new piece of UI becomes visible or exposed:

```js
axe.run(function (err, results) {
if (err) throw err;
ok(results.violations.length === 0, 'Should be no accessibility issues');
// complete the async call
...
});
axe.run()
.then(results => {
if (results.violations.length) {
throw new Error('Accessibility issues found')
}
})
.catch(err => {
console.error('Something bad happened:', err.message)
})
```

## Supported Browsers
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": "3.5.1",
"version": "3.5.2",
"contributors": [
{
"name": "David Sturley",
Expand Down
116 changes: 101 additions & 15 deletions build/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ var dot = require('@deque/dot');
var templates = require('./templates');
var buildManual = require('./build-manual');
var entities = new (require('html-entities').AllHtmlEntities)();
var packageJSON = require('../package.json');
var dotRegex = /\{\{.+?\}\}/g;

var descriptionHeaders =
'| Rule ID | Description | Impact | Tags | Enabled by default | Failures | Needs Review |\n| :------- | :------- | :------- | :------- | :------- | :------- | :------- |\n';
var axeVersion = packageJSON.version.substring(
0,
packageJSON.version.lastIndexOf('.')
);

var descriptionTableHeader =
'| Rule ID | Description | Impact | Tags | Issue Type |\n| :------- | :------- | :------- | :------- | :------- |\n';

dot.templateSettings.strip = false;

Expand All @@ -25,6 +31,13 @@ function getLocale(grunt, options) {
}
}

function makeHeaderLink(title) {
return title
.replace(/ /g, '-')
.replace(/[\.&]/g, '')
.toLowerCase();
}

function buildRules(grunt, options, commons, callback) {
var axeImpact = Object.freeze(['minor', 'moderate', 'serious', 'critical']); // TODO: require('../axe') does not work if grunt configure is moved after uglify, npm test breaks with undefined. Complicated grunt concurrency issue.
var locale = getLocale(grunt, options);
Expand All @@ -34,7 +47,43 @@ function buildRules(grunt, options, commons, callback) {
rules: {},
checks: {}
};
var descriptions = [];
var descriptions = {
wcag20: {
title: 'WCAG 2.0 Level A & AA Rules',
rules: []
},
wcag21: {
title: 'WCAG 2.1 Level A & AA Rules',
rules: []
},
bestPractice: {
title: 'Best Practices Rules',
intro:
'Rules that do not necessarily conform to WCAG success criterion but are industry accepted practices that improve the user experience.',
rules: []
},
experimental: {
title: 'Experimental Rules',
intro:
'Rules we are still testing and developing. They are not enabled by default in axe-core, but are enabled for the axe browser extensions.',
rules: []
},
deprecated: {
title: 'Deprecated Rules',
intro:
'Deprecated rules are not enabled by default and will be removed in the next major release.',
rules: []
}
};

var TOC = Object.keys(descriptions)
.map(key => {
return `- [${descriptions[key].title}](#${makeHeaderLink(
descriptions[key].title
)})`;
})
.join('\n');

var tags = options.tags ? options.tags.split(/\s*,\s*/) : [];
var rules = result.rules;
var checks = result.checks;
Expand Down Expand Up @@ -258,14 +307,33 @@ function buildRules(grunt, options, commons, callback) {
metadata.rules[rule.id] = parseMetaData(rule, 'rules'); // Translate rules
}

descriptions.push([
rule.id,
var rules;
if (rule.tags.includes('deprecated')) {
rules = descriptions.deprecated.rules;
} else if (rule.tags.includes('experimental')) {
rules = descriptions.experimental.rules;
} else if (rule.tags.includes('best-practice')) {
rules = descriptions.bestPractice.rules;
} else if (rule.tags.find(tag => tag.startsWith('wcag2a'))) {
rules = descriptions.wcag20.rules;
} else {
rules = descriptions.wcag21.rules;
}

var issueType = [];
if (canFail) {
issueType.push('failure');
}
if (canIncomplete) {
issueType.push('needs&nbsp;review');
}

rules.push([
`[${rule.id}](https://dequeuniversity.com/rules/axe/${axeVersion}/${rule.id}?application=RuleDescription)`,
entities.encode(rule.metadata.description),
impact,
rule.tags.join(', '),
rule.enabled === false ? false : true,
canFail,
canIncomplete
issueType.join(', ')
]);
if (tags.length) {
rule.enabled = !!rule.tags.filter(function(t) {
Expand All @@ -275,6 +343,30 @@ function buildRules(grunt, options, commons, callback) {
return rule;
});

var ruleTables = Object.keys(descriptions)
.map(key => {
var description = descriptions[key];

return `
## ${description.title}
${description.intro ? description.intro : ''}
${descriptionTableHeader}${description.rules
.map(function(row) {
return '| ' + row.join(' | ') + ' |';
})
.join('\n')}`;
})
.join('\n\n');

var descriptions = `
# Rule Descriptions
## Table of Contents
${TOC}
${ruleTables}`;

// Translate failureSummaries
metadata.failureSummaries = createFailureSummaryObject(result.misc);
metadata.incompleteFallbackMessage = getIncompleteMsg(result.misc);
Expand Down Expand Up @@ -303,13 +395,7 @@ function buildRules(grunt, options, commons, callback) {
blacklist
)
),
descriptions:
descriptionHeaders +
descriptions
.map(function(row) {
return '| ' + row.join(' | ') + ' |';
})
.join('\n')
descriptions
});
});
}
Expand Down
11 changes: 4 additions & 7 deletions doc/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,10 @@ axe.run(context, options, (err, results) => {
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:

1. An element reference that represents the portion of the document that must be analyzed

- Example: To limit analysis to the `<div id="content">` element: `document.getElementById("content")`

2. A NodeList such as returned by `document.querySelectorAll`.
3. A [CSS selector](./developer-guide.md#supported-css-selectors) that selects the portion(s) of the document that must be analyzed.

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

###### Include-Exclude Object

Expand Down
3 changes: 2 additions & 1 deletion doc/backwards-compatibility-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In a minor release, we may change the implementation of Public Utils to fix bugs

We will not add or remove rules in a patch release. We will not add support for new technologies in a patch release. We will endeavour to return the exact same results across patch releases with the exception of changes that are due to bug fixes. This means that the likelihood of a patch release finding issues on a page that was clean in a previous release is very close to zero but not zero.

In a minor release, we may add support for new technologies in the Public Utils or in existing rules and we may add or disable rules. We may also change an experimental rule to become a standard rule (essentially equivalent to adding rule). This means that pages that did not return violations in a particular minor release may return violations in a subsequent release.
In a minor release, we may add support for new technologies in the Public Utils or in existing rules and we may add or disable rules. We may also change an experimental rule to become a standard rule (essentially equivalent to adding rule). This means that pages that did not return violations in a particular minor release may return violations in a subsequent release. Rule tags, including the "wcag\*" tags, and whether or not something is reported as best-practice can be changed in minor releases.

If the HTML page is unchanged, calls to the analysis function(s) when compared across minor or patch releases will return the same exact selector for the nodes in any of the result arrays. If the HTML page has changed, it is possible for the selector to be different but it is not guaranteed that the selector will be different.

Expand All @@ -48,6 +48,7 @@ Major releases may remove rules.
| **Rules** | | | |
| Add rules | May add | May add | Will not add |
| Disable or remove rules | May remove (will remove previously deprecated rules) | May disable or remove | Will not disable or remove |
| Rule tags | May add or remove | May add or remove | Will not change |
| Deprecate rules | May deprecate | May deprecate | Will not deprecate |

\*_New OSes, Browsers, ATs, new standards (e.g. introduction of ARIA), new versions of standards (e.g. WCAG 2.1)_
Expand Down
Loading

0 comments on commit 15ff7eb

Please sign in to comment.