Skip to content

Commit

Permalink
Added 200 zoom changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sajalg-bstack committed Jul 17, 2024
1 parent e208dab commit 80b5336
Show file tree
Hide file tree
Showing 193 changed files with 12,259 additions and 3,169 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

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.9.1](https://github.com/dequelabs/axe-core/compare/v4.9.0...v4.9.1) (2024-05-06)

### Bug Fixes

- Prevent errors when loading axe in a page with prototype.js
- **aria-allowed-attr:** allow meter role allowed aria-\* attributes on meter element ([#4435](https://github.com/dequelabs/axe-core/issues/4435)) ([7ac6392](https://github.com/dequelabs/axe-core/commit/7ac63921e7fab21f3359dcfc8affa7585bc9c25b))
- **aria-allowed-role:** add gridcell, separator, slider and treeitem to allowed roles of button element ([#4398](https://github.com/dequelabs/axe-core/issues/4398)) ([4788bf8](https://github.com/dequelabs/axe-core/commit/4788bf8d6fd963d7b017dad950b122ffcea8d151))
- **aria-roles:** correct abstract roles (types) for aria-roles([#4421](https://github.com/dequelabs/axe-core/pull/4421))
- **aria-valid-attr-value:** aria-controls & aria-haspopup incomplete ([#4418](https://github.com/dequelabs/axe-core/pull/4418))
- fix building axe-core translation files with region locales ([#4396](https://github.com/dequelabs/axe-core/issues/4396)) ([5c318f3](https://github.com/dequelabs/axe-core/commit/5c318f3537056be5779cb53374bc6f4785947c91)), closes [#4388](https://github.com/dequelabs/axe-core/issues/4388)
- **invalidrole:** allow upper and mixed case role names ([#4358](https://github.com/dequelabs/axe-core/issues/4358)) ([105016c](https://github.com/dequelabs/axe-core/commit/105016cfe9d82876cfed2ff5c656a7842c5b3761)), closes [#2695](https://github.com/dequelabs/axe-core/issues/2695)
- **isVisibleOnScreen:** account for position: absolute elements inside overflow container ([#4405](https://github.com/dequelabs/axe-core/issues/4405)) ([2940f6e](https://github.com/dequelabs/axe-core/commit/2940f6ee36ba52d8cf089be2a3c8e7c516c81dd6)), closes [#4016](https://github.com/dequelabs/axe-core/issues/4016)
- **label-content-name-mismatch:** better dismiss and wysiwyg symbolic text characters ([#4402](https://github.com/dequelabs/axe-core/issues/4402))
- **region:** Decorative images ignored by region rule ([#4412](https://github.com/dequelabs/axe-core/pull/4412))
- **target-size:** ignore descendant elements in shadow dom ([#4410](https://github.com/dequelabs/axe-core/issues/4410)) ([6091367](https://github.com/dequelabs/axe-core/commit/6091367a20f70e536fc7e8d77eae4fa7232bc7c0))
- **target-size:** pass for element that has nearby elements that are obscured ([#4422](https://github.com/dequelabs/axe-core/issues/4422)) ([3a90bb7](https://github.com/dequelabs/axe-core/commit/3a90bb70c8db087b2f03cc30a4aee756995c311c)), closes [#4387](https://github.com/dequelabs/axe-core/issues/4387)

## [4.9.0](https://github.com/dequelabs/axe-core/compare/v4.8.4...v4.9.0) (2024-03-25)

### Features
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ If you need to debug the unit tests in a browser, you can run:
npm run test:debug
```

This will start the Karma server and open up the Chrome browser. Click the `Debug` button to start debugging the tests. You can also navigate to the listed URL in your browser of choice to debug tests using that browser.
This will start the Karma server and open up the Chrome browser. Click the `Debug` button to start debugging the tests. You can either use that browser's debugger or attach an external debugger on port 9765; [a VS Code launch profile](./.vscode/launch.json) is provided. You can also navigate to the listed URL in your browser of choice to debug tests using that browser.

Because the amount of tests is so large, it's recommended to debug only a specific set of unit tests rather than the whole test suite. You can use the `testDirs` argument when using the debug command and pass a specific test directory. The test directory names are the same as those used for `test:unit:*`:

Expand Down
10 changes: 7 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ module.exports = function (grunt) {
});
} else if (grunt.option('all-lang')) {
var localeFiles = require('fs').readdirSync('./locales');
langs = localeFiles.map(function (file) {
return '.' + file.replace('.json', '');
});
langs = localeFiles
.filter(function (file) {
return !file.startsWith('_') && file.endsWith('.json');
})
.map(function (file) {
return '.' + file.replace('.json', '');
});
langs.unshift(''); // Add default
} else {
langs = [''];
Expand Down
194 changes: 181 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,190 @@
# a11y-engine-axe-core
# axe-core

This is a fork of public Axe core repo:
https://github.com/dequelabs/axe-core
[![License](https://img.shields.io/npm/l/axe-core.svg)](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)
[![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)
[![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)

## Pull latest changes from public axe-core repo
Axe is an accessibility testing engine for websites and other HTML-based user interfaces. It's fast, secure, lightweight, and was built to seamlessly integrate with any existing test environment so you can automate accessibility testing alongside your regular functional testing.

[Sign up for axe news](https://hubs.ly/H0fsN0b0) to get the latest on axe features, future releases, and events.

## The Accessibility Rules

Axe-core has different types of rules, for WCAG 2.0, 2.1, 2.2 on level A, AA and AAA 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. The complete list of rules, grouped WCAG level and best practice, can found in [doc/rule-descriptions.md](./doc/rule-descriptions.md).

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 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/).

## Getting started

First download the package:

```console
npm install axe-core --save-dev
```
# cd into the repo
cd a11y-engine-axe-core

# Add public axe-core repo as remote public
git remote add public [email protected]:dequelabs/axe-core.git
Now include the javascript file in each of your iframes in your fixtures or test systems:

```html
<script src="node_modules/axe-core/axe.min.js"></script>
```

Now insert calls at each point in your tests where a new piece of UI becomes visible or exposed:

```js
axe
.run()
.then(results => {
if (results.violations.length) {
throw new Error('Accessibility issues found');
}
})
.catch(err => {
console.error('Something bad happened:', err.message);
});
```

## Philosophy

The web can only become an accessible, inclusive space if developers are empowered to take responsibility for accessibility testing and accessible coding practices.

Automated accessibility testing is a huge timesaver, it doesn't require special expertise, and it allows teams to focus expert resources on the accessibility issues that really need them. Unfortunately, most accessibility tools are meant to be run on sites and applications that have reached the end of the development process and often don't give clear or consistent results, causing frustration and delays just when you thought your product was ready to ship.

Axe was built to reflect how web development actually works. It works with all modern browsers, tools, and testing environments a dev team might use. With axe, accessibility testing can be performed as part of your unit testing, integration testing, browser testing, and any other functional testing your team already performs on a day-to-day basis. Building accessibility testing into the early development process saves time, resources, and all kinds of frustration.

## About axe - our Manifesto

- Axe is open source.
- It returns zero false positives (bugs notwithstanding).
- It's designed to work on all modern browsers and with whatever tools, frameworks, libraries and environments you use today.
- It's actively supported by [Deque Systems](https://www.deque.com), a major accessibility vendor.
- It integrates with your existing functional/acceptance automated tests.
- It automatically determines which rules to run based on the evaluation context.
- Axe supports in-memory fixtures, static fixtures, integration tests and iframes of infinite depth.
- Axe is highly configurable.

## Supported Browsers

The [axe-core API](doc/API.md) fully supports the following browsers:

- Microsoft Edge v40 and above
- Google Chrome v42 and above
- Mozilla Firefox v38 and above
- Apple Safari v7 and above
- Internet Explorer v11 (DEPRECATED)

Support means that we will fix bugs and attempt to test each browser regularly. Only Chrome and Firefox are currently tested on every pull request.

There is limited support for JSDOM. We will attempt to make all rules compatible with JSDOM but where this is not possible, we recommend turning those rules off. Currently the `color-contrast` rule is known not to work with JSDOM.

We can only support environments where features are either natively supported or polyfilled correctly. We do not support the deprecated v0 Shadow DOM implementation.

## Contents of the API Package

The [axe-core API](doc/API.md) package consists of:

- `axe.js` - the JavaScript file that should be included in your web site under test (API)
- `axe.min.js` - a minified version of the above file

# Creates a merge commit
git pull public master
## Localization

# push the changes to internal private repo
git push origin master
Axe can be built using your local language. To do so, a localization file must be added to the `./locales` directory. This file must be named in the following manner: `<langcode>.json`. To build axe using this locale, instead of the default, run axe with the `--lang` flag, like so:

`grunt build --lang=nl`

or equivalently:

`npm run build -- --lang=nl`

This will create a new build for axe, called `axe.<lang>.js` and `axe.<lang>.min.js`. If you want to build all localized versions, simply pass in `--all-lang` instead. If you want to build multiple localized versions (but not all of them), you can pass in a comma-separated list of languages to the `--lang` flag, like `--lang=nl,ja`.

To create a new translation for axe, start by running `grunt translate --lang=<langcode>`. This will create a json file in the `./locales` directory, with the default English text in it for you to translate. Alternatively, you could copy `./locales/_template.json`. We welcome any localization for axe-core. For details on how to contribute, see the Contributing section below. For details on the message syntax, see [Check Message Template](/doc/check-message-template.md).

To update an existing translation file, re-run `grunt translate --lang=<langcode>`. This will add new messages used in English and remove messages which were not used in English.

Additionally, locale can be applied at runtime by passing a `locale` object to `axe.configure()`. The locale object must be of the same shape as existing locales in the `./locales` directory. For example:

```js
axe.configure({
locale: {
lang: 'de',
rules: {
accesskeys: {
help: 'Der Wert des accesskey-Attributes muss einzigartig sein.'
}
// ...
},
checks: {
abstractrole: {
fail: 'Abstrakte ARIA-Rollen dürfen nicht direkt verwendet werden.'
},
'aria-errormessage': {
// Note: doT (https://github.com/olado/dot) templates are supported here.
fail: 'Der Wert der aria-errormessage ${data.values}` muss eine Technik verwenden, um die Message anzukündigen (z. B., aria-live, aria-describedby, role=alert, etc.).'
}
// ...
}
}
});
```

Axe-core readme: https://github.com/dequelabs/axe-core/blob/v4.9.0/README.md
### Supported Locales

Axe-core supports the following locales. Do note that since locales are contributed by our community, they are not guaranteed to include all translations needed in a release.

- Basque
- Danish
- Dutch
- French
- German
- Hebrew
- Japanese
- Korean
- Norwegian (Bokmål)
- Polish
- Portuguese (Brazilian)
- Spanish
- Greek
- Italian
- Simplified Chinese
- Traditional Chinese

## Updates & Security

Axe-core has a new minor release every 3 to 5 months, which usually introduces new rules and features. We recommend scheduling time to upgrade to these versions. Security updates will be made available for minor version lines up to **18 months old**.

- See [release and support](doc/release-and-support.md) for details on the frequency of releases, long-term support and recommendations on upgrading axe-core.
- See [backward compatibility](doc/backwards-compatibility-doc.md) for details on the types of changes different releases may introduce.

## Deque Trademarks Policy

DEQUE, DEQUELABS, AXE®, and AXE-CORE® are trademarks of Deque Systems, Inc. Use of the Deque trademarks must be in accordance with [Deque's trademark policy](https://www.deque.com/legal/trademarks/).

## Supported ARIA Roles and Attributes.

Refer [axe-core ARIA support](./doc/aria-supported.md) for a complete list of ARIA supported roles and attributes by axe.

## Contributing

Read the [Proposing Axe-core Rules guide](./doc/rule-proposal.md)

Read the [documentation on the architecture](./doc/developer-guide.md)

Read the [documentation on contributing](CONTRIBUTING.md)

## Projects using axe-core

[List of projects using axe-core](doc/projects.md)

## Acknowledgements

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.

## Licenses

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))
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.9.0",
"version": "4.9.1",
"deprecated": true,
"contributors": [
{
Expand Down
4 changes: 3 additions & 1 deletion build/cherry-pick.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env node

const { execSync } = require('child_process');
const conventionalCommitsParser = require('conventional-commits-parser');
const chalk = require('chalk');
Expand Down Expand Up @@ -129,7 +131,7 @@ commitsToCherryPick.forEach(({ hash, type, scope, subject }) => {

try {
execSync(`git cherry-pick ${hash} -X theirs`);
} catch (e) {
} catch {
console.error(
chalk.red.bold('\nAborting cherry-pick and reseting to master')
);
Expand Down
15 changes: 12 additions & 3 deletions build/rule-generator/questions.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ const validateGetRuleName = async input => {
throw new Error(`RULE name conflicts with an existing rule's filename.`);
}
// 3) ensure no rule id overlaps
const ruleSpecs = await glob(`${directories.rules}/**/*.json`);
const ruleSpecs = await glob(`${directories.rules}/**/*.json`, {
posix: true,
absolute: true
});
const axeRulesIds = ruleSpecs.reduce((out, specPath) => {
const spec = require(specPath);
out.push(spec.id);
Expand Down Expand Up @@ -62,7 +65,10 @@ const validateGetCheckName = async input => {
);
}
// 2) ensure no check filename overlaps
const checkSpecs = await glob(`${directories.checks}/**/*.json`);
const checkSpecs = await glob(`${directories.checks}/**/*.json`, {
posix: true,
absolute: true
});
// cannot use `fs.existsSync` here, as we do not know which category of checks to look under
const axeChecksFileNames = checkSpecs.map(
f => f.replace('.json', '').split('/').reverse()[0]
Expand All @@ -71,7 +77,10 @@ const validateGetCheckName = async input => {
throw new Error('CHECK name conflicts with an existing filename.');
}
// 3) ensure no check id overlaps
const ruleSpecs = await glob(`${directories.rules}/**/*.json`);
const ruleSpecs = await glob(`${directories.rules}/**/*.json`, {
posix: true,
absolute: true
});
const axe = require(directories.axePath);
const axeChecksIds = ruleSpecs.reduce((out, specPath) => {
const spec = require(specPath);
Expand Down
8 changes: 5 additions & 3 deletions build/tasks/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ module.exports = function (grunt) {
});

this.files.forEach(function (file) {
const match = file.dest.auto.match(/\.([a-z]{2,3})\.js/);
if (match) {
options.locale = match[1];
// locale will always be the 2nd to last part of the
// filename and in the format of "<name>.<locale>.js"
const parts = file.dest.auto.split('.');
if (parts.length > 2) {
options.locale = parts[parts.length - 2];
}

buildRules(grunt, options, null, function (result) {
Expand Down
2 changes: 1 addition & 1 deletion build/tasks/metadata-function-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function (grunt) {
'// This file is automatically generated using build/tasks/metadata-function-map.js\n';

src.forEach(globPath => {
glob.sync(globPath).forEach(filePath => {
glob.sync(globPath, { posix: true }).forEach(filePath => {
const relativePath = path.relative(
path.dirname(file.dest),
filePath
Expand Down
12 changes: 2 additions & 10 deletions build/tasks/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function fileExists(v, o) {
var exists;
try {
exists = fs.existsSync(file);
} catch (e) {
} catch {
return false;
}
return exists;
Expand Down Expand Up @@ -307,15 +307,7 @@ function validateRule({ tags, metadata }) {
return issues;
}

const miscTags = [
'ACT',
'experimental',
'review-item',
'deprecated',
'a11y-engine',
'a11y-engine-experimental',
'advanced'
];
const miscTags = ['ACT', 'experimental', 'review-item', 'deprecated'];

const categories = [
'aria',
Expand Down
Loading

0 comments on commit 80b5336

Please sign in to comment.