OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <a href="#fragment1" id="link1" tabindex="0">link1</a> | 7 <a href="#fragment1" id="link1" tabindex="0">link1</a> |
8 <a href="#fragment2" id="link2" tabindex="0">link2</a> | 8 <a href="#fragment2" id="link2" tabindex="0">link2</a> |
9 <a href="#fragment3" id="link3" tabindex="0">link3</a> | 9 <a href="#fragment3" id="link3" tabindex="0">link3</a> |
10 <a href="#top" id="link4" tabindex="0">link4</a> | 10 <a href="#top" id="link4" tabindex="0">link4</a> |
(...skipping 14 matching lines...) Expand all Loading... |
25 link1.click(); | 25 link1.click(); |
26 debug("Click the link and verify that focus has moved to the fragment.")
; | 26 debug("Click the link and verify that focus has moved to the fragment.")
; |
27 shouldBe("document.activeElement", "document.getElementById('fragment1')
"); | 27 shouldBe("document.activeElement", "document.getElementById('fragment1')
"); |
28 | 28 |
29 debug("Move focus back to the link and verify."); | 29 debug("Move focus back to the link and verify."); |
30 link1.focus(); | 30 link1.focus(); |
31 shouldBe("document.activeElement", "link1"); | 31 shouldBe("document.activeElement", "link1"); |
32 | 32 |
33 if (window.testRunner) { | 33 if (window.testRunner) { |
34 debug("Send an enter key event which should also trigger focus to mo
ve to the fragment."); | 34 debug("Send an enter key event which should also trigger focus to mo
ve to the fragment."); |
35 eventSender.keyDown("\r"); | 35 eventSender.keyDown("Enter"); |
36 shouldBe("document.activeElement", "document.getElementById('fragmen
t1')"); | 36 shouldBe("document.activeElement", "document.getElementById('fragmen
t1')"); |
37 } | 37 } |
38 | 38 |
39 debug("Activate a link that does not have a focusable fragment and verif
y that the currently focused element is unfocused."); | 39 debug("Activate a link that does not have a focusable fragment and verif
y that the currently focused element is unfocused."); |
40 var link2 = document.getElementById("link2"); | 40 var link2 = document.getElementById("link2"); |
41 link2.focus(); | 41 link2.focus(); |
42 shouldBe("document.activeElement", "link2"); | 42 shouldBe("document.activeElement", "link2"); |
43 link2.click(); | 43 link2.click(); |
44 shouldBe("document.activeElement", "document.body"); | 44 shouldBe("document.activeElement", "document.body"); |
45 | 45 |
(...skipping 27 matching lines...) Expand all Loading... |
73 link6.click(); | 73 link6.click(); |
74 shouldBe("document.activeElement", "input1"); | 74 shouldBe("document.activeElement", "input1"); |
75 if (window.eventSender) { | 75 if (window.eventSender) { |
76 eventSender.keyDown('X'); | 76 eventSender.keyDown('X'); |
77 shouldBeEqualToString("input1.value", "abcXdef"); | 77 shouldBeEqualToString("input1.value", "abcXdef"); |
78 } | 78 } |
79 var successfullyParsed = true; | 79 var successfullyParsed = true; |
80 </script> | 80 </script> |
81 </body> | 81 </body> |
82 </html> | 82 </html> |
OLD | NEW |