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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" id="fail1">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf8">
|
|
5
|
+
<link rel="stylesheet" type="text/css" href="/node_modules/mocha/mocha.css" />
|
|
6
|
+
<script src="/node_modules/mocha/mocha.js"></script>
|
|
7
|
+
<script src="/node_modules/chai/chai.js"></script>
|
|
8
|
+
<script src="/axe.js"></script>
|
|
9
|
+
<script>
|
|
10
|
+
mocha.setup({
|
|
11
|
+
timeout: 10000,
|
|
12
|
+
ui: 'bdd'
|
|
13
|
+
});
|
|
14
|
+
var assert = chai.assert;
|
|
15
|
+
</script>
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
<p>No main content here</p>
|
|
19
|
+
<iframe id="frame1" src="frames/level1-fail.html"></iframe>
|
|
20
|
+
<div id="mocha"></div>
|
|
21
|
+
<script src="landmark-one-main-fail.js"></script>
|
|
22
|
+
<script src="/test/integration/adapter.js"></script>
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
describe('landmark-one-main test failure', function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
var results;
|
|
4
|
+
before(function (done) {
|
|
5
|
+
function start() {
|
|
6
|
+
axe.run({ runOnly: { type: 'rule', values: ['landmark-one-main'] } }, function (err, r) {
|
|
7
|
+
assert.isNull(err);
|
|
8
|
+
results = r;
|
|
9
|
+
done();
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
if (document.readyState !== 'complete') {
|
|
13
|
+
window.addEventListener('load', start);
|
|
14
|
+
} else {
|
|
15
|
+
start();
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe('violations', function () {
|
|
20
|
+
it('should find 1', function () {
|
|
21
|
+
assert.lengthOf(results.violations[0].nodes, 2);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('should find #frame1', function () {
|
|
25
|
+
assert.deepEqual(results.violations[0].nodes[0].target, ['#fail1']);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('should find #frame1, #violation2', function () {
|
|
29
|
+
assert.deepEqual(results.violations[0].nodes[1].target, ['#frame1', '#violation2']);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe('passes', function () {
|
|
34
|
+
it('should find 0', function () {
|
|
35
|
+
assert.lengthOf(results.passes, 0);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('should find 0 inapplicable', function () {
|
|
40
|
+
assert.lengthOf(results.inapplicable, 0);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should find 0 incomplete', function () {
|
|
44
|
+
assert.lengthOf(results.incomplete, 0);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" id="pass1">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf8">
|
|
5
|
+
<link rel="stylesheet" type="text/css" href="/node_modules/mocha/mocha.css" />
|
|
6
|
+
<script src="/node_modules/mocha/mocha.js"></script>
|
|
7
|
+
<script src="/node_modules/chai/chai.js"></script>
|
|
8
|
+
<script src="/axe.js"></script>
|
|
9
|
+
<script>
|
|
10
|
+
mocha.setup({
|
|
11
|
+
timeout: 10000,
|
|
12
|
+
ui: 'bdd'
|
|
13
|
+
});
|
|
14
|
+
var assert = chai.assert;
|
|
15
|
+
</script>
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
<p>No main content</p>
|
|
19
|
+
<iframe id="frame1" src="frames/level1.html"></iframe>
|
|
20
|
+
<div id="mocha"></div>
|
|
21
|
+
<script src="landmark-one-main-pass.js"></script>
|
|
22
|
+
<script src="/test/integration/adapter.js"></script>
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
describe('landmark-one-main test pass', function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
var results;
|
|
4
|
+
before(function (done) {
|
|
5
|
+
function start() {
|
|
6
|
+
axe.run({ runOnly: { type: 'rule', values: ['landmark-one-main'] } }, function (err, r) {
|
|
7
|
+
assert.isNull(err);
|
|
8
|
+
results = r;
|
|
9
|
+
done();
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
if (document.readyState !== 'complete') {
|
|
13
|
+
window.addEventListener('load', start);
|
|
14
|
+
} else {
|
|
15
|
+
start();
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe('violations', function () {
|
|
20
|
+
it('should find 0', function () {
|
|
21
|
+
assert.lengthOf(results.violations, 0);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe('passes', function () {
|
|
26
|
+
it('should find 4', function () {
|
|
27
|
+
assert.lengthOf(results.passes[0].nodes, 4);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should find #pass1', function () {
|
|
31
|
+
assert.deepEqual(results.passes[0].nodes[0].target, ['#pass1']);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('should find #frame1, #pass2', function () {
|
|
35
|
+
assert.deepEqual(results.passes[0].nodes[1].target, ['#frame1', '#pass2']);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should find #frame1, #frame2, #pass3', function () {
|
|
39
|
+
assert.deepEqual(results.passes[0].nodes[2].target, ['#frame1', '#frame2', '#pass3']);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should find #frame1, #frame3, #pass4', function () {
|
|
43
|
+
assert.deepEqual(results.passes[0].nodes[3].target, ['#frame1', '#frame3', '#pass4']);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('should find 0 inapplicable', function () {
|
|
48
|
+
assert.lengthOf(results.inapplicable, 0);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should find 0 incomplete', function () {
|
|
52
|
+
assert.lengthOf(results.incomplete, 0);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
});
|
|
@@ -25,6 +25,16 @@
|
|
|
25
25
|
<li>Home</li>
|
|
26
26
|
<li>Other</li>
|
|
27
27
|
</ul>
|
|
28
|
+
<section aria-labelledby="hdng">
|
|
29
|
+
<h1 id="hdng">Section heading</h1>
|
|
30
|
+
<p>Content</p>
|
|
31
|
+
</section>
|
|
32
|
+
<section aria-label="section 2">
|
|
33
|
+
<p>Content</p>
|
|
34
|
+
</section>
|
|
35
|
+
<section title="section 3">
|
|
36
|
+
<p>Content</p>
|
|
37
|
+
</section>
|
|
28
38
|
<div id="mocha" role="complementary"></div>
|
|
29
39
|
<script src="region-pass.js"></script>
|
|
30
40
|
<script src="/test/integration/adapter.js"></script>
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
<div role="form" id="pass17" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
|
|
37
37
|
|
|
38
|
-
<div role="grid" id="pass18" aria-level="value" aria-multiselectable="value" aria-readonly="value" aria-activedescendant="value" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
|
|
38
|
+
<div role="grid" id="pass18" aria-level="value" aria-multiselectable="value" aria-readonly="value" aria-activedescendant="value" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value" aria-colcount="value" aria-rowcount="value">ok</div>
|
|
39
39
|
|
|
40
40
|
<div role="gridcell" id="pass19" aria-colindex="value" aria-colspan="value" aria-rowindex="value" aria-rowspan="value" aria-selected="value" aria-readonly="value" aria-expanded="value" aria-required="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
|
|
41
41
|
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
|
|
66
66
|
<div role="menubar" id="pass32" aria-activedescendant="value" aria-expanded="value" aria-orientation="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
|
|
67
67
|
|
|
68
|
-
<div role="menuitem" id="pass33" aria-posinset="value" aria-setsize="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
|
|
68
|
+
<div role="menuitem" id="pass33" aria-posinset="value" aria-expanded="value" aria-setsize="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
|
|
69
69
|
|
|
70
70
|
<div role="menuitemcheckbox" id="pass34" aria-checked="value" aria-posinset="value" aria-setsize="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
|
|
71
71
|
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
|
|
86
86
|
<div role="region" id="pass42" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
|
|
87
87
|
|
|
88
|
-
<div role="row" id="pass43" aria-
|
|
88
|
+
<div role="row" id="pass43" aria-colindex="value" aria-rowindex="value" aria-level="value" aria-selected="value" aria-activedescendant="value" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
|
|
89
89
|
|
|
90
90
|
<div role="rowgroup" id="pass44" aria-activedescendant="value" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
|
|
91
91
|
|
|
@@ -136,3 +136,9 @@
|
|
|
136
136
|
<div role="table" id="pass67" aria-colcount="value" aria-rowcount="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
|
|
137
137
|
|
|
138
138
|
<input type="reset" id="pass68" value="Reset" aria-pressed="true"/>
|
|
139
|
+
|
|
140
|
+
<input type="radio" aria-required="true" id="pass69" />
|
|
141
|
+
<div role="radio" aria-required="true" id="pass70">ok</div>
|
|
142
|
+
|
|
143
|
+
<input type="checkbox" aria-required="true" id="pass71" />
|
|
144
|
+
<div role="checkbox" aria-required="true" id="pass72">ok</div>
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
["#pass43"], ["#pass44"], ["#pass45"], ["#pass46"], ["#pass47"], ["#pass48"], ["#pass49"],
|
|
12
12
|
["#pass50"], ["#pass51"], ["#pass52"], ["#pass53"], ["#pass54"], ["#pass55"], ["#pass56"],
|
|
13
13
|
["#pass57"], ["#pass58"], ["#pass59"], ["#pass60"], ["#pass61"], ["#pass62"], ["#pass63"],
|
|
14
|
-
|
|
14
|
+
["#pass64"], ["#pass65"], ["#pass66"], ["#pass67"], ["#pass68"], ["#pass69"], ["#pass70"],
|
|
15
|
+
["#pass71"], ["#pass72"]
|
|
15
16
|
]
|
|
16
|
-
}
|
|
17
|
+
}
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
<div aria-valuemax="stuff" id="violation32">hi</div>
|
|
41
41
|
<div aria-valuemin="stuff" id="violation33">hi</div>
|
|
42
42
|
<div aria-valuenow="stuff" id="violation34">hi</div>
|
|
43
|
+
<div aria-errormessage="violation35-ref" id="violation35">hi</div><div id="violation35-ref"></div>
|
|
43
44
|
</div>
|
|
44
45
|
<h2>Possible False Positives</h2>
|
|
45
46
|
<div>
|
|
@@ -245,6 +246,10 @@
|
|
|
245
246
|
<div aria-valuenow="-.1" id="pass165">hi</div>
|
|
246
247
|
<div aria-valuenow="-412" id="pass166">hi</div>
|
|
247
248
|
<div aria-valuetext="stuff" id="pass167">hi</div>
|
|
249
|
+
<div aria-errormessage="pass168-ref" id="pass168">hi</div><div id="pass168-ref" role="alert"></div>
|
|
250
|
+
<div aria-errormessage="pass68" id="pass169">hi</div>
|
|
251
|
+
<div aria-errormessage="ref" aria-describedby="ref" id="pass170">hi</div>
|
|
252
|
+
|
|
248
253
|
|
|
249
254
|
<div id="ref">Hi</div>
|
|
250
255
|
<div id="ref2">Hi2</div>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
["#violation12"], ["#violation13"], ["#violation14"], ["#violation15"], ["#violation16"], ["#violation17"],
|
|
8
8
|
["#violation18"], ["#violation19"], ["#violation20"], ["#violation21"], ["#violation22"], ["#violation23"],
|
|
9
9
|
["#violation24"], ["#violation25"], ["#violation26"], ["#violation27"], ["#violation28"], ["#violation29"],
|
|
10
|
-
["#violation30"], ["#violation31"], ["#violation32"], ["#violation33"], ["#violation34"]
|
|
10
|
+
["#violation30"], ["#violation31"], ["#violation32"], ["#violation33"], ["#violation34"],["#violation35"]
|
|
11
11
|
],
|
|
12
12
|
"passes": [
|
|
13
13
|
["#pass1"], ["#pass2"], ["#pass3"], ["#pass4"], ["#pass5"], ["#pass6"], ["#pass7"], ["#pass8"], ["#pass9"],
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
["#pass140"], ["#pass141"], ["#pass142"], ["#pass143"], ["#pass144"], ["#pass145"], ["#pass146"],
|
|
32
32
|
["#pass147"], ["#pass148"], ["#pass149"], ["#pass150"], ["#pass151"], ["#pass152"], ["#pass153"],
|
|
33
33
|
["#pass154"], ["#pass155"], ["#pass156"], ["#pass157"], ["#pass158"], ["#pass159"], ["#pass160"],
|
|
34
|
-
|
|
34
|
+
["#pass161"], ["#pass162"], ["#pass163"], ["#pass164"], ["#pass165"], ["#pass166"], ["#pass167"],
|
|
35
|
+
["#pass168"], ["#pass169"], ["#pass170"]
|
|
35
36
|
]
|
|
36
37
|
}
|
|
@@ -8,11 +8,6 @@
|
|
|
8
8
|
<div style="background-color: rgba(255, 255, 255, 0.1); color: white;" id="pass5">Pass.</div>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
|
-
<label id="pass6">
|
|
12
|
-
Default label
|
|
13
|
-
<input type="text">
|
|
14
|
-
</label>
|
|
15
|
-
|
|
16
11
|
<div style="position:relative; height: 40px;">
|
|
17
12
|
<label style="background-color:black; color: white;" id="pass7">
|
|
18
13
|
Label
|
|
@@ -130,7 +130,17 @@ describe('color-contrast-matches', function () {
|
|
|
130
130
|
fixture.innerHTML = '<input type="text" disabled>';
|
|
131
131
|
var target = fixture.querySelector('input');
|
|
132
132
|
assert.isFalse(rule.matches(target));
|
|
133
|
+
});
|
|
133
134
|
|
|
135
|
+
it('should not match a disabled implicit label child', function () {
|
|
136
|
+
fixture.innerHTML = '<label>' +
|
|
137
|
+
'<input type="checkbox" style="position: absolute;display: inline-block;width: 1.5rem;height: 1.5rem;opacity: 0;" disabled checked>' +
|
|
138
|
+
'<span style="background-color:rgba(0, 0, 0, 0.26);display:inline-block;width: 1.5rem;height: 1.5rem;" aria-hidden="true"></span>' +
|
|
139
|
+
'<span style="color:rgba(0, 0, 0, 0.38);" id="target">Baseball</span>' +
|
|
140
|
+
'</label>';
|
|
141
|
+
var target = fixture.querySelector('#target');
|
|
142
|
+
var result = rule.matches(target);
|
|
143
|
+
assert.isFalse(result);
|
|
134
144
|
});
|
|
135
145
|
|
|
136
146
|
it('should not match <textarea disabled>', function () {
|
package/test/runner.tmpl
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var testUtils = {};
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Create a check context for mocking/resetting data and relatedNodes in tests
|
|
5
|
+
*
|
|
6
|
+
* @return Object
|
|
7
|
+
*/
|
|
8
|
+
testUtils.MockCheckContext = function () {
|
|
9
|
+
'use strict';
|
|
10
|
+
return {
|
|
11
|
+
_relatedNodes: [],
|
|
12
|
+
_data: null,
|
|
13
|
+
data: function (d) {
|
|
14
|
+
this._data = d;
|
|
15
|
+
},
|
|
16
|
+
relatedNodes: function (rn) {
|
|
17
|
+
this._relatedNodes = rn;
|
|
18
|
+
},
|
|
19
|
+
reset: function () {
|
|
20
|
+
this._data = null;
|
|
21
|
+
this._relatedNodes = [];
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Method for injecting content into a fixture
|
|
28
|
+
*
|
|
29
|
+
* @param Node|String Stuff to go into the fixture (html or DOM node)
|
|
30
|
+
* @return HTMLElement
|
|
31
|
+
*/
|
|
32
|
+
testUtils.fixtureSetup = function (content) {
|
|
33
|
+
'use strict';
|
|
34
|
+
var fixture = document.querySelector('#fixture');
|
|
35
|
+
if (typeof content === 'string') {
|
|
36
|
+
fixture.innerHTML = content;
|
|
37
|
+
} else if (content instanceof Node) {
|
|
38
|
+
fixture.appendChild(content);
|
|
39
|
+
}
|
|
40
|
+
return fixture;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
axe.testUtils = testUtils;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var axe = require("../../axe");
|
|
3
4
|
var context = document;
|
|
4
5
|
var $fixture = {};
|
|
5
6
|
axe.run(context, {}, function (error, results) {
|
|
@@ -15,6 +16,10 @@ axe.run(context, {}, function (error, results) {
|
|
|
15
16
|
axe.run().then(function (done) {
|
|
16
17
|
done();
|
|
17
18
|
});
|
|
19
|
+
// additional configuration options
|
|
20
|
+
axe.run(context, { iframes: false, selectors: false, elementRef: false }, function (error, results) {
|
|
21
|
+
console.log(results.passes.length);
|
|
22
|
+
});
|
|
18
23
|
// axe.a11yCheck config
|
|
19
24
|
axe.a11yCheck(context, {}, function (results) {
|
|
20
25
|
// axe's results object
|
|
@@ -28,6 +33,10 @@ axe.a11yCheck({ include: [['#id1'], ['#id2']] }, {}, function (results) {
|
|
|
28
33
|
axe.a11yCheck({ exclude: [$fixture[0]] }, {}, function (results) {
|
|
29
34
|
console.log(results);
|
|
30
35
|
});
|
|
36
|
+
// additional configuration options
|
|
37
|
+
axe.a11yCheck(context, { iframes: false, selectors: false, elementRef: false }, function (results) {
|
|
38
|
+
console.log(results.passes.length);
|
|
39
|
+
});
|
|
31
40
|
var tagConfigRunOnly = {
|
|
32
41
|
type: 'tag',
|
|
33
42
|
values: ['wcag2a']
|