OLD | NEW |
(Empty) | |
| 1 <!doctype HTML> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../assert_selection.js"></script> |
| 5 <script> |
| 6 test(() => assert_selection( |
| 7 '<div style="width: 2em;"><b><i>foo</i></b> bar</div><div contenteditable>|</d
iv>', |
| 8 selection => { |
| 9 selection.setClipboardData('<b><i>foo</i></b> bar'); |
| 10 selection.document.execCommand('paste'); |
| 11 }, |
| 12 '<div style="width: 2em;"><b><i>foo</i></b> bar</div><div contenteditable><b><
i>foo</i></b> bar|</div>'), |
| 13 '1. Restore the collapsed leading space'); |
| 14 |
| 15 test(() => assert_selection( |
| 16 '<div style="width: 2em;">^<b><i>foo</i></b> bar|</div><div contenteditable id
="editor"></div>', |
| 17 selection => { |
| 18 var copy = selection.document.getElementById('copy'); |
| 19 var editor = selection.document.getElementById('editor'); |
| 20 |
| 21 selection.document.execCommand('copy'); |
| 22 selection.collapse(editor); |
| 23 selection.document.execCommand('paste'); |
| 24 }, |
| 25 '<div style="width: 2em;"><b><i>foo</i></b> bar</div><div contenteditable id="
editor"><b><i>foo</i></b>\u00A0bar|</div>'), |
| 26 '2. Restore the collapsed leading space'); |
| 27 </script> |
OLD | NEW |