[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / fast / events / contextmenu-scrolled-page-with-frame.html
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
5 frames.</p>
6 <iframe src="about:blank"></iframe>
7 <pre id="log"></pre>
8 <div style="height: 150%"></div>
9 <script>
10     function log(msg)
11     {
12         document.getElementById('log').appendChild(document.createTextNode(msg + "\n"));
13     }
14
15     if (window.layoutTestController)
16         layoutTestController.dumpAsText();
17
18     var frame = document.getElementsByTagName('iframe')[0];
19
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'); }
22
23     if (window.eventSender) {
24         window.scrollTo(0, frame.offsetTop);
25         eventSender.mouseMoveTo(frame.offsetLeft + (frame.offsetWidth / 2), frame.offsetHeight + 5);
26         eventSender.contextClick();
27     }
28 </script>