OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <body> | 2 <body> |
3 <a href="javascript:" id="target">link</a> | 3 <a href="javascript:" id="target">link</a> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <script> | 5 <script> |
6 jsTestIsAsync = true; | 6 jsTestIsAsync = true; |
7 var target = document.getElementById('target'); | 7 var target = document.getElementById('target'); |
8 target.focus(); | |
9 shouldBe('document.activeElement', 'target'); | |
10 debug('Remove href.'); | |
11 window.onload = function() { | 8 window.onload = function() { |
| 9 debug('Remove href.'); |
| 10 target.focus(); |
| 11 shouldBe('document.activeElement', 'target'); |
12 target.removeAttribute('href'); | 12 target.removeAttribute('href'); |
13 shouldBe('document.activeElement', 'document.body'); | 13 shouldBe('document.activeElement', 'document.body'); |
| 14 |
| 15 debug('Update href.'); |
| 16 target.href = 'javascript:'; |
| 17 target.focus(); |
| 18 target.href = 'javascript:undefined'; |
| 19 shouldBe('document.activeElement', 'target'); |
| 20 |
14 target.remove(); | 21 target.remove(); |
15 finishJSTest(); | 22 finishJSTest(); |
16 }; | 23 }; |
17 </script> | 24 </script> |
18 </body> | 25 </body> |
OLD | NEW |