OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
5 | 5 |
6 <!-- A link always gets its accessible text from contents. --> | 6 <!-- A link always gets its accessible text from contents. --> |
7 <a id="link" href="#">A</a> | 7 <a id="link" href="#">A</a> |
8 | 8 |
9 <!-- A generic focusable div not get its accessible text from contents. --> | 9 <!-- A generic focusable div not get its accessible text from contents. --> |
10 <div id="div" tabindex="0">B</div> | 10 <div id="div" tabindex="0">B</div> |
(...skipping 14 matching lines...) Expand all Loading... |
25 var link = document.getElementById('link'); | 25 var link = document.getElementById('link'); |
26 link.focus(); | 26 link.focus(); |
27 shouldBe("document.activeElement == link", "true"); | 27 shouldBe("document.activeElement == link", "true"); |
28 window.axLink = accessibilityController.focusedElement; | 28 window.axLink = accessibilityController.focusedElement; |
29 shouldBe("axLink.name", "\"A\""); | 29 shouldBe("axLink.name", "\"A\""); |
30 | 30 |
31 var div = document.getElementById('div'); | 31 var div = document.getElementById('div'); |
32 div.focus(); | 32 div.focus(); |
33 shouldBe("document.activeElement == div", "true"); | 33 shouldBe("document.activeElement == div", "true"); |
34 window.axDiv = accessibilityController.focusedElement; | 34 window.axDiv = accessibilityController.focusedElement; |
35 shouldBe("axDiv.name", "\"\""); | 35 shouldBe("axDiv.name", "\"B\""); |
36 | 36 |
37 var div2 = document.getElementById('div2'); | 37 var div2 = document.getElementById('div2'); |
38 div2.focus(); | 38 div2.focus(); |
39 shouldBe("document.activeElement == div2", "true"); | 39 shouldBe("document.activeElement == div2", "true"); |
40 window.axDiv2 = accessibilityController.focusedElement; | 40 window.axDiv2 = accessibilityController.focusedElement; |
41 shouldBe("axDiv2.name", "\"\""); | 41 shouldBe("axDiv2.name", "\"C\""); |
42 | 42 |
43 var div3 = document.getElementById('div3'); | 43 var div3 = document.getElementById('div3'); |
44 div3.focus(); | 44 div3.focus(); |
45 shouldBe("document.activeElement == div3", "true"); | 45 shouldBe("document.activeElement == div3", "true"); |
46 window.axDiv3 = accessibilityController.focusedElement; | 46 window.axDiv3 = accessibilityController.focusedElement; |
47 shouldBe("axDiv3.name", "\"D\""); | 47 shouldBe("axDiv3.name", "\"D\""); |
48 | 48 |
49 var div4 = document.getElementById('div4'); | 49 var div4 = document.getElementById('div4'); |
50 div4.focus(); | 50 div4.focus(); |
51 shouldBe("document.activeElement == div4", "true"); | 51 shouldBe("document.activeElement == div4", "true"); |
52 window.axDiv4 = accessibilityController.focusedElement; | 52 window.axDiv4 = accessibilityController.focusedElement; |
53 shouldBe("axDiv4.name", "\"\""); | 53 shouldBe("axDiv4.name", "\"Link\""); |
54 | 54 |
55 var div5 = document.getElementById('div5'); | 55 var div5 = document.getElementById('div5'); |
56 div5.focus(); | 56 div5.focus(); |
57 shouldBe("document.activeElement == div5", "true"); | 57 shouldBe("document.activeElement == div5", "true"); |
58 window.axDiv5 = accessibilityController.focusedElement; | 58 window.axDiv5 = accessibilityController.focusedElement; |
59 shouldBe("axDiv5.name", "\"\""); | 59 shouldBe("axDiv5.name", "\"Initial text before linkLink\""); |
60 | 60 |
61 var div6 = document.getElementById('div6'); | 61 var div6 = document.getElementById('div6'); |
62 div6.focus(); | 62 div6.focus(); |
63 shouldBe("document.activeElement == div6", "true"); | 63 shouldBe("document.activeElement == div6", "true"); |
64 window.axDiv6 = accessibilityController.focusedElement; | 64 window.axDiv6 = accessibilityController.focusedElement; |
65 shouldBe("axDiv6.name", "\"\""); | 65 shouldBe("axDiv6.name", "\"List item\""); |
66 | 66 |
67 var div7 = document.getElementById('div7'); | 67 var div7 = document.getElementById('div7'); |
68 div7.focus(); | 68 div7.focus(); |
69 shouldBe("document.activeElement == div7", "true"); | 69 shouldBe("document.activeElement == div7", "true"); |
70 window.axDiv7 = accessibilityController.focusedElement; | 70 window.axDiv7 = accessibilityController.focusedElement; |
71 shouldBe("axDiv7.name", "\"\""); | 71 shouldBe("axDiv7.name", "\"Initial text before list List item\""); |
72 } | 72 } |
73 | 73 |
74 </script> | 74 </script> |
75 | 75 |
76 </body> | 76 </body> |
77 </html> | 77 </html> |
OLD | NEW |