5 document
.getElementById('log').appendChild(document
.createTextNode(msg
+ '\n'));
9 if (window
.testRunner
) {
10 testRunner
.dumpAsText();
13 window
.onfocus = function() { log('main frame focused'); }
14 window
.onblur = function() { log('main frame blurred'); }
16 var w
= document
.getElementById('frame').contentWindow
;
17 w
.onfocus = function() { log('iframe focused'); }
18 w
.onblur = function() { log('iframe blurred'); }
20 if (window
.eventSender
) {
21 eventSender
.mouseMoveTo(1, 300);
22 eventSender
.mouseDown();
23 eventSender
.mouseUp();
25 // We need to "wait" a bit before the next click -- otherwise it is ignored
26 eventSender
.leapForward(2000);
28 eventSender
.mouseMoveTo(50, 50);
29 eventSender
.mouseDown();
30 eventSender
.mouseUp();
32 eventSender
.leapForward(2000);
34 eventSender
.mouseMoveTo(1, 300);
35 eventSender
.mouseDown();
36 eventSender
.mouseUp();
41 <body onload=
"test()">
42 <iframe id=
"frame" style=
"width: 100px; height: 100px; margin: 0px; border: 2px solid black;"></iframe>
43 <p>This page tests that frames receive focus events when a click occurs
44 within their content area, and blur events when a click occurs outside
45 their content area.
</p>
46 <p>To test, click in the frame and then click on this text.
</p>