axe-core 2.4.1 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/CONTRIBUTING.md +1 -1
- package/appveyor.yml +21 -0
- package/axe.d.ts +1 -1
- package/axe.js +489 -222
- package/axe.min.js +6 -6
- package/bower.json +1 -1
- package/build/sri-update.js +10 -0
- package/build/utils/postinstall.js +3 -3
- package/doc/API.md +16 -2
- package/doc/developer-guide.md +25 -0
- package/doc/examples/jasmine/package.json +1 -1
- package/doc/examples/jest+react/package.json +1 -1
- package/doc/examples/mocha/package.json +1 -1
- package/doc/examples/qunit/package.json +1 -1
- package/doc/examples/selenium/package.json +1 -1
- package/doc/projects.md +2 -1
- package/doc/rule-descriptions.md +2 -0
- package/doc/rule-development.md +56 -10
- package/lib/checks/aria/errormessage.js +25 -0
- package/lib/checks/aria/errormessage.json +11 -0
- package/lib/checks/aria/required-children.js +16 -7
- package/lib/checks/aria/valid-attr-value.js +8 -3
- package/lib/checks/color/color-contrast.js +2 -1
- package/lib/checks/color/color-contrast.json +3 -1
- package/lib/checks/keyboard/has-at-least-one-main-after.js +16 -0
- package/lib/checks/keyboard/has-at-least-one-main.js +3 -0
- package/lib/checks/keyboard/has-at-least-one-main.json +12 -0
- package/lib/checks/keyboard/has-no-more-than-one-main.js +2 -0
- package/lib/checks/keyboard/has-no-more-than-one-main.json +11 -0
- package/lib/checks/keyboard/main-is-top-level.js +15 -0
- package/lib/checks/keyboard/main-is-top-level.json +11 -0
- package/lib/checks/lists/dlitem.js +1 -1
- package/lib/checks/navigation/region.js +15 -4
- package/lib/checks/navigation/skip-link.js +2 -1
- package/lib/commons/aria/attributes.js +19 -7
- package/lib/commons/aria/index.js +26 -15
- package/lib/commons/aria/roles.js +39 -15
- package/lib/commons/color/contrast.js +29 -8
- package/lib/commons/color/element-is-distinct.js +17 -2
- package/lib/commons/color/get-background-color.js +111 -11
- package/lib/commons/color/get-foreground-color.js +5 -2
- package/lib/commons/color/incomplete-data.js +14 -2
- package/lib/commons/color/index.js +6 -0
- package/lib/commons/dom/elements-below-floating.js +3 -1
- package/lib/commons/dom/find-up.js +5 -3
- package/lib/commons/dom/get-element-by-reference.js +11 -2
- package/lib/commons/dom/get-element-coordinates.js +17 -16
- package/lib/commons/dom/get-scroll-offset.js +6 -3
- package/lib/commons/dom/get-viewport-size.js +6 -5
- package/lib/commons/dom/idrefs.js +8 -3
- package/lib/commons/dom/index.js +8 -1
- package/lib/commons/dom/is-focusable.js +28 -9
- package/lib/commons/dom/is-html5.js +11 -2
- package/lib/commons/dom/is-in-text-block.js +6 -2
- package/lib/commons/dom/is-node.js +11 -3
- package/lib/commons/dom/is-offscreen.js +10 -2
- package/lib/commons/dom/is-visible.js +9 -3
- package/lib/commons/dom/is-visual-content.js +8 -5
- package/lib/commons/dom/visually-contains.js +3 -0
- package/lib/commons/dom/visually-overlaps.js +3 -0
- package/lib/commons/index.js +8 -0
- package/lib/commons/table/get-all-cells.js +10 -1
- package/lib/commons/table/get-cell-position.js +7 -4
- package/lib/commons/table/get-headers.js +6 -3
- package/lib/commons/table/get-scope.js +8 -5
- package/lib/commons/table/index.js +8 -1
- package/lib/commons/table/is-column-header.js +8 -5
- package/lib/commons/table/is-data-cell.js +6 -3
- package/lib/commons/table/is-data-table.js +6 -3
- package/lib/commons/table/is-header.js +5 -2
- package/lib/commons/table/is-row-header.js +8 -5
- package/lib/commons/table/to-grid.js +5 -2
- package/lib/commons/table/traverse.js +9 -6
- package/lib/commons/text/accessible-text.js +12 -6
- package/lib/commons/text/index.js +9 -2
- package/lib/commons/text/sanitize.js +10 -1
- package/lib/commons/utils/index.js +9 -3
- package/lib/commons/utils/to-array.js +11 -2
- package/lib/commons/utils/token-list.js +10 -3
- package/lib/commons/utils/valid-langs.js +11 -3
- package/lib/core/base/audit.js +1 -1
- package/lib/core/public/load.js +1 -1
- package/lib/core/reporters/helpers/process-aggregate.js +32 -0
- package/lib/core/reporters/no-passes.js +3 -0
- package/lib/core/utils/{aggregateRule.js → aggregateNodeResults.js} +18 -13
- package/lib/core/utils/check-helper.js +1 -1
- package/lib/core/utils/contains.js +4 -1
- package/lib/core/utils/finalize-result.js +1 -1
- package/lib/core/utils/find-by.js +4 -1
- package/lib/core/utils/get-selector.js +9 -4
- package/lib/core/utils/index.js +8 -1
- package/lib/core/utils/is-hidden.js +4 -1
- package/lib/core/utils/is-xhtml.js +16 -0
- package/lib/core/utils/pollyfills.js +136 -128
- package/lib/core/utils/rule-should-run.js +1 -1
- package/lib/rules/aria-valid-attr-value.json +4 -3
- package/lib/rules/color-contrast-matches.js +1 -1
- package/lib/rules/landmark-main-is-top-level.json +16 -0
- package/lib/rules/landmark-one-main.json +17 -0
- package/lib/rules/th-has-data-cells.json +1 -1
- package/package.json +7 -4
- package/sri-history.json +20 -0
- package/test/checks/aria/allowed-attr.js +13 -1
- package/test/checks/aria/errormessage.js +49 -0
- package/test/checks/aria/required-children.js +34 -4
- package/test/checks/color/color-contrast.js +33 -2
- package/test/checks/index.html +9 -0
- package/test/checks/keyboard/has-at-least-one-main.js +68 -0
- package/test/checks/keyboard/has-no-more-than-one-main.js +34 -0
- package/test/checks/keyboard/main-is-top-level.js +58 -0
- package/test/commons/aria/attributes.js +29 -29
- package/test/commons/aria/roles.js +29 -29
- package/test/commons/color/contrast.js +8 -0
- package/test/commons/color/get-background-color.js +26 -0
- package/test/commons/dom/is-natively-focusable.js +138 -0
- package/test/commons/index.html +3 -0
- package/test/core/base/audit.js +48 -0
- package/test/core/base/check.js +1 -1
- package/test/core/index.html +11 -4
- package/test/core/public/run-rules.js +27 -1
- package/test/core/reporters/helpers/process-aggregate.js +290 -0
- package/test/core/utils/{aggregateRule.js → aggregateNodeResults.js} +10 -14
- package/test/core/utils/finalize-result.js +7 -7
- package/test/core/utils/get-selector.js +14 -0
- package/test/core/utils/is-xhtml.js +21 -0
- package/test/integration/full/async/async.html +29 -0
- package/test/integration/full/async/async.js +102 -0
- package/test/integration/full/definition-list/dlitem-xhtml.js +52 -0
- package/test/integration/full/definition-list/dlitem-xhtml.xhtml +30 -0
- package/test/integration/full/get-selector/get-selector.js +12 -0
- package/test/integration/full/get-selector/get-selector.xhtml +25 -0
- package/test/integration/full/is-xhtml/is-xhtml.js +9 -0
- package/test/integration/full/is-xhtml/is-xhtml.xhtml +24 -0
- package/test/integration/full/landmark-main-is-top-level/frames/level1-fail.html +17 -0
- package/test/integration/full/landmark-main-is-top-level/frames/level1.html +29 -0
- package/test/integration/full/landmark-main-is-top-level/frames/level2-a.html +15 -0
- package/test/integration/full/landmark-main-is-top-level/frames/level2.html +15 -0
- package/test/integration/full/landmark-main-is-top-level/landmark-main-is-top-level-fail.html +29 -0
- package/test/integration/full/landmark-main-is-top-level/landmark-main-is-top-level-fail.js +42 -0
- package/test/integration/full/landmark-main-is-top-level/landmark-main-is-top-level-pass.html +42 -0
- package/test/integration/full/landmark-main-is-top-level/landmark-main-is-top-level-pass.js +36 -0
- package/test/integration/full/landmark-one-main/frames/level1-fail.html +10 -0
- package/test/integration/full/landmark-one-main/frames/level1.html +12 -0
- package/test/integration/full/landmark-one-main/frames/level2-a.html +12 -0
- package/test/integration/full/landmark-one-main/frames/level2.html +10 -0
- package/test/integration/full/landmark-one-main/landmark-one-main-fail.html +24 -0
- package/test/integration/full/landmark-one-main/landmark-one-main-fail.js +46 -0
- package/test/integration/full/landmark-one-main/landmark-one-main-pass.html +24 -0
- package/test/integration/full/landmark-one-main/landmark-one-main-pass.js +55 -0
- package/test/integration/full/region/region-fail.html +3 -0
- package/test/integration/full/region/region-pass.html +10 -0
- package/test/integration/rules/aria-allowed-attr/failures.html +2 -0
- package/test/integration/rules/aria-allowed-attr/failures.json +2 -2
- package/test/integration/rules/aria-allowed-attr/passes.html +9 -3
- package/test/integration/rules/aria-allowed-attr/passes.json +3 -2
- package/test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.html +5 -0
- package/test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.json +3 -2
- package/test/integration/rules/color-contrast/color-contrast.html +0 -5
- package/test/integration/rules/color-contrast/color-contrast.json +0 -2
- package/test/integration/rules/index.html +1 -0
- package/test/rule-matches/color-contrast-matches.js +10 -0
- package/test/rule-matches/index.html +1 -0
- package/test/runner.tmpl +1 -0
- package/test/testutils.js +43 -0
- package/typings/axe-core/axe-core-tests.js +10 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,76 @@
|
|
|
2
2
|
|
|
3
3
|
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
4
|
|
|
5
|
+
<a name="2.6.1"></a>
|
|
6
|
+
# [2.6.1](https://github.com/dequelabs/axe-core/compare/v2.6.0...v2.6.1) (2017-12-28)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* Remove console.log statement
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<a name="2.6.0"></a>
|
|
14
|
+
# [2.6.0](https://github.com/dequelabs/axe-core/compare/v2.5.0...v2.6.0) (2017-12-19)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* Added message about expected contrast ratio ([#381](https://github.com/dequelabs/axe-core/issues/381)) ([#562](https://github.com/dequelabs/axe-core/issues/562)) ([a34c023](https://github.com/dequelabs/axe-core/commit/a34c023))
|
|
20
|
+
* color contrast misc ([#639](https://github.com/dequelabs/axe-core/issues/639)) Closes [#607](https://github.com/dequelabs/axe-core/issues/607), [#556](https://github.com/dequelabs/axe-core/issues/556) ([7cb0325](https://github.com/dequelabs/axe-core/commit/7cb0325))
|
|
21
|
+
* copy precommit hook as file, not a link ([b3bf3d4](https://github.com/dequelabs/axe-core/commit/b3bf3d4))
|
|
22
|
+
* **aria-allowed-attr:** align rowcount, colcount, and colindex with 1.1 spec ([#555](https://github.com/dequelabs/axe-core/issues/555)) ([320ef55](https://github.com/dequelabs/axe-core/commit/320ef55))
|
|
23
|
+
* Ensure overloaded Array.prototype won't crash axe ([8086a67](https://github.com/dequelabs/axe-core/commit/8086a67))
|
|
24
|
+
* **check:** fix bug with async checks ([34bc4f8](https://github.com/dequelabs/axe-core/commit/34bc4f8))
|
|
25
|
+
* **commons/aria:** allow aria-required on checkbox role ([0d7a9a1](https://github.com/dequelabs/axe-core/commit/0d7a9a1))
|
|
26
|
+
* **commons/aria:** allow aria-required on radio role ([31e9f4c](https://github.com/dequelabs/axe-core/commit/31e9f4c))
|
|
27
|
+
* **helpUrl:** Properly parse x.0 versions ([#550](https://github.com/dequelabs/axe-core/issues/550)) ([6457ba4](https://github.com/dequelabs/axe-core/commit/6457ba4))
|
|
28
|
+
* **postinstall:** use node, more conditionals ([#520](https://github.com/dequelabs/axe-core/issues/520)) ([54f7ddd](https://github.com/dequelabs/axe-core/commit/54f7ddd))
|
|
29
|
+
* **rule/dlitem:** use a case-insenstive `tagName` test ([#652](https://github.com/dequelabs/axe-core/issues/652)) ([e67a913](https://github.com/dequelabs/axe-core/commit/e67a913)), closes [#581](https://github.com/dequelabs/axe-core/issues/581)
|
|
30
|
+
* **rules/region:** Treat `<section>` as a landmark if it has an accessible name [#640](https://github.com/dequelabs/axe-core/issues/640) ([#642](https://github.com/dequelabs/axe-core/issues/642)) ([0131458](https://github.com/dequelabs/axe-core/commit/0131458))
|
|
31
|
+
* Polyfills are made non-enumerable [#648](https://github.com/dequelabs/axe-core/issues/648). ([#649](https://github.com/dequelabs/axe-core/issues/649)) ([1ab4629](https://github.com/dequelabs/axe-core/commit/1ab4629))
|
|
32
|
+
* Return inapplicable results ([#473](https://github.com/dequelabs/axe-core/issues/473)). ([0a2a5cc](https://github.com/dequelabs/axe-core/commit/0a2a5cc))
|
|
33
|
+
* try telling circle to skip .git/hooks ([3b88acd](https://github.com/dequelabs/axe-core/commit/3b88acd))
|
|
34
|
+
* update main rules/tests for 2x branch ([b128e92](https://github.com/dequelabs/axe-core/commit/b128e92))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
* **landmark-one-main:** add rule ensuring one main landmark in document ([#498](https://github.com/dequelabs/axe-core/issues/498)) ([ff0a1b8](https://github.com/dequelabs/axe-core/commit/ff0a1b8))
|
|
40
|
+
* add precommit hook on npm postinstall ([122c475](https://github.com/dequelabs/axe-core/commit/122c475))
|
|
41
|
+
* Add rule, landmark-main-is-top-level ([#462](https://github.com/dequelabs/axe-core/issues/462)) ([f007b47](https://github.com/dequelabs/axe-core/commit/f007b47))
|
|
42
|
+
* Improve generated selectors for namespaced elements in XHTML ([#582](https://github.com/dequelabs/axe-core/issues/582)) ([dbe63eb](https://github.com/dequelabs/axe-core/commit/dbe63eb)), closes [#563](https://github.com/dequelabs/axe-core/issues/563)
|
|
43
|
+
* docs: rename `aria._lut`, add to developer guide
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<a name="2.5.0"></a>
|
|
47
|
+
# [2.5.0](https://github.com/dequelabs/axe-core/compare/v2.4.2...v2.5.0) (2017-11-06)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Bug Fixes
|
|
51
|
+
|
|
52
|
+
* **aria-errormessage:** adds support for aria-errormessage ([#517](https://github.com/dequelabs/axe-core/issues/517)) ([465d41d](https://github.com/dequelabs/axe-core/commit/465d41d))
|
|
53
|
+
* adjust aria-errormessage for the 2x branch ([19232e5](https://github.com/dequelabs/axe-core/commit/19232e5))
|
|
54
|
+
* Merge options.resultTypes ([7b28c22](https://github.com/dequelabs/axe-core/commit/7b28c22))
|
|
55
|
+
* Merge required-children.js fix into v2 ([86b4a0e](https://github.com/dequelabs/axe-core/commit/86b4a0e))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### Features
|
|
59
|
+
|
|
60
|
+
* **reporter:** return one result of each type instead of zero when resultTypes is used ([#606](https://github.com/dequelabs/axe-core/issues/606)) ([482374f](https://github.com/dequelabs/axe-core/commit/482374f)), closes [#605](https://github.com/dequelabs/axe-core/issues/605)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
<a name="2.4.2"></a>
|
|
65
|
+
## [2.4.2](https://github.com/dequelabs/axe-core/compare/v2.4.1...v2.4.2) (2017-09-25)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Bug Fixes
|
|
69
|
+
|
|
70
|
+
* **aria:** adding support for aria-expanded in menuitem ([#521](https://github.com/dequelabs/axe-core/issues/521)) ([b4c42fe](https://github.com/dequelabs/axe-core/commit/b4c42fe))
|
|
71
|
+
* Match prerelease versions for helpUrl ([#546](https://github.com/dequelabs/axe-core/issues/546)) ([c166708](https://github.com/dequelabs/axe-core/commit/c166708))
|
|
72
|
+
* fix(node4): use var to declare variables ([#541](https://github.com/dequelabs/axe-core/issues/541)) ([c72badb](https://github.com/dequelabs/axe-core/commit/c72badbd55ef0b56b97f0c64a4eb544e31b4b3f1))
|
|
73
|
+
|
|
74
|
+
|
|
5
75
|
<a name="2.4.1"></a>
|
|
6
76
|
## [2.4.1](https://github.com/dequelabs/axe-core/compare/v2.4.0...v2.4.1) (2017-09-12)
|
|
7
77
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Contributor License Agreement
|
|
4
4
|
|
|
5
|
-
In order to contribute, you must accept the [contributor
|
|
5
|
+
In order to contribute, you must accept the [contributor license agreement](https://cla-assistant.io/dequelabs/axe-core) (CLA). Acceptance of this agreement will be checked automatically and pull requests without a CLA cannot be merged.
|
|
6
6
|
|
|
7
7
|
## Contribution Guidelines
|
|
8
8
|
|
package/appveyor.yml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Test against the latest version of this Node.js version
|
|
2
|
+
environment:
|
|
3
|
+
nodejs_version: "6"
|
|
4
|
+
|
|
5
|
+
# Install scripts. (runs after repo cloning)
|
|
6
|
+
install:
|
|
7
|
+
# Get the latest stable version of Node.js or io.js
|
|
8
|
+
- ps: Install-Product node $env:nodejs_version
|
|
9
|
+
# install modules
|
|
10
|
+
- npm install
|
|
11
|
+
|
|
12
|
+
# Post-install test scripts.
|
|
13
|
+
test_script:
|
|
14
|
+
# Output useful info for debugging.
|
|
15
|
+
- node --version
|
|
16
|
+
- npm --version
|
|
17
|
+
# run tests
|
|
18
|
+
- npm test
|
|
19
|
+
|
|
20
|
+
# Don't actually build.
|
|
21
|
+
build: off
|
package/axe.d.ts
CHANGED