OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <div id="description">This tests to make sure that copying and pasting a text fo
llowed by an anchor tag wrapped into 2nd line do not lose the space between text
and tag in the destination.</div> |
| 5 <div id="copy" style="width: 10em; border: thin solid green;">Copy this text <a
href="http://www.google.com">AVeryLongWordThatWillWrap</a></div> |
| 6 <div id="copy2" style="width: 10em; border: thin solid green;">Copy multiple spa
ces <a href="http://www.google.com">AVeryLongWordThatWillWrap</a></div> |
| 7 <div id="paste" contentEditable="true" style="border: thin solid blue;"></div> |
| 8 |
| 9 <script src="../../resources/dump-as-markup.js"></script> |
| 10 <script> |
| 11 |
| 12 Markup.description(document.getElementById('description').textContent); |
| 13 Markup.dump('copy', 'Original'); |
| 14 |
| 15 copy = document.getElementById("copy"); |
| 16 window.getSelection().setBaseAndExtent(copy, 0, copy, copy.childNodes.length); |
| 17 document.execCommand("Copy"); |
| 18 |
| 19 if (window.testRunner) { |
| 20 paste = document.getElementById("paste"); |
| 21 window.getSelection().setPosition(paste, 0); |
| 22 document.execCommand("Paste"); |
| 23 |
| 24 Markup.dump('paste', 'Pasted'); |
| 25 } |
| 26 |
| 27 copy2 = document.getElementById("copy2"); |
| 28 window.getSelection().setBaseAndExtent(copy2, 0, copy2, copy2.childNodes.length)
; |
| 29 document.execCommand("Copy"); |
| 30 |
| 31 if (window.testRunner) { |
| 32 paste = document.getElementById("paste"); |
| 33 window.getSelection().setPosition(paste, 0); |
| 34 document.execCommand("SelectAll"); |
| 35 document.execCommand("Paste"); |
| 36 |
| 37 Markup.dump('paste', 'Pasted2'); |
| 38 } |
| 39 |
| 40 </script> |
| 41 </body> |
| 42 </html> |
OLD | NEW |