1 <p>This tests that context menu events are sent to the correct frame when a
2 page is scrolled. To test manually, scroll the page so that the top of the
3 iframe is flush with the top of the web page area, then right-click just below
4 the iframe. You should get a context menu that does not contain any mention of
6 <iframe src=
"about:blank"></iframe>
8 <div style=
"height: 150%"></div>
12 document
.getElementById('log').appendChild(document
.createTextNode(msg
+ "\n"));
15 if (window
.testRunner
)
16 testRunner
.dumpAsText();
18 var frame
= document
.getElementsByTagName('iframe')[0];
20 document
.oncontextmenu = function() { log('PASS: main document received a context menu event'); }
21 frame
.contentDocument
.oncontextmenu = function() { log('FAIL: subframe document received a context menu event'); }
23 if (window
.eventSender
) {
24 window
.scrollTo(0, frame
.offsetTop
);
25 eventSender
.mouseMoveTo(frame
.offsetLeft
+ (frame
.offsetWidth
/ 2), frame
.offsetHeight
+ 5);
26 eventSender
.contextClick();