| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 This test ensures that createMarkup puts an interchange newline on the | |
| 5 pasteboard for a selection ending at the end of a block. | |
| 6 | |
| 7 <div id="copy" contenteditable="true"><div><div>foo</div>bar</div>baz</div> | |
| 8 <div id="sample" contenteditable="true">foo</div> | |
| 9 <div id="log"></div> | |
| 10 <script> | |
| 11 test(function() { | |
| 12 if (window.internals) | |
| 13 internals.settings.setEditingBehavior('win'); | |
| 14 | |
| 15 var selection = window.getSelection(); | |
| 16 selection.collapse(document.getElementById('copy'), 0); | |
| 17 selection.modify('move', 'forward', 'word'); | |
| 18 selection.modify('extend', 'forward', 'line'); | |
| 19 selection.modify('extend', 'forward', 'line'); | |
| 20 document.execCommand('copy'); | |
| 21 | |
| 22 var sample = document.getElementById('sample'); | |
| 23 selection.collapse(sample, 0); | |
| 24 selection.modify('move', 'forward', 'word'); | |
| 25 document.execCommand('paste'); | |
| 26 | |
| 27 assert_equals(sample.innerHTML, 'foobar<br>baz'); | |
| 28 assert_true(selection.isCollapsed); | |
| 29 assert_equals(selection.anchorNode, sample.lastChild); | |
| 30 assert_equals(selection.anchorOffset, 3); | |
| 31 }); | |
| 32 </script> | |
| OLD | NEW |