Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
cf8f38e
chore: merge master into develop (#4546)
straker Jul 30, 2024
cfd2974
fix(axe.d.ts): add typings for preload options object (#4543)
blutorange Jul 30, 2024
4d8c87e
test: add workaround for target-size test failure in Firefox 131 nigh…
dbjorge Aug 7, 2024
1a03dc6
docs: fix example tests (#4564)
straker Aug 28, 2024
bdd80c2
test: ignore windowHeight in partialRun tests (#4571)
straker Sep 3, 2024
95730fa
chore: bump the npm-low-risk group across 1 directory with 18 updates…
dependabot[bot] Sep 3, 2024
d59548a
chore: bump chromedriver from 126.0.4 to 127.0.1 (#4550)
dependabot[bot] Sep 3, 2024
067b01d
feat(locale): Added ru locale (#4565)
engineerklimov Sep 9, 2024
b422c79
docs: Update README.md with grammatical fixes (#4583)
HuanWuCode Sep 24, 2024
a2f3a48
feat(axe.d.ts): add nodeSerializer typings (#4551)
hamax Sep 24, 2024
748cd01
test: ignore apg tabs-action (#4585)
straker Sep 25, 2024
8db3a40
docs: fix mismatched parenthesis (#4574)
straker Sep 25, 2024
9673d21
chore: sync generated files (#4587)
github-actions[bot] Sep 25, 2024
8aa47ac
fix(aria-allowed-role): add form to allowed roles of form element (#4…
matuzo Oct 3, 2024
b03ada3
fix(rules): Change "alternate text" to "alternative text" (#4582)
umut-gultekin Oct 3, 2024
3e8b3e6
chore: sync generated files (#4597)
github-actions[bot] Oct 3, 2024
0d03b0a
chore: fix formatting of ru locale (#4599)
dbjorge Oct 5, 2024
c42f0a9
chore: avoid auto-formatter workflow failing on fork PRs (#4600)
dbjorge Oct 7, 2024
154ff6d
test: fix flakiness in rerun integration test (#4598)
dbjorge Oct 7, 2024
a9710d7
fix(button-name,input-button-name,input-img-alt): allow label to give…
straker Oct 15, 2024
1cdd6c3
fix(get-ancestry): add nth-child selector for multiple siblings of sh…
straker Oct 15, 2024
dde04a1
docs(readme): link download badge to npm-stats.com (#4603)
WilcoFiers Oct 16, 2024
7e39874
perf(selector): more caching for faster selector creation (#4611)
WilcoFiers Oct 16, 2024
2abe399
chore(release): 4.11.0
attest-team-ci Oct 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
name: Formatter

on: [pull_request]
on:
pull_request:
branches:
- develop

jobs:
prettier:
# This conditional prevents running the job on PRs from forks; won't
# have permissions to commit changes, so the job would fail if it ran.
# PRs from forks will instead rely on failing the fmt_check job in test.yml
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ jobs:
path: axe.js
retention-days: 1

fmt_check:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run fmt:check

test_node:
strategy:
matrix:
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

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.11.0](https://github.com/dequelabs/axe-core/compare/v4.10.0...v4.11.0) (2024-10-16)

### Features

- **axe.d.ts:** add nodeSerializer typings ([#4551](https://github.com/dequelabs/axe-core/issues/4551)) ([a2f3a48](https://github.com/dequelabs/axe-core/commit/a2f3a485d5e02993c0f35762cd9d80a6ce4ced5f)), closes [#4093](https://github.com/dequelabs/axe-core/issues/4093)
- **locale:** Added ru locale ([#4565](https://github.com/dequelabs/axe-core/issues/4565)) ([067b01d](https://github.com/dequelabs/axe-core/commit/067b01d66db1d2c276f26743a8d13d5d60d33446))

### Bug Fixes

- **aria-allowed-role:** add form to allowed roles of form element ([#4588](https://github.com/dequelabs/axe-core/issues/4588)) ([8aa47ac](https://github.com/dequelabs/axe-core/commit/8aa47ac01f9959b9d47ac24dcd2fd8c88c9279f7)), closes [/github.com/dequelabs/axe-core/blob/develop/lib/standards/html-elms.js#L264](https://github.com/dequelabs//github.com/dequelabs/axe-core/blob/develop/lib/standards/html-elms.js/issues/L264)
- **axe.d.ts:** add typings for preload options object ([#4543](https://github.com/dequelabs/axe-core/issues/4543)) ([cfd2974](https://github.com/dequelabs/axe-core/commit/cfd297498c0e34edd5ff7e62935060bb9dda4db7))
- **button-name,input-button-name,input-img-alt:** allow label to give accessible name ([#4607](https://github.com/dequelabs/axe-core/issues/4607)) ([a9710d7](https://github.com/dequelabs/axe-core/commit/a9710d757c6ca6ee0ce5d26be3427bab54b87a7a)), closes [#4472](https://github.com/dequelabs/axe-core/issues/4472) [#3696](https://github.com/dequelabs/axe-core/issues/3696) [#3696](https://github.com/dequelabs/axe-core/issues/3696)
- **get-ancestry:** add nth-child selector for multiple siblings of shadow root ([#4606](https://github.com/dequelabs/axe-core/issues/4606)) ([1cdd6c3](https://github.com/dequelabs/axe-core/commit/1cdd6c3e698a6a4c28604448284993c4c20ca272)), closes [#4563](https://github.com/dequelabs/axe-core/issues/4563)
- **rules:** Change "alternate text" to "alternative text" ([#4582](https://github.com/dequelabs/axe-core/issues/4582)) ([b03ada3](https://github.com/dequelabs/axe-core/commit/b03ada3dd3b6490bb88e366bf807b10e1a4038a4))

## [4.10.0](https://github.com/dequelabs/axe-core/compare/v4.9.1...v4.10.0) (2024-07-29)

### Features
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# axe-core

[![License](https://img.shields.io/npm/l/axe-core.svg)](LICENSE)
[![License](https://img.shields.io/npm/l/axe-core.svg?color=c41)](LICENSE)
[![Version](https://img.shields.io/npm/v/axe-core.svg)](https://www.npmjs.com/package/axe-core)
[![Total npm downloads](https://img.shields.io/npm/dt/axe-core.svg)](https://www.npmjs.com/package/axe-core)
[![NPM downloads](https://img.shields.io/npm/dw/axe-core.svg?color=080)![](https://img.shields.io/npm/dy/axe-core.svg?color=080&label=)](https://npm-stat.com/charts.html?package=axe-core&from=2017-01-01)
[![Commits](https://img.shields.io/github/commit-activity/y/dequelabs/axe-core.svg)](https://github.com/dequelabs/axe-core/commits/develop)
[![GitHub contributors](https://img.shields.io/github/contributors/dequelabs/axe-core.svg)](https://github.com/dequelabs/axe-core/graphs/contributors)
[![GitHub contributors](https://img.shields.io/github/contributors/dequelabs/axe-core.svg?color=080)](https://github.com/dequelabs/axe-core/graphs/contributors)
[![Join our Slack chat](https://img.shields.io/badge/slack-chat-purple.svg?logo=slack)](https://accessibility.deque.com/axe-community)
[![Package Quality](https://npm.packagequality.com/shield/axe-core.svg)](https://packagequality.com/#?package=axe-core)

Expand Down
33 changes: 28 additions & 5 deletions axe.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,14 @@ declare namespace axe {
iframes?: boolean;
elementRef?: boolean;
frameWaitTime?: number;
preload?: boolean;
preload?: boolean | PreloadOptions;
performanceTimer?: boolean;
pingWaitTime?: number;
}
interface PreloadOptions {
assets: string[];
timeout?: number;
}
interface AxeResults extends EnvironmentData {
toolOptions: RunOptions;
passes: Result[];
Expand Down Expand Up @@ -338,6 +342,9 @@ declare namespace axe {
interface DqElement extends SerialDqElement {
element: Element;
toJSON(): SerialDqElement;
}
interface DqElementConstructor {
new (elm: Element, options?: { absolutePaths?: boolean }): DqElement;
mergeSpecs(
childSpec: SerialDqElement,
parentSpec: SerialDqElement
Expand Down Expand Up @@ -401,6 +408,24 @@ declare namespace axe {
boundingClientRect: DOMRect;
}

interface CustomNodeSerializer<T = SerialDqElement> {
toSpec: (dqElm: DqElement) => T;
mergeSpecs: (nodeSpec: T, parentFrameSpec: T) => T;
}

interface NodeSerializer {
update: <T>(serializer: CustomNodeSerializer<T>) => void;
toSpec: (node: Element | VirtualNode) => SerialDqElement;
dqElmToSpec: (
dqElm: DqElement | SerialDqElement,
options?: RunOptions
) => SerialDqElement;
mergeSpecs: (
nodeSpec: SerialDqElement,
parentFrameSpec: SerialDqElement
) => SerialDqElement;
}

interface Utils {
getFrameContexts: (
context?: ElementContext,
Expand All @@ -419,15 +444,13 @@ declare namespace axe {
selector: unknown
) => selector is LabelledShadowDomSelector;

DqElement: new (
elm: Element,
options?: { absolutePaths?: boolean }
) => DqElement;
DqElement: DqElementConstructor;
uuid: (
options?: { random?: Uint8Array | Array<number> },
buf?: Uint8Array | Array<number>,
offset?: number
) => string | Uint8Array | Array<number>;
nodeSerializer: NodeSerializer;
}

interface Aria {
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axe-core",
"version": "4.10.0",
"version": "4.11.0",
"deprecated": true,
"contributors": [
{
Expand Down
4 changes: 0 additions & 4 deletions doc/examples/jest_react/jest.setup.js

This file was deleted.

12 changes: 4 additions & 8 deletions doc/examples/jest_react/link.test.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import React from 'react';
import { mount, render } from 'enzyme';
import { render } from '@testing-library/react';
import axe from 'axe-core';

import Link from './link';

test('Link has no axe violations', done => {
const fixture = document.createElement('div');
document.body.appendChild(fixture);

const linkComponent = mount(
<Link page="http://www.axe-core.org">axe website</Link>,
{ attachTo: fixture }
const { container } = render(
<Link page="http://www.axe-core.org">axe website</Link>
);

const config = {
Expand All @@ -19,7 +15,7 @@ test('Link has no axe violations', done => {
'link-in-text-block': { enabled: false }
}
};
axe.run(fixture, config, (err, { violations }) => {
axe.run(container, config, (err, { violations }) => {
expect(err).toBe(null);
expect(violations).toHaveLength(0);
done();
Expand Down
22 changes: 9 additions & 13 deletions doc/examples/jest_react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,16 @@
"test": "jest"
},
"devDependencies": {
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
"axe-core": "^4.6.2",
"enzyme": "^3.11.0",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@babel/preset-env": "^7.25.3",
"@babel/preset-react": "^7.24.7",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"jest": {
"testEnvironment": "jsdom",
"setupFilesAfterEnv": [
"<rootDir>/jest.setup.js"
]
"testEnvironment": "jsdom"
}
}
7 changes: 1 addition & 6 deletions doc/examples/qunit/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ module.exports = function (grunt) {
all: ['test/**/*.html'],
options: {
puppeteer: {
ignoreDefaultArgs: true,
args: [
'--headless',
'--disable-web-security',
'--allow-file-access-from-files'
]
args: ['--disable-web-security', '--allow-file-access-from-files']
},
timeout: 10000
}
Expand Down
8 changes: 4 additions & 4 deletions doc/examples/qunit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
},
"devDependencies": {
"axe-core": "^4.6.2",
"grunt": "^1.5.3",
"grunt-contrib-qunit": "^5.1.1",
"puppeteer": "^19.5.0",
"qunitjs": "^2.0.1"
"grunt": "^1.6.1",
"grunt-contrib-qunit": "^10.1.1",
"puppeteer": "^23.1.0",
"qunit": "^2.22.0"
}
}
4 changes: 2 additions & 2 deletions doc/examples/qunit/test/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<!-- Load local QUnit. -->
<link
rel="stylesheet"
href="../node_modules/qunitjs/qunit/qunit.css"
href="../node_modules/qunit/qunit/qunit.css"
media="screen"
/>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<script src="../node_modules/qunit/qunit/qunit.js"></script>
<!-- Load local lib and tests. -->
<script src="../node_modules/axe-core/axe.min.js"></script>
<script src="a11y.js"></script>
Expand Down
Loading
Loading