OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src=../editing.js type="text/javascript"></script> | 3 <script src=../editing.js type="text/javascript"></script> |
4 <script> | 4 <script> |
5 function editingTest() { | 5 function editingTest() { |
6 | 6 |
7 if (!window.eventSender) | 7 if (!window.eventSender) |
8 return; | 8 return; |
| 9 window.getSelection().collapse(dragme.firstChild, 0); |
9 doubleClickAtSelectionStart(); | 10 doubleClickAtSelectionStart(); |
10 | 11 |
11 // Drag 'hello' | 12 // Drag 'hello' |
12 var e = document.getElementById("dragme"); | 13 var e = document.getElementById("dragme"); |
13 x = e.offsetLeft; | 14 x = e.offsetLeft; |
14 y = e.offsetTop + e.offsetHeight / 2; | 15 y = e.offsetTop + e.offsetHeight / 2; |
15 eventSender.mouseMoveTo(x, y); | 16 eventSender.mouseMoveTo(x, y); |
16 eventSender.mouseDown(); | 17 eventSender.mouseDown(); |
17 // and drop it off to the right somewhere. | 18 // and drop it off to the right somewhere. |
18 eventSender.leapForward(500); | 19 eventSender.leapForward(500); |
19 eventSender.mouseMoveTo(x + 300, y); | 20 eventSender.mouseMoveTo(x + 300, y); |
20 eventSender.mouseUp(); | 21 eventSender.mouseUp(); |
21 } | 22 } |
22 </script> | 23 </script> |
23 <title>Drag and drop within a text input field modifies page</title> | 24 <title>Drag and drop within a text input field modifies page</title> |
24 </head> | 25 </head> |
25 <body> | 26 <body> |
26 <p>Tests that drag/drop after double-click does a smart drag. Specifically the e
nd result should have a space: "world hello". To test manually double click on t
he "hello" and drag it to after "world".</p> | 27 <p>Tests that drag/drop after double-click does a smart drag. Specifically the e
nd result should have a space: "world hello". To test manually double click on t
he "hello" and drag it to after "world".</p> |
27 <div contenteditable="true" id="test"><span id="dragme">hello</span> world</div> | 28 <div contenteditable="true" id="test"><span id="dragme">hello</span> world</div> |
28 <script>runEditingTest();</script> | 29 <script>runEditingTest();</script> |
29 </body> | 30 </body> |
30 </html> | 31 </html> |
OLD | NEW |