blob: 1ebbf5d6c705023021badfdc5636ee567bb89577 [file] [log] [blame]
<html>
<head>
<style>
.editing {
border: 2px solid red;
padding: 12px;
font-size: 24px;
}
</style>
<script src="../editing.js"></script>
<script src="../../resources/dump-as-markup.js"></script>
<title>Editing Test</title>
</head>
<body contenteditable id="root">
<div class="editing" id="test">There is a tide in the affairs of men.</div>
<script>
window.getSelection().collapse(document.getElementById('test'), 0);
for (i = 0; i < 31; i++)
moveSelectionForwardByCharacterCommand();
for (i = 0; i < 7; i++)
extendSelectionForwardByCharacterCommand();
copyCommand();
moveSelectionForwardByCharacterCommand();
insertLineBreakCommand();
insertLineBreakCommand();
pasteCommand();
pasteCommand();
Markup.description('There was a bug when pasting at the end of the block. The content was inserted at the start\n'
+ 'the block instead of the end. This tests the insert-at-end case.');
var script = document.getElementsByTagName('script')[2];
script.parentNode.removeChild(script);
Markup.dump('root');
</script>
</body>
</html>