| <html> |
| <head> |
| <script> |
| function log(msg) { |
| document.getElementById('log').appendChild(document.createTextNode(msg + '\n')); |
| } |
| |
| function test() { |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| } |
| |
| window.onfocus = function() { log('main frame focused'); } |
| window.onblur = function() { log('main frame blurred'); } |
| |
| var w = document.getElementById('frame').contentWindow; |
| w.onfocus = function() { log('iframe focused'); } |
| w.onblur = function() { log('iframe blurred'); } |
| |
| if (window.eventSender) { |
| eventSender.mouseMoveTo(1, 300); |
| eventSender.mouseDown(); |
| eventSender.mouseUp(); |
| |
| // We need to "wait" a bit before the next click -- otherwise it is ignored |
| eventSender.leapForward(2000); |
| |
| eventSender.mouseMoveTo(50, 50); |
| eventSender.mouseDown(); |
| eventSender.mouseUp(); |
| |
| eventSender.leapForward(2000); |
| |
| eventSender.mouseMoveTo(1, 300); |
| eventSender.mouseDown(); |
| eventSender.mouseUp(); |
| } |
| } |
| </script> |
| </head> |
| <body onload="test()"> |
| <iframe id="frame" style="width: 100px; height: 100px; margin: 0px; border: 2px solid black;"></iframe> |
| <p>This page tests that frames receive focus events when a click occurs |
| within their content area, and blur events when a click occurs outside |
| their content area.</p> |
| <p>To test, click in the frame and then click on this text.</p> |
| |
| <pre id="log"></pre> |
| </body> |
| </html> |