Skip to content

Commit

Permalink
chore: Merge v3.0.0-alpha.8
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoFiers committed Oct 20, 2017
2 parents c6963cd + 6b81a50 commit 009fb35
Show file tree
Hide file tree
Showing 79 changed files with 1,098 additions and 214 deletions.
117 changes: 115 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
# Change Log
<a name="3.0.0-alpha.8"></a>
# [3.0.0-alpha.8](https://github.com/dequelabs/axe-core/compare/v3.0.0-alpha.6...v3.0.0-alpha.8) (2017-10-20)


### Bug Fixes

* **aria-allowed-attr:** align rowcount, colcount, and colindex with 1.1 spec ([#555](https://github.com/dequelabs/axe-core/issues/555)) ([10efa88](https://github.com/dequelabs/axe-core/commit/10efa88))
* **required-children:** add combobox > listbox exception ([#559](https://github.com/dequelabs/axe-core/issues/559)) ([8d0991f](https://github.com/dequelabs/axe-core/commit/8d0991f))
* Added message about expected contrast ratio ([#381](https://github.com/dequelabs/axe-core/issues/381)) ([#562](https://github.com/dequelabs/axe-core/issues/562)) ([9e30d64](https://github.com/dequelabs/axe-core/commit/9e30d64))


### Performance Improvements

* **reporter:** add option to limit result types to be processed ([#568](https://github.com/dequelabs/axe-core/issues/568)) ([42b46d9](https://github.com/dequelabs/axe-core/commit/42b46d9)), closes [#512](https://github.com/dequelabs/axe-core/issues/512)


<a name="3.0.0-alpha.6"></a>
# [3.0.0-alpha.6](https://github.com/dequelabs/axe-core/compare/v3.0.0-alpha.3...v3.0.0-alpha.6) (2017-09-27)


### Bug Fixes

* **aria:** adding support for aria-expanded in menuitem ([#521](https://github.com/dequelabs/axe-core/issues/521)) ([b30b451](https://github.com/dequelabs/axe-core/commit/b30b451))
* **color-contrast:** Include `THEAD` and `TBODY` in contrast checks ([#514](https://github.com/dequelabs/axe-core/issues/514)) ([f98f8bd](https://github.com/dequelabs/axe-core/commit/f98f8bd))
* Match prerelease versions for helpUrl ([#546](https://github.com/dequelabs/axe-core/issues/546)) ([5300577](https://github.com/dequelabs/axe-core/commit/5300577))
* **helpUrl:** Properly parse x.0 versions ([#550](https://github.com/dequelabs/axe-core/issues/550)) ([a51c5ce](https://github.com/dequelabs/axe-core/commit/a51c5ce))
* **postinstall:** use node, more conditionals ([#520](https://github.com/dequelabs/axe-core/issues/520)) ([f5b5299](https://github.com/dequelabs/axe-core/commit/f5b5299))
* **responsible:** Restrict error construction to known errors ([0128a7e](https://github.com/dequelabs/axe-core/commit/0128a7e))


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.

<a name="3.0.0-alpha.5"></a>
# [3.0.0-alpha.5](https://github.com/dequelabs/axe-core/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2017-09-25)
Expand Down Expand Up @@ -121,6 +148,92 @@ All notable changes to this project will be documented in this file. See [standa
* **link-in-text-block:** Add shadow DOM support ([46a2cca](https://github.com/dequelabs/axe-core/commit/46a2cca))
* **shadow DOM:** Create commons virtual methods, for backward compatibility ([86a4c25](https://github.com/dequelabs/axe-core/commit/86a4c25))


<a name="2.4.2"></a>
## [2.4.2](https://github.com/dequelabs/axe-core/compare/v2.4.1...v2.4.2) (2017-09-25)

### Bug Fixes

* **aria:** adding support for aria-expanded in menuitem ([#521](https://github.com/dequelabs/axe-core/issues/521)) ([b4c42fe](https://github.com/dequelabs/axe-core/commit/b4c42fe))
* Match prerelease versions for helpUrl ([#546](https://github.com/dequelabs/axe-core/issues/546)) ([c166708](https://github.com/dequelabs/axe-core/commit/c166708))
* fix(node4): use var to declare variables ([#541](https://github.com/dequelabs/axe-core/issues/541)) ([c72badb](https://github.com/dequelabs/axe-core/commit/c72badbd55ef0b56b97f0c64a4eb544e31b4b3f1))


<a name="2.4.1"></a>
## [2.4.1](https://github.com/dequelabs/axe-core/compare/v2.4.0...v2.4.1) (2017-09-12)

### Bug Fixes

* fix(postinstall): use node, more conditionals ([#520](https://github.com/dequelabs/axe-core/issues/520)) ([98fac8a](https://github.com/dequelabs/axe-core/commit/98fac8a))


<a name="2.4.0"></a>
## [2.4.0](https://github.com/dequelabs/axe-core/compare/v2.3.1-alpha.2...v2.4.0) (2017-09-08)

### Bug fixes:

* fix(color-contrast): Include `THEAD` and `TBODY` in contrast checks (#514) ([f98f8bd](https://github.com/dequelabs/axe-core/commit/f98f8bdacc551579c259aefd88bef41ed8157b68))
* fix(responsible): Restrict error construction to known errors (#513) ([0128a7e](https://github.com/dequelabs/axe-core/commit/0128a7ea47847b9fa04dbf98327f4bc1760c5e11))

### Features:

* docs: Document how to propose axe-core rules (#507) ([cabd329](https://github.com/dequelabs/axe-core/commit/cabd3297afbbfe9dbcc41a168b5529ba52f408ba))


<a name="2.4.0-alpha.2"></a>
## [2.4.0-alpha.2](https://github.com/dequelabs/axe-core/compare/v2.4.0-alpha.1...v2.4.0-alpha.2) (2017-09-06)

### Bug fixes:

* test(aria): aria-haspopup, aria-modal for 1.1
* style(test/aria): add line breaks for readability
* test(aria): add missing roles and properties
* fix: RestoreScroll was running out of sync (#508)

### Features:

* feat(ARIA 1.1): Allow row-index, setsize and posinset on more roles


<a name="2.4.0-alpha.1"></a>
## [2.4.0-alpha.1](https://github.com/dequelabs/axe-core/compare/v2.3.0...v2.4.0-alpha.1) (2017-08-31)

### Bug fixes:

* chore: add help text for testconfig Grunt task
* fix: Properly output error stack
* doc: Add 'on mobile' to viewport rule
* fix: Ensure all tests pass in Chrome
* fix: Minimise scrolling in getBackgroundColor
* chore: Minor build chores for whitespace and lockfile
* fix: Align impact levels with Deque Way
* fix: Set relatedNodes on color/link-in-block rules
* fix: incomplete results should have impact
* fix(aria): Allow implicit attribute values
* chore: ignore growl in retire
* fix: Use getAttribute(id) over .id
* fix: Exclude `any` checks from output if one passed
* fix(aria): Treegrid should own rows, not treeitems
* fix(aria): add exception for native input combobox missing textbox. Fixes #160
* test: fix aria/required-children for jshint
* feat: allow link text from single-cell layout table
* fix: expand tr support for color contrast
* chore: ignore node_modules in examples when linting

### Features:

* feat: Add option `restoreScroll`
* doc: add more info on testing hidden regions
* feat: add S.C. 2.4.4 to link-name rule. Fixes #369
* feat: Add Japanese localisation
* doc: Add instructions on debugging on CircleCI
* test: add unit tests for button-has-visible-text
* chore: add descriptions to Grunt tasks
* feat(aria): Support progressive ARIA 1.1 attributes / roles
* feat: Add new ARIA 1.1 values for haspopup
* feat: Add aria-orientation to additional roles


<a name="2.3.1"></a>
## [2.3.1](https://github.com/dequelabs/axe-core/compare/v2.3.0...v2.3.1) (2017-06-15)

Expand Down
21 changes: 21 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Test against the latest version of this Node.js version
environment:
nodejs_version: "6"

# Install scripts. (runs after repo cloning)
install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
# install modules
- npm install

# Post-install test scripts.
test_script:
# Output useful info for debugging.
- node --version
- npm --version
# run tests
- npm test

# Don't actually build.
build: off
2 changes: 1 addition & 1 deletion axe.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for axe-core 3.0.0
// Type definitions for axe-core 3.0.0-alpha.8
// Project: https://github.com/dequelabs/axe-core
// Definitions by: Marcy Sutton <https://github.com/marcysutton>

Expand Down
6 changes: 5 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "axe-core",
<<<<<<< HEAD
"version": "3.0.0-alpha.5",
=======
"version": "3.0.0-alpha.8",
>>>>>>> develop
"contributors": [
{
"name": "David Sturley",
Expand Down Expand Up @@ -43,4 +47,4 @@
"typings"
],
"devDependencies": {}
}
}
13 changes: 12 additions & 1 deletion doc/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ axe.run(context, options, callback);
#### Parameters axe.run

* [`context`](#context-parameter): (optional) Defines the scope of the analysis - the part of the DOM that you would like to analyze. This will typically be the `document` or a specific selector such as class name, ID, selector, etc.
* [`options`](#options-parameter): (optional) Set of options passed into rules or checks, temporarily modifying them. This contrasts with `axe.configure`, which is more permanent. [See below for more information](#axerun-parameters)
* [`options`](#options-parameter): (optional) Set of options passed into rules or checks, temporarily modifying them. This contrasts with `axe.configure`, which is more permanent.
* [`callback`](#callback-parameter): (optional) The callback function which receives either null or an [error result](#error-result) as the first parameter, and the [results object](#results-object) when analysis is completed successfully, or undefined if it did not.

##### Context Parameter
Expand Down Expand Up @@ -331,6 +331,7 @@ Additionally, there are a number or properties that allow configuration of diffe
| `runOnly` | n/a | Limit which rules are executed, based on names or tags
| `rules` | n/a | Allow customizing a rule's properties (including { enable: false })
| `reporter` | `v1` | Which reporter to use (see [Configuration](#api-name-axeconfigure))
| `resultTypes` | n/a | Limit which result types are processed and aggregated
| `xpath` | `false` | Return xpath selectors for elements
| `absolutePaths` | `false` | Use absolute paths when creating element selectors
| `iframes` | `true` | Tell axe to run inside iframes
Expand Down Expand Up @@ -437,6 +438,16 @@ Additionally, there are a number or properties that allow configuration of diffe

This example first includes all `wcag2a` and `wcag2aa` rules. All rules that are tagged as `experimental` are than removed from the list of rules to run.

6. Only process certain types of results

The `resultTypes` option can be used to limit the result types that aXe will process, aggregate, and send to the reporter. This can be useful for improving performance on very large or complicated pages when you are only interested in certain types of results.
```javascript
{
resultTypes: ['violations', 'incomplete', 'inapplicable']
}
```
This example will only process the specified result types: "violations", "incomplete", and "inapplicable". Notably, it will not process "passes". On a series of extremely large pages, this could improve performance considerably.

##### Callback Parameter

The callback parameter is a function that will be called when the asynchronous `axe.run` function completes. The callback function is passed two parameters. The first parameter will be an error thrown inside of aXe if axe.run could not complete. If axe completed correctly the first parameter will be null, and the second parameter will be the results object.
Expand Down
1 change: 1 addition & 0 deletions doc/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ Add your project/integration to this file and submit a pull request.
1. [aXe Reports](https://github.com/louis-reed/axe-reports)
1. [aXe-TestCafe](https://github.com/helen-dikareva/axe-testcafe)
1. [Web Audit University of Nebraska-Lincoln](https://webaudit.unl.edu/)
1. [Ace, by DAISY](https://daisy.github.io/ace)
23 changes: 16 additions & 7 deletions lib/checks/aria/required-children.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ function ariaOwns(nodes, role) {
return false;
}

function missingRequiredChildren(node, childRoles, all) {
//jshint maxstatements: 19
function missingRequiredChildren(node, childRoles, all, role) {
//jshint maxstatements: 22, maxcomplexity: 13
var i,
l = childRoles.length,
missing = [],
Expand All @@ -46,13 +46,22 @@ function missingRequiredChildren(node, childRoles, all) {
}
}

// combobox > textbox exception:
// remove textbox from missing roles if node is a native input
if (node.tagName === 'INPUT' && node.type === 'text') {
// combobox exceptions
if (role === 'combobox') {

// remove 'textbox' from missing roles if combobox is a native text-type input
var textboxIndex = missing.indexOf('textbox');
if (textboxIndex >= 0) {
var textTypeInputs = ['text', 'search', 'email', 'url', 'tel'];
if (textboxIndex >= 0 && node.tagName === 'INPUT' && textTypeInputs.includes(node.type)) {
missing.splice(textboxIndex, 1);
}

// remove 'listbox' from missing roles if combobox is collapsed
var listboxIndex = missing.indexOf('listbox');
var expanded = node.getAttribute('aria-expanded');
if (listboxIndex >= 0 && (!expanded || expanded === 'false')) {
missing.splice(listboxIndex, 1);
}
}

if (missing.length) { return missing; }
Expand All @@ -72,7 +81,7 @@ if (!childRoles) {
childRoles = required.all;
}

var missing = missingRequiredChildren(node, childRoles, all);
var missing = missingRequiredChildren(node, childRoles, all, role);

if (!missing) { return true; }

Expand Down
3 changes: 2 additions & 1 deletion lib/checks/color/color-contrast.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ var data = {
contrastRatio: cr ? truncatedResult : undefined,
fontSize: (fontSize * 72 / 96).toFixed(1) + 'pt',
fontWeight: bold ? 'bold' : 'normal',
missingData: missing
missingData: missing,
expectedContrastRatio: cr.expectedContrastRatio + ':1'
};

this.data(data);
Expand Down
2 changes: 1 addition & 1 deletion lib/checks/color/color-contrast.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"impact": "serious",
"messages": {
"pass": "Element has sufficient color contrast of {{=it.data.contrastRatio}}",
"fail": "Element has insufficient color contrast of {{=it.data.contrastRatio}} (foreground color: {{=it.data.fgColor}}, background color: {{=it.data.bgColor}}, font size: {{=it.data.fontSize}}, font weight: {{=it.data.fontWeight}})",
"fail": "Element has insufficient color contrast of {{=it.data.contrastRatio}} (foreground color: {{=it.data.fgColor}}, background color: {{=it.data.bgColor}}, font size: {{=it.data.fontSize}}, font weight: {{=it.data.fontWeight}}). Expected contrast ratio of {{=it.data.expectedContrastRatio}}",
"incomplete": {
"bgImage": "Element's background color could not be determined due to a background image",
"bgGradient": "Element's background color could not be determined due to a background gradient",
Expand Down
14 changes: 13 additions & 1 deletion lib/commons/aria/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

/**
* Get required attributes for a given role
* @method requiredAttr
* @memberof axe.commons.aria
* @instance
* @param {String} role The role to check
* @return {Array}
*/
Expand All @@ -14,6 +17,9 @@ aria.requiredAttr = function (role) {

/**
* Get allowed attributes for a given role
* @method allowedAttr
* @memberof axe.commons.aria
* @instance
* @param {String} role The role to check
* @return {Array}
*/
Expand All @@ -28,6 +34,9 @@ aria.allowedAttr = function (role) {

/**
* Check if an aria- attribute name is valid
* @method validateAttr
* @memberof axe.commons.aria
* @instance
* @param {String} att The attribute name
* @return {Boolean}
*/
Expand All @@ -38,6 +47,9 @@ aria.validateAttr = function (att) {

/**
* Validate the value of an ARIA attribute
* @method validateAttrValue
* @memberof axe.commons.aria
* @instance
* @param {HTMLElement} node The element to check
* @param {String} attr The name of the attribute
* @return {Boolean}
Expand All @@ -60,7 +72,7 @@ aria.validateAttrValue = function (node, attr) {
case 'nmtoken':
return (typeof value === 'string' && attrInfo.values.indexOf(value.toLowerCase()) !== -1);

case 'nmtokens':
case 'nmtokens':
list = axe.utils.tokenList(value);
// Check if any value isn't in the list of values
return list.reduce(function (result, token) {
Expand Down
20 changes: 14 additions & 6 deletions lib/commons/aria/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Namespace for aria-related utilities.
* @namespace commons.aria
* @memberof axe
*/

var aria = commons.aria = {},
lookupTables = aria._lut = {};

Expand Down Expand Up @@ -250,7 +256,7 @@ lookupTables.role = {
'columnheader': {
type: 'structure',
attributes: {
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan',
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan',
'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort']
},
owned: null,
Expand Down Expand Up @@ -341,7 +347,7 @@ lookupTables.role = {
attributes: {
allowed: ['aria-expanded']
},
owned: {
owned: {
one: ['article']
},
nameFrom: ['author'],
Expand All @@ -360,7 +366,8 @@ lookupTables.role = {
'grid': {
type: 'composite',
attributes: {
allowed: ['aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-activedescendant', 'aria-expanded']
allowed: ['aria-activedescendant', 'aria-expanded', 'aria-colcount', 'aria-level',
'aria-multiselectable', 'aria-readonly', 'aria-rowcount']
},
owned: {
one: ['rowgroup', 'row']
Expand All @@ -372,7 +379,7 @@ lookupTables.role = {
'gridcell': {
type: 'widget',
attributes: {
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex',
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex',
'aria-rowspan', 'aria-selected', 'aria-readonly', 'aria-required']
},
owned: null,
Expand Down Expand Up @@ -645,7 +652,8 @@ lookupTables.role = {
'row': {
type: 'structure',
attributes: {
allowed: ['aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowcount', 'aria-rowindex']
allowed: ['aria-activedescendant', 'aria-colindex', 'aria-expanded',
'aria-level', 'aria-selected', 'aria-rowindex']
},
owned: {
one: ['cell', 'columnheader', 'rowheader', 'gridcell']
Expand All @@ -669,7 +677,7 @@ lookupTables.role = {
'rowheader': {
type: 'structure',
attributes: {
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan',
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan',
'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort']
},
owned: null,
Expand Down
Loading

0 comments on commit 009fb35

Please sign in to comment.