Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / drop-text-without-selection.html
blobb52725de4d8670e8c4cd90af7bf5911d8c625604
1 <script>
2 if (window.testRunner)
3 testRunner.dumpEditingCallbacks();
4 </script>
5 <body onload="runTest()">
6 <p>
7 This is a test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=8394">http://bugzilla.opendarwin.org/show_bug.cgi?id=8394</a>
8 Editable region does not accept dropped text if there is no selection</i>.
9 </p>
10 <p>
11 The text field should accept drag-and-dropped text, such as the link, even if
12 no text is currently selected.
13 </p>
14 <hr>
15 <input id="field">
16 <a id="link" href="http://www.ibm.com/">drop me into the text field</a>
18 <script>
20 function runTest() {
21 if (!window.testRunner)
22 return;
24 window.testRunner.waitUntilDone();
26 var link = document.getElementById("link");
28 var x = link.offsetLeft + link.offsetWidth / 2;
29 var y = link.offsetTop + link.offsetHeight / 2;
31 eventSender.mouseMoveTo(x, y);
32 eventSender.mouseDown();
33 // Wait a moment so that the mouseDown will kick off a drag instead of starting a new selection.
34 eventSender.leapForward(400);
35 var field = document.getElementById("field");
37 x = field.offsetLeft + field.offsetWidth / 2;
38 y = field.offsetTop + field.offsetHeight / 2;
40 eventSender.mouseMoveTo(x, y);
41 eventSender.mouseUp();
43 window.testRunner.notifyDone();
46 </script>
48 </body>