Skip to content

Commit 9ba9d05

Browse files
authored
chore(release): 4.8.4 (#4328)
2 parents d3c8b4b + b8839aa commit 9ba9d05

File tree

14 files changed

+212
-44
lines changed

14 files changed

+212
-44
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
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+
### [4.8.4](https://github.com/dequelabs/axe-core/compare/v4.8.3...v4.8.4) (2024-02-07)
6+
7+
### Bug Fixes
8+
9+
- Add LICENSE-3RD-PARTY.txt file ([#4304](https://github.com/dequelabs/axe-core/issues/4304)) ([139c553](https://github.com/dequelabs/axe-core/commit/139c5535c72e926f03bb37a9ba0b7fd6b97cba8c))
10+
- avoid reading element-specific node properties of non-element node types ([#4317](https://github.com/dequelabs/axe-core/issues/4317)) ([a2a6935](https://github.com/dequelabs/axe-core/commit/a2a69355ea5aafce14367cf967153f7958a8878c)), closes [#4316](https://github.com/dequelabs/axe-core/issues/4316) [#4316](https://github.com/dequelabs/axe-core/issues/4316)
11+
- **d.ts:** RawNodesResult issues ([#4229](https://github.com/dequelabs/axe-core/issues/4229)) ([f105266](https://github.com/dequelabs/axe-core/commit/f1052662b3b8b57d520fcbd23a3e9d4a5660a7e1))
12+
- **d.ts:** RunOptions.reporter can be any string ([#4218](https://github.com/dequelabs/axe-core/issues/4218)) ([80de793](https://github.com/dequelabs/axe-core/commit/80de793362bbbffde85654e874942a26df0108a8))
13+
- **utils/get-selector:** ignore 'xmlns' attribute when generating a selector ([#4303](https://github.com/dequelabs/axe-core/issues/4303)) ([8c68546](https://github.com/dequelabs/axe-core/commit/8c6854661f4613d0b7a6ba98bbfdc0c9ca61b4d1))
14+
515
### [4.8.3](https://github.com/dequelabs/axe-core/compare/v4.8.2...v4.8.3) (2023-12-18)
616

717
### Bug Fixes

LICENSE-3RD-PARTY.txt

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
-----------------------------------------------------------------------------
2+
MIT License
3+
Applies to:
4+
- colorjs.io; Copyright (c) 2021 Lea Verou, Chris Lilley
5+
- core-js-pure; Copyright (c) 2014-2023 Denis Pushkarev
6+
- css-selector-parser; Copyright (c) 2013 Dulin Marat
7+
- doT.js; Copyright (c) 2011 Laura Doktorova
8+
Software includes portions from jQote2 Copyright (c) 2010 aefxx,
9+
http://aefxx.com/ licensed under the MIT license.
10+
- emoji-regex; Copyright (c) Mathias Bynens <https://mathiasbynens.be/>
11+
- es6-iterator; Copyright (c) 2013-2017 Mariusz Nowak (www.medikoo.com)
12+
- es6-promise;
13+
Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors
14+
- event-emitter; Copyright (C) 2012-2015 Mariusz Nowak (www.medikoo.com)
15+
- is-promise; Copyright (c) 2014 Forbes Lindesay
16+
- lru-queue; Copyright (C) 2014 Mariusz Nowak (www.medikoo.com)
17+
- typedarray;
18+
Copyright (c) 2010, Linden Research, Inc.
19+
Copyright (c) 2012, Joshua Bell
20+
- weakmap-polyfill; Copyright (c) 2015-2021 polygonplanet
21+
-----------------------------------------------------------------------------
22+
23+
Permission is hereby granted, free of charge, to any person obtaining a copy
24+
of this software and associated documentation files (the "Software"), to deal
25+
in the Software without restriction, including without limitation the rights
26+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27+
copies of the Software, and to permit persons to whom the Software is
28+
furnished to do so, subject to the following conditions:
29+
30+
The above copyright notice and this permission notice shall be included in
31+
all copies or substantial portions of the Software.
32+
33+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
39+
THE SOFTWARE.
40+
41+
42+
-----------------------------------------------------------------------------
43+
ISC License
44+
Applies to:
45+
- d; Copyright (c) 2013-2019, Mariusz Nowak, @medikoo, medikoo.com
46+
- es5-ext; Copyright (c) 2011-2022, Mariusz Nowak, @medikoo, medikoo.com
47+
- es6-symbol; Copyright (c) 2013-2019, Mariusz Nowak, @medikoo, medikoo.com
48+
- es6-weak-map; Copyright (c) 2013-2018, Mariusz Nowak, @medikoo, medikoo.com
49+
- ext; Copyright (c) 2011-2022, Mariusz Nowak, @medikoo, medikoo.com
50+
- memoizee; Copyright (c) 2012-2018, Mariusz Nowak, @medikoo, medikoo.com
51+
- next-tick; Copyright (c) 2012-2020, Mariusz Nowak, @medikoo, medikoo.com
52+
- timers-ext; Copyright (c) 2013-2018, Mariusz Nowak, @medikoo, medikoo.com
53+
- type; Copyright (c) 2019, Mariusz Nowak, @medikoo, medikoo.com
54+
-----------------------------------------------------------------------------
55+
56+
Permission to use, copy, modify, and/or distribute this software for any
57+
purpose with or without fee is hereby granted, provided that the above
58+
copyright notice and this permission notice appear in all copies.
59+
60+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
61+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
62+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
63+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
64+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
65+
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
66+
PERFORMANCE OF THIS SOFTWARE.

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ Read the [documentation on contributing](CONTRIBUTING.md)
179179

180180
## Acknowledgements
181181

182-
Thanks to Marat Dulin for his [css-selector-parser](https://www.npmjs.com/package/css-selector-parser) implementation which is included for shadow DOM support.
182+
Thanks to Marat Dulin for his [css-selector-parser](https://www.npmjs.com/package/css-selector-parser) implementation which is included for shadow DOM support. Another thank you to the [Slick Parser](https://github.com/mootools/slick/blob/master/Source/Slick.Parser.js) implementers for their contribution, we have used some of their algorithms in our shadow DOM support code. Thanks to Lea Verou and Chris Lilley for their [colorjs.io](https://colorjs.io/) library which we have used for converting between color formats.
183183

184-
Thanks to the [Slick Parser](https://github.com/mootools/slick/blob/master/Source/Slick.Parser.js) implementers for their contribution, we have used some of their algorithms in our shadow DOM support code.
184+
## Licenses
185+
186+
Axe-core is distributed under the [Mozilla Public License, version 2.0](LICENSE). It comes bundled with several dependencies which are distributed under their own terms. (See [LICENSE-3RD-PARTY.txt](LICENSE-3RD-PARTY.txt))

axe.d.ts

+21-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Type definitions for axe-core
22
// Project: https://github.com/dequelabs/axe-core
3-
// Definitions by: Marcy Sutton <https://github.com/marcysutton>
43

54
declare namespace axe {
65
type ImpactValue = 'minor' | 'moderate' | 'serious' | 'critical' | null;
76

87
type TagValue = string;
98

10-
type ReporterVersion = 'v1' | 'v2' | 'raw' | 'raw-env' | 'no-passes';
9+
type ReporterVersion = 'v1' | 'v2' | 'raw' | 'rawEnv' | 'no-passes';
1110

1211
type RunOnlyType = 'rule' | 'rules' | 'tag' | 'tags';
1312

@@ -132,7 +131,7 @@ declare namespace axe {
132131
interface RunOptions {
133132
runOnly?: RunOnly | TagValue[] | string[] | string;
134133
rules?: RuleObject;
135-
reporter?: ReporterVersion;
134+
reporter?: ReporterVersion | string;
136135
resultTypes?: resultGroups[];
137136
selectors?: boolean;
138137
ancestry?: boolean;
@@ -333,6 +332,14 @@ declare namespace axe {
333332
xpath: string[];
334333
ancestry: UnlabelledFrameSelector;
335334
}
335+
interface DqElement extends SerialDqElement {
336+
element: Element;
337+
toJSON(): SerialDqElement;
338+
mergeSpecs(
339+
childSpec: SerialDqElement,
340+
parentSpec: SerialDqElement
341+
): SerialDqElement;
342+
}
336343
interface PartialRuleResult {
337344
id: string;
338345
result: 'inapplicable';
@@ -351,16 +358,21 @@ declare namespace axe {
351358
frameContext: FrameContextObject;
352359
}
353360

361+
interface RawCheckResult extends Omit<CheckResult, 'relatedNodes'> {
362+
relatedNodes?: Array<SerialDqElement | DqElement>;
363+
}
364+
354365
interface RawNodeResult<T extends 'passed' | 'failed' | 'incomplete'> {
355-
any: CheckResult[];
356-
all: CheckResult[];
357-
none: CheckResult[];
366+
node: SerialDqElement | DqElement;
367+
any: RawCheckResult[];
368+
all: RawCheckResult[];
369+
none: RawCheckResult[];
358370
impact: ImpactValue | null;
359371
result: T;
360372
}
361373

362374
interface RawResult extends Omit<Result, 'nodes'> {
363-
inapplicable: [];
375+
inapplicable: Array<never>;
364376
passes: RawNodeResult<'passed'>[];
365377
incomplete: RawNodeResult<'incomplete'>[];
366378
violations: RawNodeResult<'failed'>[];
@@ -383,6 +395,7 @@ declare namespace axe {
383395
attr(attr: string): string | null;
384396
hasAttr(attr: string): boolean;
385397
props: { [key: string]: unknown };
398+
boundingClientRect: DOMRect;
386399
}
387400

388401
interface Utils {
@@ -396,7 +409,7 @@ declare namespace axe {
396409
DqElement: new (
397410
elm: Element,
398411
options?: { absolutePaths?: boolean }
399-
) => SerialDqElement;
412+
) => DqElement;
400413
uuid: (
401414
options?: { random?: Uint8Array | Array<number> },
402415
buf?: Uint8Array | Array<number>,

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "axe-core",
3-
"version": "4.8.3",
3+
"version": "4.8.4",
44
"deprecated": true,
55
"contributors": [
66
{

doc/examples/mocha/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"devDependencies": {
1515
"axe-core": "^4.6.2",
16+
"chai": "^4.3.7",
1617
"karma": "^6.4.1",
1718
"karma-chai": "^0.1.0",
1819
"karma-chrome-launcher": "^3.1.1",

lib/core/base/virtual-node/virtual-node.js

+12-17
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,25 @@ class VirtualNode extends AbstractVirtualNode {
5151
// add to the prototype so memory is shared across all virtual nodes
5252
get props() {
5353
if (!this._cache.hasOwnProperty('props')) {
54-
const {
55-
nodeType,
56-
nodeName,
57-
id,
58-
multiple,
59-
nodeValue,
60-
value,
61-
selected,
62-
checked,
63-
indeterminate
64-
} = this.actualNode;
54+
const { nodeType, nodeName, id, nodeValue } = this.actualNode;
6555

6656
this._cache.props = {
6757
nodeType,
6858
nodeName: this._isXHTML ? nodeName : nodeName.toLowerCase(),
6959
id,
7060
type: this._type,
71-
multiple,
72-
nodeValue,
73-
value,
74-
selected,
75-
checked,
76-
indeterminate
61+
nodeValue
7762
};
63+
64+
// We avoid reading these on node types where they won't be relevant
65+
// to work around issues like #4316.
66+
if (nodeType === 1) {
67+
this._cache.props.multiple = this.actualNode.multiple;
68+
this._cache.props.value = this.actualNode.value;
69+
this._cache.props.selected = this.actualNode.selected;
70+
this._cache.props.checked = this.actualNode.checked;
71+
this._cache.props.indeterminate = this.actualNode.indeterminate;
72+
}
7873
}
7974

8075
return this._cache.props;

lib/core/utils/get-selector.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const ignoredAttributes = [
2222
'aria-expanded',
2323
'aria-grabbed',
2424
'aria-pressed',
25-
'aria-valuenow'
25+
'aria-valuenow',
26+
'xmlns'
2627
];
2728
const MAXATTRIBUTELENGTH = 31;
2829
const attrCharsRegex = /([\\"])/g;

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "axe-core",
33
"description": "Accessibility engine for automated Web UI testing",
4-
"version": "4.8.3",
4+
"version": "4.8.4",
55
"license": "MPL-2.0",
66
"engines": {
77
"node": ">=4"
@@ -55,7 +55,8 @@
5555
"axe.min.js",
5656
"axe.d.ts",
5757
"sri-history.json",
58-
"locales/"
58+
"locales/",
59+
"LICENSE-3RD-PARTY.txt"
5960
],
6061
"standard-version": {
6162
"scripts": {

sri-history.json

+4
Original file line numberDiff line numberDiff line change
@@ -366,5 +366,9 @@
366366
"4.8.3": {
367367
"axe.js": "sha256-YWpAAdIo7fwKmLq8nJx1f6pwt7HAXwWm15RSGJKbxhw=",
368368
"axe.min.js": "sha256-/mct+I/4SJnZ30Ce+j9T7ll9zPwzbJVrjdKpbKIP+NA="
369+
},
370+
"4.8.4": {
371+
"axe.js": "sha256-RRn+EjX3fX893zHeLzMQebvK4/HR3yZpVFNxsV3Pbm0=",
372+
"axe.min.js": "sha256-HXl1GEx0+LwVB27fLmwgdXCmeTM2beVwwFosWvFzLmo="
369373
}
370374
}

test/core/base/virtual-node/virtual-node.js

+39-9
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,45 @@ describe('VirtualNode', () => {
3737
assert.equal(vNode.props.type, 'text');
3838
});
3939

40-
it('should reflect selected property', () => {
41-
node = document.createElement('option');
42-
let vNode = new VirtualNode(node);
43-
assert.equal(vNode.props.selected, false);
44-
45-
node.selected = true;
46-
vNode = new VirtualNode(node);
47-
assert.equal(vNode.props.selected, true);
48-
});
40+
for (const [prop, tagName, examplePropValue] of [
41+
['value', 'input', 'test value'],
42+
['selected', 'option', true],
43+
['checked', 'input', true],
44+
['indeterminate', 'input', true],
45+
['multiple', 'select', true]
46+
]) {
47+
describe(`props.${prop}`, () => {
48+
it(`should reflect a ${tagName} element's ${prop} property`, () => {
49+
node = document.createElement(tagName);
50+
let vNode = new VirtualNode(node);
51+
assert.equal(vNode.props[prop], '');
52+
53+
node[prop] = examplePropValue;
54+
vNode = new VirtualNode(node);
55+
assert.equal(vNode.props[prop], examplePropValue);
56+
});
57+
58+
it('should be undefined for a text node', () => {
59+
node = document.createTextNode('text content');
60+
let vNode = new VirtualNode(node);
61+
assert.equal(vNode.props[prop], undefined);
62+
});
63+
64+
// Regression test for #4316
65+
it(`should be resilient to text node with un-gettable ${prop} property`, () => {
66+
node = document.createTextNode('text content');
67+
Object.defineProperty(node, prop, {
68+
get() {
69+
throw new Error('Unqueryable value');
70+
}
71+
});
72+
let vNode = new VirtualNode(node);
73+
assert.throws(() => node[prop]);
74+
assert.doesNotThrow(() => vNode.props[prop]);
75+
assert.equal(vNode.props[prop], undefined);
76+
});
77+
});
78+
}
4979

5080
it('should lowercase type', () => {
5181
node = document.createElement('input');

test/core/utils/get-selector.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,8 @@ describe('axe.utils.getSelector', function () {
471471
'aria-expanded',
472472
'aria-grabbed',
473473
'aria-pressed',
474-
'aria-valuenow'
474+
'aria-valuenow',
475+
'xmlns'
475476
];
476477
ignoredAttributes.forEach(function (att) {
477478
node.setAttribute(att, 'true');

0 commit comments

Comments
 (0)