Skip to content

Commit

Permalink
Merge pull request #3990 from dequelabs/release-2023-04-17
Browse files Browse the repository at this point in the history
chore(release): v4.7.0
  • Loading branch information
WilcoFiers committed Apr 17, 2023
2 parents 4d06caa + adceb2d commit c7957d2
Show file tree
Hide file tree
Showing 125 changed files with 3,276 additions and 1,034 deletions.
35 changes: 20 additions & 15 deletions .circleci/config.yml
Expand Up @@ -327,42 +327,42 @@ workflows:
# Run linting
- lint:
requires:
- build_unix
- dependencies_unix
# Run tests on all commits, but after installing dependencies
- test_chrome:
requires:
- lint
- build_unix
- test_firefox:
requires:
- test_chrome
- build_unix
- test_examples:
requires:
- test_chrome
- build_unix
- test_act:
requires:
- test_chrome
- build_unix
- test_aria_practices:
requires:
- test_chrome
- build_unix
- test_locales:
requires:
- test_chrome
- build_unix
- test_virtual_rules:
requires:
- test_chrome
- build_unix
- build_api_docs:
requires:
- test_chrome
- build_unix
- test_rule_help_version:
requires:
- test_chrome
- build_unix
- test_node:
requires:
- test_chrome
- build_unix
# Verify the sri history is correct
- verify_sri:
requires:
- dependencies_unix
- build_unix
filters:
branches:
only:
Expand All @@ -372,6 +372,7 @@ workflows:
- hold_release:
type: approval
requires:
- test_chrome
- test_firefox
- test_examples
- test_act
Expand All @@ -389,6 +390,7 @@ workflows:
# Run a next release on "develop" commits, but only after the tests pass and dependencies are installed
- next_release:
requires:
- test_chrome
- test_firefox
- test_examples
- test_act
Expand Down Expand Up @@ -435,12 +437,15 @@ workflows:
- develop
jobs:
- dependencies_unix
- test_nightly_browsers:
- build_unix:
requires:
- dependencies_unix
- test_nightly_browsers:
requires:
- build_unix
- test_nightly_act:
requires:
- dependencies_unix
- build_unix
- test_nightly_aria_practices:
requires:
- dependencies_unix
- build_unix
36 changes: 36 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,42 @@

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.

## [4.7.0](https://github.com/dequelabs/axe-core/compare/v4.6.3...v4.7.0) (2023-04-17)

### Features

- **aria-roledescription:** deprecate rule ([#3948](https://github.com/dequelabs/axe-core/issues/3948)) ([1913a9e](https://github.com/dequelabs/axe-core/commit/1913a9eaf0e669927c57d56710053303cda193f8))
- **aria-roles:** deprecate the ARIA directory role ([#3952](https://github.com/dequelabs/axe-core/issues/3952)) ([893fdd0](https://github.com/dequelabs/axe-core/commit/893fdd0901f9218d9add39c16b2e6b77227fbdcd))
- **d.ts:** setup/teardown, reporters & metadata definitions ([#3966](https://github.com/dequelabs/axe-core/issues/3966)) ([78264ee](https://github.com/dequelabs/axe-core/commit/78264ee663d528bc3fbfc9ea7dbba180259f01af))
- deprecate bower ([#3889](https://github.com/dequelabs/axe-core/issues/3889)) ([651d811](https://github.com/dequelabs/axe-core/commit/651d811f0f1d1dfc5ab899568eaeb83931011f34))
- deprecate color.filteredRectStack, color.getRectStack, and dom.visuallyContains ([#3859](https://github.com/dequelabs/axe-core/issues/3859)) ([3be2bad](https://github.com/dequelabs/axe-core/commit/3be2bad2a896e72a92fe70810500fc1ef67b7027))
- **dom.focusDisabled,dom.isVisibleForScreenreader:** support the inert attribute ([#3857](https://github.com/dequelabs/axe-core/issues/3857)) ([273c971](https://github.com/dequelabs/axe-core/commit/273c97199bd596a288378427becba672b4482678))
- **metadata:** add Trusted Tester tag ([#3986](https://github.com/dequelabs/axe-core/issues/3986)) ([1f6a2a6](https://github.com/dequelabs/axe-core/commit/1f6a2a68ac10c770091741b328de7efb2ccc6687))
- support the dialog element ([#3902](https://github.com/dequelabs/axe-core/issues/3902)) ([d4522cd](https://github.com/dequelabs/axe-core/commit/d4522cdd7a90018336098f9b2119e353bd5a71ee))

### Bug Fixes

- **aria-allowed-attrs:** allow aria-description and aria-braille\* attrs ([#3956](https://github.com/dequelabs/axe-core/issues/3956)) ([2842395](https://github.com/dequelabs/axe-core/commit/2842395f9a8990f670e7025749ff8301b68a15ae))
- **aria-input-field-name:** skip combobox popups ([#3886](https://github.com/dequelabs/axe-core/issues/3886)) ([3dcdd42](https://github.com/dequelabs/axe-core/commit/3dcdd42d9ce52817d0931aa4fea1ec2b1fc9d650))
- **aria-required-children:** allow separator in menu(bar) ([#3868](https://github.com/dequelabs/axe-core/issues/3868)) ([ec9f507](https://github.com/dequelabs/axe-core/commit/ec9f50708a233acfa4f9b851618077d6637e6582))
- **aria-required-children:** do not fail for children with aria-hidden ([#3949](https://github.com/dequelabs/axe-core/issues/3949)) ([8714d6b](https://github.com/dequelabs/axe-core/commit/8714d6ba6debec93d095f5f12385d92c55b0d4b3))
- **aria-required-children:** list elements that are not allowed ([#3951](https://github.com/dequelabs/axe-core/issues/3951)) ([cce7586](https://github.com/dequelabs/axe-core/commit/cce75869be032006dc505a2af853886943973319))
- **autocomplete-valid:** allow webauthn token ([#3866](https://github.com/dequelabs/axe-core/issues/3866)) ([fd3010f](https://github.com/dequelabs/axe-core/commit/fd3010ff74eb677d4a84198bb1ca314d54393cb7))
- **color-contrast:** correcly apply opacity to foreground color ([#3973](https://github.com/dequelabs/axe-core/issues/3973)) ([d7db279](https://github.com/dequelabs/axe-core/commit/d7db279549c443c1e2f43a6b33ebee0968c64325))
- **color-contrast:** correctly calculate contrast of flex/grid items with z-index ([#3884](https://github.com/dequelabs/axe-core/issues/3884)) ([cef96be](https://github.com/dequelabs/axe-core/commit/cef96be6740657047031c2019908822f957e6c63))
- **color-contrast:** correctly compute background color for elements with opacity ([#3944](https://github.com/dequelabs/axe-core/issues/3944)) ([c051fe8](https://github.com/dequelabs/axe-core/commit/c051fe851fb5eaa75e6dc0205c4db5e75d80f3a4)), closes [#3932](https://github.com/dequelabs/axe-core/issues/3932)
- **color-contrast:** correctly compute color contrast of <slot> elements ([#3847](https://github.com/dequelabs/axe-core/issues/3847)) ([4c3a00c](https://github.com/dequelabs/axe-core/commit/4c3a00c7bd6de68b2795be37113a59d804d0a313))
- **color-contrast:** do not check contrast on elemets that are inerted ([#3894](https://github.com/dequelabs/axe-core/issues/3894)) ([da19946](https://github.com/dequelabs/axe-core/commit/da19946db610c3ab8898431645274a8a76d61a33))
- **color-contrast:** skip ligature icons ([#3867](https://github.com/dequelabs/axe-core/issues/3867)) ([9486288](https://github.com/dequelabs/axe-core/commit/948628894e3119e7f6ad45a230fbee23ffe64ef2))
- **create-grid:** correctly compute stack order for non-positioned stacking contexts ([#3930](https://github.com/dequelabs/axe-core/issues/3930)) ([8db2c24](https://github.com/dequelabs/axe-core/commit/8db2c2492d55a903b7903ed71f8b792e58dc2e8c)), closes [#3932](https://github.com/dequelabs/axe-core/issues/3932)
- **css-orientation-lock:** support the css rotate property ([#3958](https://github.com/dequelabs/axe-core/issues/3958)) ([c51f8bf](https://github.com/dequelabs/axe-core/commit/c51f8bfea87b57c269e509f88d64855368a25493))
- **focus-order-semantics:** Add ARIA role article to list of valid roles for scrollable regions ([#3927](https://github.com/dequelabs/axe-core/issues/3927)) ([f029271](https://github.com/dequelabs/axe-core/commit/f0292714b94a1483f4148f3ca7206897cfb21318))
- **is-icon-ligature:** prevent canvas2d warning willReadFrequently ([#3931](https://github.com/dequelabs/axe-core/issues/3931)) ([b3c52bb](https://github.com/dequelabs/axe-core/commit/b3c52bbb6eccda67dabcbf4183d7c201a227a0ac))
- **link-in-text-block:** allow links with identical colors ([#3861](https://github.com/dequelabs/axe-core/issues/3861)) ([5f90040](https://github.com/dequelabs/axe-core/commit/5f900402470f925686a0d8b41ac01731492bbd30))
- **respondable:** work with CDP `Page.setDocumentContent` ([#3921](https://github.com/dequelabs/axe-core/issues/3921)) ([66f23e5](https://github.com/dequelabs/axe-core/commit/66f23e59b6deddd3b95035545d622d761abe5825))
- **scrollable-region-focusable:** change impact to serious ([#3959](https://github.com/dequelabs/axe-core/issues/3959)) ([e3a5c21](https://github.com/dequelabs/axe-core/commit/e3a5c211fe007736d98a16d69995318c2c651f2d))
- **scrollable-region-focusable:** skip native controls ([#3862](https://github.com/dequelabs/axe-core/issues/3862)) ([b0bdefa](https://github.com/dequelabs/axe-core/commit/b0bdefa34b85363e742ff04e319c014fe95f31f7))

### [4.6.3](https://github.com/dequelabs/axe-core/compare/v4.6.2...v4.6.3) (2023-01-23)

### Bug Fixes
Expand Down
83 changes: 77 additions & 6 deletions axe.d.ts
Expand Up @@ -190,12 +190,13 @@ declare namespace axe {
help: string;
};
}
interface CheckMessages {
pass: string | { [key: string]: string };
fail: string | { [key: string]: string };
incomplete: string | { [key: string]: string };
}
interface CheckLocale {
[key: string]: {
pass: string | { [key: string]: string };
fail: string | { [key: string]: string };
incomplete: string | { [key: string]: string };
};
[key: string]: CheckMessages;
}
interface Locale {
lang?: string;
Expand Down Expand Up @@ -237,7 +238,7 @@ declare namespace axe {
}
interface Spec {
branding?: string | Branding;
reporter?: ReporterVersion;
reporter?: ReporterVersion | string | AxeReporter;
checks?: Check[];
rules?: Rule[];
standards?: Standards;
Expand All @@ -263,6 +264,10 @@ declare namespace axe {
options?: any;
matches?: string;
enabled?: boolean;
metadata?: {
impact?: ImpactValue;
messages?: CheckMessages;
};
}
interface Rule {
id: string;
Expand All @@ -277,6 +282,7 @@ declare namespace axe {
tags?: string[];
matches?: string;
reviewOnFail?: boolean;
metadata?: Omit<RuleMetadata, 'ruleId'>;
}
interface AxePlugin {
id: string;
Expand Down Expand Up @@ -319,14 +325,50 @@ declare namespace axe {
frameSelector: CrossTreeSelector;
frameContext: FrameContextObject;
}

interface RawNodeResult<T extends 'passed' | 'failed' | 'incomplete'> {
any: CheckResult[];
all: CheckResult[];
none: CheckResult[];
impact: ImpactValue | null;
result: T;
}

interface RawResult extends Omit<Result, 'nodes'> {
inapplicable: [];
passes: RawNodeResult<'passed'>[];
incomplete: RawNodeResult<'incomplete'>[];
violations: RawNodeResult<'failed'>[];
pageLevel: boolean;
result: 'failed' | 'passed' | 'incomplete' | 'inapplicable';
}

type AxeReporter<T = unknown> = (
rawResults: RawResult[],
option: RunOptions,
callback: (report: T) => void
) => void;

interface VirtualNode {
actualNode?: Node;
shadowId?: string;
children?: VirtualNode[];
parent?: VirtualNode;
attr(attr: string): string | null;
hasAttr(attr: string): boolean;
props: { [key: string]: unknown };
}

interface Utils {
getFrameContexts: (
context?: ElementContext,
options?: RunOptions
) => FrameContext[];
shadowSelect: (selector: CrossTreeSelector) => Element | null;
shadowSelectAll: (selector: CrossTreeSelector) => Element[];
getStandards(): Required<Standards>;
}

interface EnvironmentData {
testEngine: TestEngine;
testRunner: TestRunner;
Expand Down Expand Up @@ -436,6 +478,35 @@ declare namespace axe {
*/
function frameMessenger(frameMessenger: FrameMessenger): void;

/**
* Setup axe-core so axe.common functions can work properly.
*/
function setup(node?: Element | Document): VirtualNode;

/**
* Clean up axe-core tree and caches. `axe.run` will call this function at the end of the run so there's no need to call it yourself afterwards.
*/
function teardown(): void;

/**
* Check if a reporter is registered
*/
function hasReporter(reporterName: string): boolean;

/**
* Get a reporter based the name it is registered with
*/
function getReporter<T>(reporterName: string): AxeReporter<T>;

/**
* Register a new reporter, optionally setting it as the default
*/
function addReporter<T>(
reporterName: string,
reporter: AxeReporter<T>,
isDefault?: boolean
): void;

// axe.frameMessenger
type FrameMessenger = {
open: (topicHandler: TopicHandler) => Close | void;
Expand Down
3 changes: 2 additions & 1 deletion bower.json
@@ -1,6 +1,7 @@
{
"name": "axe-core",
"version": "4.6.3",
"version": "4.7.0",
"deprecated": true,
"contributors": [
{
"name": "David Sturley",
Expand Down
6 changes: 5 additions & 1 deletion build/cherry-pick.js
Expand Up @@ -45,7 +45,11 @@ let targetVersion = releaseType === 'patch' ? version : `${major}.${minor}.0`;

// get all commits from a branch
function getCommits(branch) {
const stdout = execSync(`git log ${branch || ''} --abbrev-commit`).toString();
// all commits are too large for execSync buffer size so we'll just get since the last 3 years
const date = new Date(new Date().setFullYear(new Date().getFullYear() - 3));
const stdout = execSync(
`git log ${branch || ''} --abbrev-commit --since=${date.getFullYear()}`
).toString();
const allCommits = stdout
.split(/commit (?=[\w\d]{8}[\n\r])/)
.filter(commit => !!commit);
Expand Down
4 changes: 3 additions & 1 deletion doc/API.md
Expand Up @@ -74,7 +74,7 @@ For a full listing of API offered by axe, clone the repository and run `npm run

Each rule in axe-core has a number of tags. These provide metadata about the rule. Each rule has one tag that indicates which WCAG version / level it belongs to, or if it doesn't it have the `best-practice` tag. If the rule is required by WCAG, there is a tag that references the success criterion number. For example, the `wcag111` tag means a rule is required for WCAG 2 success criterion 1.1.1.

The `experimental`, `ACT` and `section508` tags are only added to some rules. Each rule with a `section508` tag also has a tag to indicate what requirement in old Section 508 the rule is required by. For example `section508.22.a`.
The `experimental`, `ACT`, `TT`, and `section508` tags are only added to some rules. Each rule with a `section508` tag also has a tag to indicate what requirement in old Section 508 the rule is required by. For example `section508.22.a`.

| Tag Name | Accessibility Standard / Purpose |
| ---------------- | ---------------------------------------------------- |
Expand All @@ -89,6 +89,8 @@ The `experimental`, `ACT` and `section508` tags are only added to some rules. Ea
| `ACT` | W3C approved Accessibility Conformance Testing rules |
| `section508` | Old Section 508 rules |
| `section508.*.*` | Requirement in old Section 508 |
| `TTv5` | Trusted Tester v5 rules |
| `TT*.*` | Test ID in Trusted Tester |
| `experimental` | Cutting-edge rules, disabled by default |
| `cat.*` | Category mappings used by Deque (see below) |

Expand Down
6 changes: 4 additions & 2 deletions doc/examples/puppeteer/package.json
Expand Up @@ -4,10 +4,12 @@
"private": true,
"main": "axe-puppeteer.js",
"scripts": {
"test": "node axe-puppeteer.js https://deque.com"
"test": "npm run test:url && npm run test:set-content",
"test:url": "node axe-puppeteer.js https://deque.com",
"test:set-content": "node set-content.js"
},
"devDependencies": {
"axe-core": "^4.6.2",
"puppeteer": "^19.5.0"
"puppeteer": "^19.8.2"
}
}
34 changes: 34 additions & 0 deletions doc/examples/puppeteer/set-content.js
@@ -0,0 +1,34 @@
const assert = require('assert');
const puppeteer = require('puppeteer');
const axe = require('axe-core');

(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();

await page.setContent(`
<html lang="en">
<head>
<title>Test Page</title>
</head>
<body>
<main>
<h1>Hello World</h1>
<button id="empty-button"></button>
<iframe title="iframe" srcdoc="<button id='iframe-empty-button'></button>"></iframe>
</main>
</body>
</html>
`);

await page.evaluate(axe.source);
const frames = page.frames();
for (let i = 0; i < frames.length; i++) {
await frames[i].evaluate(axe.source);
}

const results = await page.evaluate(`window.axe.run()`);
assert(results.violations.length);

await browser.close();
})();
2 changes: 1 addition & 1 deletion doc/projects.md
Expand Up @@ -50,7 +50,7 @@ Add your project/integration to this file and submit a pull request.
1. [axe-TestCafe](https://github.com/helen-dikareva/axe-testcafe)
1. [Web Audit University of Nebraska-Lincoln](https://webaudit.unl.edu/)
1. [Vorlon.js Remote Debugger](https://github.com/MicrosoftDX/Vorlonjs)
1. [Terra's Webdriver.io Accessibility Service](https://github.com/cerner/terra-toolkit/blob/master/docs/AxeService.md)
1. [Terra Toolkit](https://github.com/cerner/terra-toolkit)
1. [axe-sarif-converter](https://github.com/microsoft/axe-sarif-converter)
1. [Selenium.Axe for .NET](https://github.com/TroyWalshProf/SeleniumAxeDotnet)
1. [vue-axe](https://github.com/vue-a11y/vue-axe-next)
Expand Down

0 comments on commit c7957d2

Please sign in to comment.