| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <body> | 2 <body> |
| 3 <script> | 3 <script> |
| 4 function debug(msg) { | 4 function debug(msg) { |
| 5 var console = document.getElementById('console'); | 5 var console = document.getElementById('console'); |
| 6 var line = document.createElement('div'); | 6 var line = document.createElement('div'); |
| 7 line.textContent = msg; | 7 line.textContent = msg; |
| 8 console.appendChild(line); | 8 console.appendChild(line); |
| 9 } | 9 } |
| 10 | 10 |
| 11 function editingTest() { | 11 function editingTest() { |
| 12 if (!window.testRunner) | 12 if (!window.testRunner) |
| 13 return; | 13 return; |
| 14 | 14 |
| 15 testRunner.dumpAsText(); | 15 testRunner.dumpAsText(); |
| 16 testRunner.waitUntilDone(); | 16 testRunner.waitUntilDone(); |
| 17 | 17 |
| 18 // Drag a word in the textarea | 18 // Drag a word in the textarea |
| 19 var textarea = document.getElementById("textarea"); | 19 var textarea = document.getElementById("textarea"); |
| 20 textarea.focus(); |
| 20 textarea.setSelectionRange(0, 4); | 21 textarea.setSelectionRange(0, 4); |
| 21 x = textarea.offsetLeft + 10; | 22 x = textarea.offsetLeft + 10; |
| 22 y = textarea.offsetTop + textarea.offsetHeight / 2; | 23 y = textarea.offsetTop + textarea.offsetHeight / 2; |
| 23 eventSender.mouseMoveTo(x, y); | 24 eventSender.mouseMoveTo(x, y); |
| 24 eventSender.mouseDown(); | 25 eventSender.mouseDown(); |
| 25 // and drop it off to the input field | 26 // and drop it off to the input field |
| 26 var input = document.getElementById("destination"); | 27 var input = document.getElementById("destination"); |
| 27 eventSender.leapForward(500); | 28 eventSender.leapForward(500); |
| 28 eventSender.mouseMoveTo(input.offsetLeft + 10, input.offsetTop + input.offse
tHeight / 2); | 29 eventSender.mouseMoveTo(input.offsetLeft + 10, input.offsetTop + input.offse
tHeight / 2); |
| 29 eventSender.mouseUp(); | 30 eventSender.mouseUp(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 49 <p>This tests text selection drag from a textarea and drop to an input, and vice
versa. | 50 <p>This tests text selection drag from a textarea and drop to an input, and vice
versa. |
| 50 There was a bug of an assertion failure in a case of the selected text was | 51 There was a bug of an assertion failure in a case of the selected text was |
| 51 longer than the destination text.</p> | 52 longer than the destination text.</p> |
| 52 <div id=console></div> | 53 <div id=console></div> |
| 53 <input id=destination> | 54 <input id=destination> |
| 54 <textarea id=textarea rows=1>What steps will reproduce the problem? | 55 <textarea id=textarea rows=1>What steps will reproduce the problem? |
| 55 </textarea> | 56 </textarea> |
| 56 <script>editingTest();</script> | 57 <script>editingTest();</script> |
| 57 </body> | 58 </body> |
| 58 </html> | 59 </html> |
| OLD | NEW |