Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / tabindex-removal-from-focused-element.html
blob0822e701920203d25b080e23312cf79ca9d516f4
1 <!DOCTYPE html>
2 <body>
3 <div tabindex="0" onclick="this.disabled = true;" id="target">div</div>
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 tabindex.');
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('tabindex');
20 }, 10);
21 setTimeout(function() {
22 testFailed('No blur event');
23 finishJSTest();
24 }, 1000);
26 </script>
27 </body>