|
11 | 11 | <script src="/node_modules/mocha/mocha.js"></script> |
12 | 12 | <script src="/node_modules/chai/chai.js"></script> |
13 | 13 | <script src="/axe.js"></script> |
| 14 | + <style type="text/css"> |
| 15 | + .sr-only { |
| 16 | + border: 0; |
| 17 | + clip: rect(0 0 0 0); |
| 18 | + clip-path: polygon(0px 0px, 0px 0px, 0px 0px); |
| 19 | + -webkit-clip-path: polygon(0px 0px, 0px 0px, 0px 0px); |
| 20 | + height: 1px; |
| 21 | + margin: -1px; |
| 22 | + overflow: hidden; |
| 23 | + padding: 0; |
| 24 | + position: absolute; |
| 25 | + width: 1px; |
| 26 | + white-space: nowrap; |
| 27 | + } |
| 28 | + </style> |
14 | 29 | <script> |
15 | 30 | mocha.setup({ |
16 | 31 | timeout: 10000, |
|
21 | 36 | </head> |
22 | 37 | <body> |
23 | 38 | <div id="pass1-tgt"></div> |
24 | | - <a href="#pass1-tgt" id="pass1">Link</a> |
| 39 | + <a href="#pass1-tgt" class="sr-only" id="pass1">Link</a> |
25 | 40 |
|
26 | | - <a href="#pass2-tgt" id="pass2">Link</a> |
| 41 | + <a href="#pass2-tgt" style="position: absolute; left: -10000px" id="pass2" |
| 42 | + >Link</a |
| 43 | + > |
27 | 44 |
|
28 | 45 | <div id="pass3-tgt"></div> |
29 | | - <a href="/#pass3-tgt" id="pass3">Link (angular)</a> |
| 46 | + <a href="/#pass3-tgt" class="sr-only" id="pass3">Link (angular)</a> |
30 | 47 |
|
31 | 48 | <div id="canttell1-tgt" style="display:none"></div> |
32 | | - <a href="#canttell1-tgt" id="canttell1">Link</a> |
| 49 | + <a href="#canttell1-tgt" class="sr-only" id="canttell1">Link</a> |
33 | 50 |
|
34 | 51 | <!-- since these elements are page links, they needs to be at the bottom |
35 | 52 | of the test so all the prior links are considered skip links --> |
36 | | - <a name="pass2-tgt"></a> |
| 53 | + <header> |
| 54 | + <ul> |
| 55 | + <li><a id="ignore1" href="/#about">About</a></li> |
| 56 | + <li><a id="ignore2" href="/#contact">Contact</a></li> |
| 57 | + </ul> |
| 58 | + </header> |
37 | 59 |
|
38 | | - <a href="foo#bar" id="ignore1">link</a> |
39 | | - <a href="#" id="ignore2">link</a> |
| 60 | + <h2 name="pass2-tgt">Heading</h2> |
| 61 | + |
| 62 | + <a href="foo#bar" id="ignore3">link</a> |
| 63 | + <a href="#" id="ignore4">link</a> |
40 | 64 | <div id="mocha"></div> |
41 | 65 | <script src="/test/testutils.js"></script> |
42 | 66 | <script src="skip-link-pass.js"></script> |
|
0 commit comments