| <!DOCTYPE html> |
| <html> |
| <body> |
| <p>This tests pasting text ('foo\nbar') into a list item. The last bit of content in the incoming fragment should be merged with the paragraph after the position being pasted into.</p> |
| <div id="test2" contenteditable="true"><ul><li><div>Item 1</div></li></ul></div> |
| <script src="../../resources/dump-as-markup.js"></script> |
| <script src="../editing.js"></script> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpEditingCallbacks(); |
| |
| var e = document.getElementById("test2"); |
| var s = window.getSelection(); |
| |
| Markup.description(document.querySelector('p').textContent); |
| Markup.dump(e, 'Before insertion'); |
| |
| setSelectionCommand(e, 0, e, 0); |
| moveSelectionForwardByWordCommand(); |
| insertHTMLCommand("<div>foo</div><div>bar</div>"); |
| |
| Markup.dump(e, 'After insertion'); |
| </script> |
| </body> |
| </html> |