Skip to content

Commit b53af11

Browse files
authored
Merge pull request #3025 from dequelabs/release-4.2.3
chore(release): 4.2.3
2 parents a6fcb75 + 66e332a commit b53af11

51 files changed

Lines changed: 3825 additions & 15990 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,13 @@ jobs:
135135
- checkout
136136
- <<: *restore_dependency_cache_unix
137137
- run: npm run build
138-
# install Chrome Canary
138+
# install Chrome Beta
139139
- run: |
140-
wget https://dl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb
141-
sudo apt install ./google-chrome-unstable_current_amd64.deb
142-
- run: npm run test -- --browsers ChromeCanary,FirefoxNightly
140+
wget https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb
141+
sudo apt install ./google-chrome-beta_current_amd64.deb
142+
- run: |
143+
CHROME_BIN="$(which google-chrome-beta)" && echo "CHROME_BIN: $CHROME_BIN"
144+
npm run test -- --browsers Chrome,FirefoxNightly
143145
144146
# Test api docs can be built
145147
build_api_docs:

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
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.2.3](https://github.com/dequelabs/axe-core/compare/v4.2.2...v4.2.3) (2021-06-22)
6+
7+
### Bug Fixes
8+
9+
- **accText:** ignore text in embedded content elements ([#3022](https://github.com/dequelabs/axe-core/issues/3022)) ([8fb4635](https://github.com/dequelabs/axe-core/commit/8fb4635e01c82b80ff23994edad180dd73730a98)), closes [#3017](https://github.com/dequelabs/axe-core/issues/3017)
10+
- **color-contrast:** add special case for new sr-only technique ([#2985](https://github.com/dequelabs/axe-core/issues/2985)) ([79cbf01](https://github.com/dequelabs/axe-core/commit/79cbf0168bdb9311db2e31043ad36c20b77e39fe))
11+
- **color-contrast:** check for pseudo elements on element itself, not just parents ([#2980](https://github.com/dequelabs/axe-core/issues/2980)) ([3122550](https://github.com/dequelabs/axe-core/commit/3122550b1beaeafaac62c81fb47bcd4290ba266a))
12+
- **frame-tested:** run without respondable ([#2942](https://github.com/dequelabs/axe-core/issues/2942)) ([a1d725d](https://github.com/dequelabs/axe-core/commit/a1d725d5cdedc4bfd6ba69bb25aa0a1213fd63cf))
13+
- **publish-metadata:** use fail message for rules with reviewOnFail:true ([#2987](https://github.com/dequelabs/axe-core/issues/2987)) ([00fefa9](https://github.com/dequelabs/axe-core/commit/00fefa9bfb9479279afc89b2da45e748bace77d2))
14+
- **sri-history:** add backported releases ([#3004](https://github.com/dequelabs/axe-core/issues/3004)) ([0332e80](https://github.com/dequelabs/axe-core/commit/0332e806524ca9ca78512423a70eb80d623795eb))
15+
516
### [4.2.2](https://github.com/dequelabs/axe-core/compare/v4.2.1...v4.2.2) (2021-06-03)
617

718
### Bug Fixes

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ Axe is an accessibility testing engine for websites and other HTML-based user in
1616

1717
Axe-core has different types of rules, for WCAG 2.0 and 2.1 on level A and AA, as well as a number of best practices that help you identify common accessibility practices like ensuring every page has an `h1` heading, and to help you avoid "gotchas" in ARIA like where an ARIA attribute you used will get ignored.
1818

19-
With axe-core, you can find **on average 57% of WCAG issues automatically**. Additionally, axe-core will return elements as "incomplete" where axe-core could not be certain, and manual review is needed. To further improve test coverage we recommend the [intelligent guided tests](https://www.youtube.com/watch?v=AtsX0dPCG_4&feature=youtu.be&ab_channel=DequeSystems) in the [axe Extension](https://www.deque.com/axe/browser-extensions/).
19+
With axe-core, you can find **on average 57% of WCAG issues automatically**. Additionally, axe-core will return elements as "incomplete" where axe-core could not be certain, and manual review is needed.
20+
21+
To catch bugs earlier in the development cycle we recommend using the [axe-linter vscode extension](https://marketplace.visualstudio.com/items?itemName=deque-systems.vscode-axe-linter). To improve test coverage even further we recommend the [intelligent guided tests](https://www.youtube.com/watch?v=AtsX0dPCG_4&feature=youtu.be&ab_channel=DequeSystems) in the [axe Extension](https://www.deque.com/axe/browser-extensions/).
2022

2123
The complete list of rules, grouped WCAG level and best practice, can found in [doc/rule-descriptions.md](./doc/rule-descriptions.md).
2224

axe.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,20 +318,20 @@ declare namespace axe {
318318
open: (topicHandler: TopicHandler) => Close | void;
319319
post: (
320320
frameWindow: Window,
321-
data: TopicData | ReplyData,
321+
data: TopicData,
322322
replyHandler: ReplyHandler
323-
) => void;
323+
) => boolean | void;
324324
};
325325
type Close = Function;
326-
type TopicHandler = (data: TopicData, responder?: Responder) => void;
327-
type ReplyHandler = (data: ReplyData, responder?: Responder) => void;
326+
type TopicHandler = (data: TopicData, responder: Responder) => void;
327+
type ReplyHandler = (message: any | Error, keepalive: boolean, responder: Responder) => void;
328328
type Responder = (
329-
message: any,
330-
keepalive: boolean,
331-
replyHandler: ReplyHandler
329+
message: any | Error,
330+
keepalive?: boolean,
331+
replyHandler?: ReplyHandler
332332
) => void;
333-
type TopicData = { topic: String } & ReplyData;
334-
type ReplyData = { channelId: String; message: any; keepAlive: Boolean };
333+
type TopicData = { topic: string } & ReplyData;
334+
type ReplyData = { channelId: string; message: any; keepalive: boolean };
335335
}
336336

337337
export = axe;

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

build/configure.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,12 @@ function buildRules(grunt, options, commons, callback) {
273273

274274
function parseFailureForRule(rule) {
275275
function hasFailure(definition, out) {
276-
if (definition && definition.metadata && definition.metadata.impact) {
276+
if (
277+
!rule.reviewOnFail &&
278+
definition &&
279+
definition.metadata &&
280+
definition.metadata.impact
281+
) {
277282
out = out || !!definition.metadata.messages.fail;
278283
}
279284
return out;
@@ -289,7 +294,10 @@ function buildRules(grunt, options, commons, callback) {
289294
function parseIncompleteForRule(rule) {
290295
function hasIncomplete(definition, out) {
291296
if (definition && definition.metadata && definition.metadata.impact) {
292-
out = out || !!definition.metadata.messages.incomplete;
297+
out =
298+
out ||
299+
!!definition.metadata.messages.incomplete ||
300+
rule.reviewOnFail;
293301
}
294302
return out;
295303
}

doc/API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ axe.run(context, options, (err, results) => {
307307
#### Parameters axe.run
308308

309309
- [`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.
310-
- [`options`](#options-parameter): (optional) Set of options passed into rules or checks, temporarily modifying them. This contrasts with `axe.configure`, which is more permanent.
310+
- [`options`](#options-parameter): (optional) Set of options that change how `axe.run` works, including what rules will run. To pass options to specific checks, use `axe.configure`.
311311
- [`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.
312312

313313
##### Context Parameter

doc/frame-messenger.md

Lines changed: 70 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ Tools like browser extensions and testing environments often have different chan
88
axe.frameMessenger({
99
// Called to initialize message handling
1010
open(topicHandler) {
11+
// Map data from the bridge to topicHandler
12+
function subscriber(frameWin, data, response) {
13+
// Data deserializations / validation / etc. here
14+
topicHandler(data, response);
15+
}
1116
// Start listening for "axe-core" events
12-
const unsubscribe = bridge.subscribe('axe-core', data => {
13-
topicHandler(data);
14-
});
17+
const unsubscribe = bridge.subscribe('axe-core', subscriber);
1518
// Tell axe how to close the connection if it needs to
1619
return unsubscribe;
1720
},
@@ -34,10 +37,71 @@ axe.frameMessenger({
3437

3538
The `topicHandler` function takes two arguments: the `data` object and a callback function that is called when the subscribed listener completes. The `data` object is exclusively passed data that can be serialized with `JSON.stringify()`, which depending on the system may need to be used.
3639

37-
The `open` function can `return` an optional cleanup function, which is called when another frameMessenger is registered.
40+
The `open` function can `return` an optional `close` function. Axe-core will only ever have one frameMessenger open at a time. The `close` function is called when another frameMessenger is registered.
3841

3942
## axe.frameMessenger({ post })
4043

41-
`post` is a function that dictates how axe-core communicates with frames. It is passed three arguments: `frameWindow`, which is the frames `contentWindow`, the `data` object, and a `replyHandler` that must be called when responses are received.
44+
`post` is a function that dictates how axe-core communicates with frames. It is passed three arguments: `frameWindow`, which is the frame's `contentWindow`, the `data` object, and a `replyHandler` that must be called when responses are received. To inform axe-core that no message was sent, return `false`. This informs axe-core not to await for the ping to time out.
45+
46+
Currently, axe-core will only require `replyHandler` to be called once, so promises can also be used here. This may change in the future, so it is preferable to make it possible for `replyHandler` to be called multiple times. Some axe-core [plugins](plugins.md) may rely on this feature.
47+
48+
A second frameMessenger feature available to plugins, but not used in axe-core by default is to reply to a reply. This works by passing `replyHandler` a `responder` callback as a second argument. This requires a different setup, in which callbacks are stored based on their `channelId` property.
49+
50+
```js
51+
// store handlers based on channelId
52+
const channels = {};
53+
54+
axe.frameMessenger({
55+
post(frameWindow, data, replyHandler) {
56+
// Store the handler so it can be called later
57+
channels[data.channelId] = replyHandler;
58+
// Send a message to the frame
59+
bridge.send(frameWindow, data);
60+
},
61+
62+
open(topicHandler) {
63+
function subscriber(frameWin, data) {
64+
const { channelId, message, keepalive } = data;
65+
// Create a callback to invoke on a reply.
66+
const responder = createResponder(frameWin, channelId);
67+
68+
// If there is a topic, pass it to the axe supplied topic-handler
69+
if (data.topic) {
70+
topicHandler(data, responder);
71+
72+
// If there is a replyHandler stored, invoke it
73+
} else if (channels[channelId]) {
74+
const replyHandler = channels[channelId];
75+
replyHandler(message, keepalive, responder);
76+
77+
// Clean up replyHandler, as no further messages are expected
78+
if (!keepalive) delete channels[channelId];
79+
}
80+
}
81+
82+
// Start listening for "axe-core" events
83+
const unsubscribe = bridge.subscribe('axe-core', subscriber);
84+
// Tell axe how to close the connection if it needs to
85+
return unsubscribe;
86+
}
87+
});
88+
89+
// Return a function to be called when a reply is received
90+
function createResponder(frameWin, channelId) {
91+
return function responder(message, keepalive, replyHandler) {
92+
// Store the new reply handler, possibly replacing a previous one
93+
// to avoid receiving a message twice.
94+
channels[channelId] = replyHandler;
95+
// Send a message to the frame
96+
bridge.send(frameWin, { channelId, message, keepalive });
97+
};
98+
}
99+
```
100+
101+
## Error handling & Timeouts
102+
103+
If for some reason the frameMessenger fails to open, post, or close you should not throw an error. Axe-core will handle missing results by reporting on them in the `frame-tested` rule. It should not be possible for the `topicHandler` and `replyHandler` callbacks to throw an error. If this happens, please file an issue.
104+
105+
Axe-core has a timeout mechanism built in, which pings frames to see if they respond before instructing them to run. There is no retry behavior in axe-core, which assumes that whatever channel is used is stable. If this isn't the case, this will need to be built into frameMessenger.
42106

43-
**note**: Currently, axe-core will only call `replyHandler` once, so promises can also be used here. This may change in the future, so it is preferable to make it possible for `replyHandler` to be called multiple times.
107+
The `message` passed to responder may be an `Error`. If axe-core passes an `Error`, this should be propagated "as is". If this is not possible because the message needs to be serialized, a new `Error` object must be constructed as part of deserialization.

doc/projects.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Add your project/integration to this file and submit a pull request.
1212
1. [axe-core/react](https://www.npmjs.com/package/@axe-core/react)
1313
1. [axe-core/cli](https://www.npmjs.com/package/@axe-core/cli)
1414
1. [axe-core/webdriverjs](https://www.npmjs.com/package/@axe-core/webdriverjs)
15+
1. [axe-core/webdriverio](https://www.npmjs.com/package/@axe-core/webdriverio)
16+
1. [axe-core/playwright](https://www.npmjs.com/package/@axe-core/playwright)
1517
1. [axe-core/puppeteer](https://www.npmjs.com/package/@axe-core/puppeteer)
1618
1. [axe-core-selenium (Java)](https://search.maven.org/artifact/com.deque.html.axe-core/selenium)
1719
1. [axe-core-capybara (Ruby)](https://rubygems.org/gems/axe-core-capybara/)

0 commit comments

Comments
 (0)