[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / fast / events / mouse-drag-from-frame-to-other-frame.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 if (window.layoutTestController) {
6     layoutTestController.waitUntilDone();
7     layoutTestController.dumpAsText();
8 }
9
10 function log(msg) {
11     var msgNode = document.createTextNode(msg);
12     var li = document.createElement("li");
13     li.appendChild(msgNode);
14     document.getElementById("logElem").appendChild(li);
15 }
16 function dragStarted() {
17     log("Drag Started");
18 }
19 window.onmouseup = function() {
20     log("Root frame received mouse up");
21 }
22 window.onload = function() {
23     try {
24         if (!frames[0] || !frames[0].document || !frames[0].document.getElementById("dragSource")) {
25             log("Window.onload fired before subframe completed load.");
26         }
27         
28         if (!window.layoutTestController) {
29             log("This test needs to be run in DRT.  To test manually drag from the text 'Drag Me!' out into the parent frame.");
30             return;
31         }
32         var dragSource = frames[0].document.getElementById("dragSource");
33         var sourceFrame = document.getElementById("sourceFrame");
34         var targetFrame = document.getElementById("targetFrame");
35         var x = dragSource.offsetLeft + sourceFrame.offsetLeft + 10;
36         var y = dragSource.offsetTop + sourceFrame.offsetTop + dragSource.offsetHeight / 2;
37         var x1 = targetFrame.offsetLeft + 10;
38         var y1 = targetFrame.offsetTop + 10;
39         eventSender.mouseMoveTo(x,y);
40         eventSender.mouseDown();
41         eventSender.mouseMoveTo(x1, y1);
42         eventSender.mouseUp();
43     } finally {
44         if (window.layoutTestController)
45             layoutTestController.notifyDone();
46     }
47 }
48 </script>
49 </head>
50 <body>
51     <div>This tests that dragging from an element that returns <emph>false</emph> from its mousedown handler will not let the subsequent mousemove events be captured by the containing frame, and allows the mouse move to get to other subframes.</div>
52     <iframe id="sourceFrame" style="width: 100px; height: 50px;" src="resources/mouse-drag-from-frame-subframe.html"></iframe>
53     <iframe id="targetFrame" style="width: 100px; height: 50px;" src="resources/mouse-drag-from-frame-target-subframe.html"></iframe>
54     <ul id="logElem">
55     </ul>
56 </body>
57 </html>