OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../../../fast/js/resources/js-test-pre.js"></script> |
5 <script> | 5 <script> |
6 function runTest() { | 6 function runTest() { |
7 var label = document.getElementById('label'); | 7 var label = document.getElementById('label'); |
8 var button = document.getElementById('button'); | 8 var button = document.getElementById('button'); |
9 label.focus(); | 9 label.focus(); |
10 debug('Focus should be on the label'); | 10 debug('Focus should be on the label'); |
11 shouldBe('document.activeElement', 'label'); | 11 shouldBe('document.activeElement', 'label'); |
12 eventSender.keyDown('\t'); | 12 eventSender.keyDown('\t'); |
13 debug('Focus should be on the button after pressing tab'); | 13 debug('Focus should be on the button after pressing tab'); |
14 shouldBe('document.activeElement', 'button'); | 14 shouldBe('document.activeElement', 'button'); |
15 eventSender.keyDown('\t', ['shiftKey']); | 15 eventSender.keyDown('\t', ['shiftKey']); |
16 debug('Focus should be on the label after pressing shift+tab'); | 16 debug('Focus should be on the label after pressing shift+tab'); |
17 shouldBe('document.activeElement', 'label'); | 17 shouldBe('document.activeElement', 'label'); |
18 } | 18 } |
19 </script> | 19 </script> |
20 </head> | 20 </head> |
21 <body onload="runTest()"> | 21 <body onload="runTest()"> |
22 <label id="label" contenteditable>I'm editable.</label> | 22 <label id="label" contenteditable>I'm editable.</label> |
23 <button id="button">Just a button</button> | 23 <button id="button">Just a button</button> |
24 <script src="../../../fast/js/resources/js-test-post.js"> </script> | |
25 </body> | 24 </body> |
26 </html> | 25 </html> |
27 | 26 |
OLD | NEW |