| <!DOCTYPE html> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <p>This tests inserting a paragraph separator after a horizontal rule. You should see 'foo', empty paragraph, horizontal rule, 'bar', and the caret should be just after the horizontal rule. <b>This demonstrates 8345. The caret after a horizontal rule is drawn in the same location as the caret before a horizontal rule.</p> |
| <div contenteditable="true" id="div">foo<hr>bar</div> |
| <div id="log"></div> |
| <script> |
| test(function() { |
| if (window.internals) |
| internals.settings.setEditingBehavior('mac'); |
| var selection = window.getSelection(); |
| var div = document.getElementById('div'); |
| selection.collapse(div, 0); |
| selection.modify('move', 'forward', 'word'); |
| selection.modify('move', 'forward', 'character'); |
| selection.modify('move', 'forward', 'character'); |
| document.execCommand('insertParagraph'); |
| |
| assert_equals(div.innerHTML, 'foo<hr><br>bar'); |
| }); |
| </script> |