OLD | NEW |
1 <!doctype HTML> | 1 <!doctype HTML> |
2 <iframe id="subframe" style="position:relative; top: 100px; left: 100px" srcdoc=
"<img id='target' src='../../fast/images/resources/grid-small.png'>"></iframe> | 2 <iframe id="subframe" style="position:relative; top: 100px; left: 100px" srcdoc=
"<img id='target' src='../../images/resources/grid-small.png'>"></iframe> |
3 <script> | 3 <script> |
4 | 4 |
5 function dragAndDrop() { | 5 function dragAndDrop() { |
6 var target = subframe.contentDocument.getElementById("target"); | 6 var target = subframe.contentDocument.getElementById("target"); |
7 | 7 |
8 var x1 = subframe.offsetLeft + target.offsetLeft; | 8 var x1 = subframe.offsetLeft + target.offsetLeft; |
9 var x2 = subframe.offsetLeft + target.offsetLeft + target.offsetWidth; | 9 var x2 = subframe.offsetLeft + target.offsetLeft + target.offsetWidth; |
10 var y = subframe.offsetTop + target.offsetTop + target.offsetHeight / 2; | 10 var y = subframe.offsetTop + target.offsetTop + target.offsetHeight / 2; |
11 | 11 |
12 subframe.contentWindow.getSelection().setBaseAndExtent(target, 0, target, 1)
; | 12 subframe.contentWindow.getSelection().setBaseAndExtent(target, 0, target, 1)
; |
(...skipping 11 matching lines...) Expand all Loading... |
24 if (window.testRunner) { | 24 if (window.testRunner) { |
25 testRunner.waitUntilDone(); | 25 testRunner.waitUntilDone(); |
26 testRunner.dumpDragImage(); | 26 testRunner.dumpDragImage(); |
27 } else { | 27 } else { |
28 // To run manually, click and select the image in the iframe to try to drag
it. | 28 // To run manually, click and select the image in the iframe to try to drag
it. |
29 document.write("this test does not work in manual mode"); | 29 document.write("this test does not work in manual mode"); |
30 } | 30 } |
31 window.onload = dragAndDrop; | 31 window.onload = dragAndDrop; |
32 | 32 |
33 </script> | 33 </script> |
OLD | NEW |