Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / frames / take-focus-from-iframe.html
blob8671a7680f220c98d08e48140fb6c660fd00c458
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script>
6 window.jsTestIsAsync = true;
7 var target;
9 onload = function()
11 description('Focus can be moved around frames.');
12 document.getElementsByTagName("iframe")[0].focus();
13 frames[0].focus();
14 setTimeout(test2, 0);
17 function test2()
19 focus();
20 target = document.getElementById('target');
21 target.focus();
22 shouldBeTrue('document.activeElement == target');
23 shouldBe('target.selectionStart', '0');
24 shouldBe('target.selectionEnd', '0');
25 document.getElementById('container').outerHTML = '';
26 finishJSTest();
28 </script>
29 </head>
30 <body>
31 <div id="container">
32 <input id="target"><br>
33 <iframe src="data:text/html,<body><input><script>document.querySelector('input').focus()</script></body>" height=40 width=200></iframe>
34 <br>
35 </div>
36 </body>
37 </html>