Socket
Socket
Sign inDemoInstall

axe-core

Package Overview
Dependencies
0
Maintainers
4
Versions
1334
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.4.2 to 2.5.0

appveyor.yml

2

axe.d.ts

@@ -1,2 +0,2 @@

// Type definitions for axe-core 2.4.0
// Type definitions for axe-core 2.5.0
// Project: https://github.com/dequelabs/axe-core

@@ -3,0 +3,0 @@ // Definitions by: Marcy Sutton <https://github.com/marcysutton>

{
"name": "axe-core",
"version": "2.4.2",
"version": "2.5.0",
"contributors": [

@@ -5,0 +5,0 @@ {

@@ -5,2 +5,20 @@ # Change Log

<a name="2.5.0"></a>
# [2.5.0](https://github.com/dequelabs/axe-core/compare/v2.4.2...v2.5.0) (2017-11-06)
### Bug Fixes
* **aria-errormessage:** adds support for aria-errormessage ([#517](https://github.com/dequelabs/axe-core/issues/517)) ([465d41d](https://github.com/dequelabs/axe-core/commit/465d41d))
* adjust aria-errormessage for the 2x branch ([19232e5](https://github.com/dequelabs/axe-core/commit/19232e5))
* Merge options.resultTypes ([7b28c22](https://github.com/dequelabs/axe-core/commit/7b28c22))
* Merge required-children.js fix into v2 ([86b4a0e](https://github.com/dequelabs/axe-core/commit/86b4a0e))
### Features
* **reporter:** return one result of each type instead of zero when resultTypes is used ([#606](https://github.com/dequelabs/axe-core/issues/606)) ([482374f](https://github.com/dequelabs/axe-core/commit/482374f)), closes [#605](https://github.com/dequelabs/axe-core/issues/605)
<a name="2.4.2"></a>

@@ -7,0 +25,0 @@ ## [2.4.2](https://github.com/dequelabs/axe-core/compare/v2.4.1...v2.4.2) (2017-09-25)

@@ -231,3 +231,3 @@ # aXe Javascript Accessibility API

* [`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.

@@ -331,3 +331,4 @@

| `rules` | n/a | Allow customizing a rule's properties (including { enable: false })
| `reporter` | `v1` | Which reporter to use (see [Configutration](#api-name-axeconfigure))
| `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

@@ -439,2 +440,13 @@ | `absolutePaths` | `false` | Use absolute paths when creating element selectors

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. The option will return 1 result of each type if that rule has at least one of that type of result instead of returning all of that type of result. The caller can use this information to inform the user of the existence of that type of result if appropriate.
```javascript
{
resultTypes: ['violations', 'incomplete', 'inapplicable']
}
```
This example will only process the specified result types: "violations", "incomplete", and "inapplicable". Notably, it will only process the first pass for each rule that has a pass. On a series of extremely large pages, this could improve performance considerably.
##### Callback Parameter

@@ -441,0 +453,0 @@

@@ -33,4 +33,4 @@ var requiredOwned = axe.commons.aria.requiredOwned,

function missingRequiredChildren(node, childRoles, all) {
//jshint maxstatements: 19
function missingRequiredChildren(node, childRoles, all, role) {
//jshint maxstatements: 22, maxcomplexity: 13
var i,

@@ -50,9 +50,18 @@ l = childRoles.length,

// 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);
}
}

@@ -77,3 +86,3 @@

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

@@ -80,0 +89,0 @@ if (!missing) { return true; }

@@ -9,9 +9,14 @@ options = Array.isArray(options) ? options : [];

var skipAttrs = ['aria-errormessage'];
for (var i = 0, l = attrs.length; i < l; i++) {
attr = attrs[i];
attrName = attr.name;
if (options.indexOf(attrName) === -1 && aria.test(attrName) &&
!axe.commons.aria.validateAttrValue(node, attrName)) {
// skip any attributes handled elsewhere
if (!skipAttrs.includes(attrName)) {
if (options.indexOf(attrName) === -1 && aria.test(attrName) &&
!axe.commons.aria.validateAttrValue(node, attrName)) {
invalid.push(attrName + '="' + attr.nodeValue + '"');
invalid.push(attrName + '="' + attr.nodeValue + '"');
}
}

@@ -18,0 +23,0 @@ }

@@ -51,2 +51,5 @@ var aria = commons.aria = {},

},
'aria-errormessage': {
type: 'idref'
},
'aria-expanded': {

@@ -53,0 +56,0 @@ type: 'nmtoken',

@@ -30,2 +30,26 @@ /*global helpers */

var resultKeys = axe.constants.resultGroups;
/**
* Configures the processing of axe results.
*
* @typedef ProcessOptions
* @property {Array} resultsTypes limit the types of results to process ('passes', 'violations', etc.)
* @property {Boolean} elementRef display node's element references
* @property {Boolean} selectors display node's selectors
* @property {Boolean} xpath display node's xpaths
*/
/**
* Aggregrate and process the aXe results,
* adding desired data to nodes and relatedNodes in each rule result.
*
* Prepares result data for reporters.
*
* @method processAggregate
* @memberof helpers
* @param {Array} results
* @param {ProcessOptions} options
* @return {Object}
*
*/
helpers.processAggregate = function (results, options) {

@@ -38,2 +62,10 @@ var resultObject = axe.utils.aggregateResult(results);

resultKeys.forEach(function (key) {
if (options.resultTypes && !options.resultTypes.includes(key)) {
// If the user asks us to, truncate certain finding types to maximum one finding
(resultObject[key] || []).forEach(function (ruleResult) {
if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) {
ruleResult.nodes = [ruleResult.nodes[0]];
}
});
}
resultObject[key] = (resultObject[key] || []).map(function (ruleResult) {

@@ -40,0 +72,0 @@ ruleResult = Object.assign({}, ruleResult);

@@ -8,2 +8,5 @@ /*global helpers */

}
// limit result processing to types we want to include in the output
options.resultTypes = ['violations'];
var out = helpers.processAggregate(results, options);

@@ -10,0 +13,0 @@

@@ -15,7 +15,8 @@ {

},
"all": [],
"any": [
"aria-valid-attr-value"
"all": [
"aria-valid-attr-value",
"aria-errormessage"
],
"any": [],
"none": []
}

@@ -14,3 +14,3 @@ {

"description": "Ensure that each table header in a data table refers to data cells",
"help": "All th element and elements with role=columnheader/rowheader must data cells which it describes"
"help": "All th elements and elements with role=columnheader/rowheader must have data cells they describe"
},

@@ -17,0 +17,0 @@ "all": [

{
"name": "axe-core",
"description": "Accessibility engine for automated Web UI testing",
"version": "2.4.2",
"version": "2.5.0",
"license": "MPL-2.0",

@@ -6,0 +6,0 @@ "engines": {

@@ -65,3 +65,7 @@ {

"axe.min.js": "sha256-uvfxOT2C0Y0fXlGDYDeDwYkBaZT3VgVMXEuSjG5TA14="
},
"2.5.0": {
"axe.js": "sha256-NYUXSdma9KjPfzmpt7jw/hlbmeAha8K3zEA2UOW+eWw=",
"axe.min.js": "sha256-7MV3BvKtgHeecwFjYOBYJbmOhvh2wdTGU7odxgpcrG0="
}
}

@@ -33,3 +33,3 @@ describe('aria-required-children', function () {

it('should detect multiple missing required children when all required', function () {
fixture.innerHTML = '<div role="combobox" id="target"><p>Nothing here.</p></div>';
fixture.innerHTML = '<div role="combobox" id="target" aria-expanded="true"><p>Nothing here.</p></div>';
var node = fixture.querySelector('#target');

@@ -41,3 +41,3 @@ assert.isFalse(checks['aria-required-children'].evaluate.call(checkContext, node));

it('should detect single missing required child when all required', function () {
fixture.innerHTML = '<div role="combobox" id="target"><p role="listbox">Nothing here.</p></div>';
fixture.innerHTML = '<div role="combobox" id="target" aria-expanded="true"><p role="listbox">Nothing here.</p></div>';
var node = fixture.querySelector('#target');

@@ -54,4 +54,4 @@ assert.isFalse(checks['aria-required-children'].evaluate.call(checkContext, node));

it('should pass a native input with role comboxbox when missing child is role textbox', function () {
fixture.innerHTML = '<input type="text" role="combobox" aria-owns="listbox" id="target"></div><p role="listbox" id="listbox">Nothing here.</p>';
it('should pass a native "text" type input with role comboxbox when missing child is role textbox', function () {
fixture.innerHTML = '<input type="text" role="combobox" aria-owns="listbox" id="target"><p role="listbox" id="listbox">Nothing here.</p>';
var node = fixture.querySelector('#target');

@@ -61,2 +61,32 @@ assert.isTrue(checks['aria-required-children'].evaluate.call(checkContext, node));

it('should pass a native "search" type input with role comboxbox when missing child is role textbox', function () {
fixture.innerHTML = '<input type="search" role="combobox" aria-owns="listbox1" id="target"><p role="listbox" id="listbox1">Nothing here.</p>';
var node = fixture.querySelector('#target');
assert.isTrue(checks['aria-required-children'].evaluate.call(checkContext, node));
});
it('should pass a native "email" type input with role comboxbox when missing child is role textbox', function () {
fixture.innerHTML = '<input type="email" role="combobox" aria-owns="listbox" id="target"><p role="listbox" id="listbox">Nothing here.</p>';
var node = fixture.querySelector('#target');
assert.isTrue(checks['aria-required-children'].evaluate.call(checkContext, node));
});
it('should pass a native "url" type input with role comboxbox when missing child is role textbox', function () {
fixture.innerHTML = '<input type="url" role="combobox" aria-owns="listbox" id="target"><p role="listbox" id="listbox">Nothing here.</p>';
var node = fixture.querySelector('#target');
assert.isTrue(checks['aria-required-children'].evaluate.call(checkContext, node));
});
it('should pass a native "tel" type input with role comboxbox when missing child is role textbox', function () {
fixture.innerHTML = '<input type="tel" role="combobox" aria-owns="listbox" id="target"><p role="listbox" id="listbox">Nothing here.</p>';
var node = fixture.querySelector('#target');
assert.isTrue(checks['aria-required-children'].evaluate.call(checkContext, node));
});
it('should pass a collapsed comboxbox when missing child is role listbox', function () {
fixture.innerHTML = '<div role="combobox" id="target"><p role="textbox">Textbox</p></div>';
var node = fixture.querySelector('#target');
assert.isTrue(checks['aria-required-children'].evaluate.call(checkContext, node));
});
it('should pass one indirectly aria-owned child when one required', function () {

@@ -63,0 +93,0 @@ fixture.innerHTML = '<div role="grid" id="target" aria-owns="r"></div><div id="r"><div role="row">Nothing here.</div></div>';

@@ -14,4 +14,4 @@ {

["#pass57"], ["#pass58"], ["#pass59"], ["#pass60"], ["#pass61"], ["#pass62"], ["#pass63"],
["#pass64"], ["#pass65"], ["#pass66"], ["#pass67"], ["#pass68"]
["#pass64"], ["#pass65"], ["#pass66"], ["#pass67"], ["#pass68"]
]
}
}

@@ -10,3 +10,3 @@ {

["#violation24"], ["#violation25"], ["#violation26"], ["#violation27"], ["#violation28"], ["#violation29"],
["#violation30"], ["#violation31"], ["#violation32"], ["#violation33"], ["#violation34"]
["#violation30"], ["#violation31"], ["#violation32"], ["#violation33"], ["#violation34"],["#violation35"]
],

@@ -35,4 +35,5 @@ "passes": [

["#pass154"], ["#pass155"], ["#pass156"], ["#pass157"], ["#pass158"], ["#pass159"], ["#pass160"],
["#pass161"], ["#pass162"], ["#pass163"], ["#pass164"], ["#pass165"], ["#pass166"], ["#pass167"]
["#pass161"], ["#pass162"], ["#pass163"], ["#pass164"], ["#pass165"], ["#pass166"], ["#pass167"],
["#pass168"], ["#pass169"], ["#pass170"]
]
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc