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.
Files changed (166) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/CONTRIBUTING.md +1 -1
  3. package/appveyor.yml +21 -0
  4. package/axe.d.ts +1 -1
  5. package/axe.js +489 -222
  6. package/axe.min.js +6 -6
  7. package/bower.json +1 -1
  8. package/build/sri-update.js +10 -0
  9. package/build/utils/postinstall.js +3 -3
  10. package/doc/API.md +16 -2
  11. package/doc/developer-guide.md +25 -0
  12. package/doc/examples/jasmine/package.json +1 -1
  13. package/doc/examples/jest+react/package.json +1 -1
  14. package/doc/examples/mocha/package.json +1 -1
  15. package/doc/examples/qunit/package.json +1 -1
  16. package/doc/examples/selenium/package.json +1 -1
  17. package/doc/projects.md +2 -1
  18. package/doc/rule-descriptions.md +2 -0
  19. package/doc/rule-development.md +56 -10
  20. package/lib/checks/aria/errormessage.js +25 -0
  21. package/lib/checks/aria/errormessage.json +11 -0
  22. package/lib/checks/aria/required-children.js +16 -7
  23. package/lib/checks/aria/valid-attr-value.js +8 -3
  24. package/lib/checks/color/color-contrast.js +2 -1
  25. package/lib/checks/color/color-contrast.json +3 -1
  26. package/lib/checks/keyboard/has-at-least-one-main-after.js +16 -0
  27. package/lib/checks/keyboard/has-at-least-one-main.js +3 -0
  28. package/lib/checks/keyboard/has-at-least-one-main.json +12 -0
  29. package/lib/checks/keyboard/has-no-more-than-one-main.js +2 -0
  30. package/lib/checks/keyboard/has-no-more-than-one-main.json +11 -0
  31. package/lib/checks/keyboard/main-is-top-level.js +15 -0
  32. package/lib/checks/keyboard/main-is-top-level.json +11 -0
  33. package/lib/checks/lists/dlitem.js +1 -1
  34. package/lib/checks/navigation/region.js +15 -4
  35. package/lib/checks/navigation/skip-link.js +2 -1
  36. package/lib/commons/aria/attributes.js +19 -7
  37. package/lib/commons/aria/index.js +26 -15
  38. package/lib/commons/aria/roles.js +39 -15
  39. package/lib/commons/color/contrast.js +29 -8
  40. package/lib/commons/color/element-is-distinct.js +17 -2
  41. package/lib/commons/color/get-background-color.js +111 -11
  42. package/lib/commons/color/get-foreground-color.js +5 -2
  43. package/lib/commons/color/incomplete-data.js +14 -2
  44. package/lib/commons/color/index.js +6 -0
  45. package/lib/commons/dom/elements-below-floating.js +3 -1
  46. package/lib/commons/dom/find-up.js +5 -3
  47. package/lib/commons/dom/get-element-by-reference.js +11 -2
  48. package/lib/commons/dom/get-element-coordinates.js +17 -16
  49. package/lib/commons/dom/get-scroll-offset.js +6 -3
  50. package/lib/commons/dom/get-viewport-size.js +6 -5
  51. package/lib/commons/dom/idrefs.js +8 -3
  52. package/lib/commons/dom/index.js +8 -1
  53. package/lib/commons/dom/is-focusable.js +28 -9
  54. package/lib/commons/dom/is-html5.js +11 -2
  55. package/lib/commons/dom/is-in-text-block.js +6 -2
  56. package/lib/commons/dom/is-node.js +11 -3
  57. package/lib/commons/dom/is-offscreen.js +10 -2
  58. package/lib/commons/dom/is-visible.js +9 -3
  59. package/lib/commons/dom/is-visual-content.js +8 -5
  60. package/lib/commons/dom/visually-contains.js +3 -0
  61. package/lib/commons/dom/visually-overlaps.js +3 -0
  62. package/lib/commons/index.js +8 -0
  63. package/lib/commons/table/get-all-cells.js +10 -1
  64. package/lib/commons/table/get-cell-position.js +7 -4
  65. package/lib/commons/table/get-headers.js +6 -3
  66. package/lib/commons/table/get-scope.js +8 -5
  67. package/lib/commons/table/index.js +8 -1
  68. package/lib/commons/table/is-column-header.js +8 -5
  69. package/lib/commons/table/is-data-cell.js +6 -3
  70. package/lib/commons/table/is-data-table.js +6 -3
  71. package/lib/commons/table/is-header.js +5 -2
  72. package/lib/commons/table/is-row-header.js +8 -5
  73. package/lib/commons/table/to-grid.js +5 -2
  74. package/lib/commons/table/traverse.js +9 -6
  75. package/lib/commons/text/accessible-text.js +12 -6
  76. package/lib/commons/text/index.js +9 -2
  77. package/lib/commons/text/sanitize.js +10 -1
  78. package/lib/commons/utils/index.js +9 -3
  79. package/lib/commons/utils/to-array.js +11 -2
  80. package/lib/commons/utils/token-list.js +10 -3
  81. package/lib/commons/utils/valid-langs.js +11 -3
  82. package/lib/core/base/audit.js +1 -1
  83. package/lib/core/public/load.js +1 -1
  84. package/lib/core/reporters/helpers/process-aggregate.js +32 -0
  85. package/lib/core/reporters/no-passes.js +3 -0
  86. package/lib/core/utils/{aggregateRule.js → aggregateNodeResults.js} +18 -13
  87. package/lib/core/utils/check-helper.js +1 -1
  88. package/lib/core/utils/contains.js +4 -1
  89. package/lib/core/utils/finalize-result.js +1 -1
  90. package/lib/core/utils/find-by.js +4 -1
  91. package/lib/core/utils/get-selector.js +9 -4
  92. package/lib/core/utils/index.js +8 -1
  93. package/lib/core/utils/is-hidden.js +4 -1
  94. package/lib/core/utils/is-xhtml.js +16 -0
  95. package/lib/core/utils/pollyfills.js +136 -128
  96. package/lib/core/utils/rule-should-run.js +1 -1
  97. package/lib/rules/aria-valid-attr-value.json +4 -3
  98. package/lib/rules/color-contrast-matches.js +1 -1
  99. package/lib/rules/landmark-main-is-top-level.json +16 -0
  100. package/lib/rules/landmark-one-main.json +17 -0
  101. package/lib/rules/th-has-data-cells.json +1 -1
  102. package/package.json +7 -4
  103. package/sri-history.json +20 -0
  104. package/test/checks/aria/allowed-attr.js +13 -1
  105. package/test/checks/aria/errormessage.js +49 -0
  106. package/test/checks/aria/required-children.js +34 -4
  107. package/test/checks/color/color-contrast.js +33 -2
  108. package/test/checks/index.html +9 -0
  109. package/test/checks/keyboard/has-at-least-one-main.js +68 -0
  110. package/test/checks/keyboard/has-no-more-than-one-main.js +34 -0
  111. package/test/checks/keyboard/main-is-top-level.js +58 -0
  112. package/test/commons/aria/attributes.js +29 -29
  113. package/test/commons/aria/roles.js +29 -29
  114. package/test/commons/color/contrast.js +8 -0
  115. package/test/commons/color/get-background-color.js +26 -0
  116. package/test/commons/dom/is-natively-focusable.js +138 -0
  117. package/test/commons/index.html +3 -0
  118. package/test/core/base/audit.js +48 -0
  119. package/test/core/base/check.js +1 -1
  120. package/test/core/index.html +11 -4
  121. package/test/core/public/run-rules.js +27 -1
  122. package/test/core/reporters/helpers/process-aggregate.js +290 -0
  123. package/test/core/utils/{aggregateRule.js → aggregateNodeResults.js} +10 -14
  124. package/test/core/utils/finalize-result.js +7 -7
  125. package/test/core/utils/get-selector.js +14 -0
  126. package/test/core/utils/is-xhtml.js +21 -0
  127. package/test/integration/full/async/async.html +29 -0
  128. package/test/integration/full/async/async.js +102 -0
  129. package/test/integration/full/definition-list/dlitem-xhtml.js +52 -0
  130. package/test/integration/full/definition-list/dlitem-xhtml.xhtml +30 -0
  131. package/test/integration/full/get-selector/get-selector.js +12 -0
  132. package/test/integration/full/get-selector/get-selector.xhtml +25 -0
  133. package/test/integration/full/is-xhtml/is-xhtml.js +9 -0
  134. package/test/integration/full/is-xhtml/is-xhtml.xhtml +24 -0
  135. package/test/integration/full/landmark-main-is-top-level/frames/level1-fail.html +17 -0
  136. package/test/integration/full/landmark-main-is-top-level/frames/level1.html +29 -0
  137. package/test/integration/full/landmark-main-is-top-level/frames/level2-a.html +15 -0
  138. package/test/integration/full/landmark-main-is-top-level/frames/level2.html +15 -0
  139. package/test/integration/full/landmark-main-is-top-level/landmark-main-is-top-level-fail.html +29 -0
  140. package/test/integration/full/landmark-main-is-top-level/landmark-main-is-top-level-fail.js +42 -0
  141. package/test/integration/full/landmark-main-is-top-level/landmark-main-is-top-level-pass.html +42 -0
  142. package/test/integration/full/landmark-main-is-top-level/landmark-main-is-top-level-pass.js +36 -0
  143. package/test/integration/full/landmark-one-main/frames/level1-fail.html +10 -0
  144. package/test/integration/full/landmark-one-main/frames/level1.html +12 -0
  145. package/test/integration/full/landmark-one-main/frames/level2-a.html +12 -0
  146. package/test/integration/full/landmark-one-main/frames/level2.html +10 -0
  147. package/test/integration/full/landmark-one-main/landmark-one-main-fail.html +24 -0
  148. package/test/integration/full/landmark-one-main/landmark-one-main-fail.js +46 -0
  149. package/test/integration/full/landmark-one-main/landmark-one-main-pass.html +24 -0
  150. package/test/integration/full/landmark-one-main/landmark-one-main-pass.js +55 -0
  151. package/test/integration/full/region/region-fail.html +3 -0
  152. package/test/integration/full/region/region-pass.html +10 -0
  153. package/test/integration/rules/aria-allowed-attr/failures.html +2 -0
  154. package/test/integration/rules/aria-allowed-attr/failures.json +2 -2
  155. package/test/integration/rules/aria-allowed-attr/passes.html +9 -3
  156. package/test/integration/rules/aria-allowed-attr/passes.json +3 -2
  157. package/test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.html +5 -0
  158. package/test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.json +3 -2
  159. package/test/integration/rules/color-contrast/color-contrast.html +0 -5
  160. package/test/integration/rules/color-contrast/color-contrast.json +0 -2
  161. package/test/integration/rules/index.html +1 -0
  162. package/test/rule-matches/color-contrast-matches.js +10 -0
  163. package/test/rule-matches/index.html +1 -0
  164. package/test/runner.tmpl +1 -0
  165. package/test/testutils.js +43 -0
  166. 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 licence 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.
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
@@ -1,4 +1,4 @@
1
- // Type definitions for axe-core 2.4.0
1
+ // Type definitions for axe-core 2.6.1
2
2
  // Project: https://github.com/dequelabs/axe-core
3
3
  // Definitions by: Marcy Sutton <https://github.com/marcysutton>
4
4