Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / hidden-iframe-no-focus.html
blob60fdc0826c5245ef6480901bafd25f54e7a78b20
1 <!DOCTYPE html>
3 <p>Press tab twice. The second input should be focused.</p>
5 <input onfocus="notify('a')">
6 <iframe style="display:none"></iframe>
7 <input id="i2" onfocus="notify('b')">
9 <pre id=out>FAIL</pre>
11 <script>
13 function fail()
15 document.getElementById('out').textContent = 'FAIL';
18 function pass()
20 document.getElementById('out').textContent = 'PASS';
23 function notify(msg)
25 if (msg != expected[i++])
26 fail();
29 window.frames[0].document.body.onfocus = fail;
31 var expected = ['a', 'b'];
32 var i = 0;
34 if (window.testRunner)
35 testRunner.dumpAsText();
37 if (window.eventSender) {
38 document.body.focus();
39 eventSender.keyDown('\t');
40 eventSender.keyDown('\t');
42 // Ensure we got 2 focus events.
43 if (i == 2 && document.activeElement.id == 'i2')
44 pass();
47 </script>