| <!DOCTYPE html> |
| <body> |
| <a href="javascript:" id="target">link</a> |
| <script src="../../../resources/js-test.js"></script> |
| <script> |
| jsTestIsAsync = true; |
| var target = document.getElementById('target'); |
| target.focus(); |
| shouldBe('document.activeElement', 'target'); |
| debug('Remove href.'); |
| window.onload = function() { |
| target.removeAttribute('href'); |
| document.body.offsetTop; |
| target.href = 'http://example.com/'; |
| target.focus(); |
| setTimeout(function() { |
| shouldBe('document.activeElement', 'target'); |
| target.remove(); |
| finishJSTest(); |
| }, 10); |
| }; |
| </script> |
| </body> |