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="paste" contentEditable="true" style="border: thin solid blue;"></div> |
| 7 |
| 8 <script src="../../resources/dump-as-markup.js"></script> |
| 9 <script> |
| 10 |
| 11 Markup.description(document.getElementById('description').textContent); |
| 12 Markup.dump('copy', 'Original'); |
| 13 |
| 14 copy = document.getElementById("copy"); |
| 15 window.getSelection().setBaseAndExtent(copy, 0, copy, copy.childNodes.length); |
| 16 document.execCommand("Copy"); |
| 17 |
| 18 if (window.testRunner) { |
| 19 paste = document.getElementById("paste"); |
| 20 window.getSelection().setPosition(paste, 0); |
| 21 document.execCommand("Paste"); |
| 22 |
| 23 Markup.dump('paste', 'Pasted'); |
| 24 } |
| 25 |
| 26 </script> |
| 27 </body> |
| 28 </html> |
OLD | NEW |