| <html> |
| <head> |
| <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script> |
| <script> |
| function editingTest() { |
| // Select "hello " |
| window.getSelection().setBaseAndExtent(test.firstChild, 0, test.firstChild, 7); |
| copyCommand(); |
| moveSelectionForwardByCharacterCommand(); |
| pasteCommand(); |
| // Avoid printing nbsp |
| test.innerHTML = ""; |
| } |
| </script> |
| <title>Editing Test</title> |
| </head> |
| <body> |
| <h1>Smart paste when pasting a word with trailing whitespace after a word and a space before another word.</h1> |
| <p>To run this test manually, select "hello " (including trailing space), copy, and paste.</p> |
| |
| <h2>Expected result</h2> |
| <p>A space should be added between the preexisting word and the word that's pasted. |
| No space should be added after the pasted word: <code>hello hello world</code></p> |
| |
| <h2>Actual result</h2> |
| <div contenteditable id="root"> |
| <div id="test" class="editing" style="font-size: 24px;"> |
| hello world |
| </div> |
| </div> |
| <script> |
| runDumpAsTextEditingTest(); |
| </script> |
| </body> |
| </html> |