OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <script src="../../resources/js-test.js"></script> |
| 5 <iframe id="frame1" src="data:text/html,<input>" width="800" height="600"></ifra
me> |
| 6 <iframe id="frame2" src="data:text/html,<input>" width="800" height="600"></ifra
me> |
| 7 <script> |
| 8 description('Make sure that clicking on an inactive frame clears existing elemen
t focus.'); |
| 9 jsTestIsAsync = true; |
| 10 var doc; |
| 11 var innerInput; |
| 12 window.onload = function() { |
| 13 doc = window.frames['frame1'].document; |
| 14 innerInput = doc.querySelector('input'); |
| 15 innerInput.focus(); |
| 16 debug('===> Making a frame with a focused element inactive.'); |
| 17 window.frames['frame2'].focus(); |
| 18 // The following check is not important. activeElement is innerInput in IE, |
| 19 // and is body in Firefox in this case. |
| 20 shouldBe('doc.activeElement', 'innerInput'); |
| 21 |
| 22 debug('===> Making the frame active again clicking by a non-focusable elemen
t.'); |
| 23 var iframe1 = document.getElementById('frame1'); |
| 24 eventSender.mouseMoveTo(iframe1.offsetLeft + iframe1.offsetWidth / 2, iframe
1.offsetTop + iframe1.offsetHeight / 2); |
| 25 eventSender.mouseDown(); |
| 26 eventSender.mouseUp(); |
| 27 shouldBe('doc.activeElement', 'doc.body'); |
| 28 finishJSTest(); |
| 29 }; |
| 30 </script> |
| 31 </body> |
| 32 </html> |
OLD | NEW |