| <p>This tests dragging a selected table by mousing down on the contents of one of its cells. It should be in the red bordered area.</p> |
| <div id="source" style="border: 1px solid blue;" contenteditable="true"><table border="1"><tr><td id="cell">foo</td></tr></table></div> |
| <div id="destination" style="border: 1px solid red;" contenteditable="true"><br></div> |
| |
| <script> |
| function runTest() { |
| if (!window.layoutTestController) |
| return; |
| |
| var cell = document.getElementById("cell"); |
| var source = document.getElementById("source"); |
| source.focus(); |
| document.execCommand("SelectAll"); |
| |
| var x, y; |
| x = cell.offsetParent.offsetLeft + cell.offsetLeft + cell.offsetWidth / 2; |
| y = cell.offsetParent.offsetTop + cell.offsetTop + cell.offsetHeight / 2; |
| eventSender.mouseMoveTo(x, y); |
| eventSender.mouseDown(); |
| eventSender.leapForward(1000); |
| |
| var destination = document.getElementById("destination"); |
| x = destination.offsetParent.offsetLeft + destination.offsetLeft + destination.offsetWidth / 2; |
| y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2; |
| |
| eventSender.mouseMoveTo(x, y); |
| eventSender.mouseUp(); |
| } |
| |
| runTest(); |
| </script> |