Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / 4895428-1.html
blob8822cef2045162d190a350fd84ce3260516ebc84
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p id="description">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>
5 <div id="root">
6 <div id="source" style="border: 1px solid blue;" contenteditable="true"><table border="1"><tr><td id="cell">foo</td></tr></table></div>
7 <div id="destination" style="border: 1px solid red;" contenteditable="true"><br></div>
8 </div>
10 <script src="../../resources/dump-as-markup.js"></script>
11 <script>
12 function runTest() {
13 if (!window.testRunner)
14 return;
16 var cell = document.getElementById("cell");
17 var source = document.getElementById("source");
18 source.focus();
19 document.execCommand("SelectAll");
21 var x, y;
22 x = cell.offsetParent.offsetLeft + cell.offsetLeft + cell.offsetWidth / 2;
23 y = cell.offsetParent.offsetTop + cell.offsetTop + cell.offsetHeight / 2;
24 eventSender.mouseMoveTo(x, y);
25 eventSender.mouseDown();
26 eventSender.leapForward(1000);
28 var destination = document.getElementById("destination");
29 x = destination.offsetParent.offsetLeft + destination.offsetLeft + destination.offsetWidth / 2;
30 y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
32 eventSender.mouseMoveTo(x, y);
33 eventSender.mouseUp();
34 Markup.description(description.textContent);
35 Markup.dump(root);
38 runTest();
39 </script>
40 </body>
41 </html>