Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLAnchorElement / remove-href-from-focused-anchor.html
blobd39e652ea1cc1e400d6edd8301d4c6a74bc3bf9f
1 <!DOCTYPE html>
2 <body>
3 <a href="javascript:" id="target">link</a>
4 <script src="../../../resources/js-test.js"></script>
5 <script>
6 jsTestIsAsync = true;
7 var target = document.getElementById('target');
8 target.focus();
9 shouldBe('document.activeElement', 'target');
10 debug('Remove href.');
11 window.onload = function() {
12 target.addEventListener('blur', function() {
13 testPassed('blur event was disaptched.');
14 target.remove();
15 finishJSTest();
16 }, false);
17 // Need to wait until CheckFocusedElementTask is unqueued.
18 setTimeout(function() {
19 target.removeAttribute('href');
20 }, 10);
21 setTimeout(function() {
22 testFailed('No blur event');
23 finishJSTest();
24 }, 2000);
26 </script>
27 </body>