blob: d8e3b7139113d401b5b71998bdad8c3c3a383b12 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<div contenteditable id="test">
<span style="display:block"><b>This is a paragraph.</b></span>
<span style="display:block"><b>This is another paragraph.</b></span>
</div>
<script src="../editing.js"></script>
<script src="../../resources/dump-as-markup.js"></script>
<script>
Markup.description('This is a test case for the fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=7904.\n'+
'ReplaceSelectionCommand used to guess whether or not nodes in the fragment to be pasted were blocks. It now knows for sure.\n'+
'Before the fix, ReplaceSelectionCommand blew away content of the div below after copy/pasting it over itself.\n'+
'The following two results must be visually identical except for the caret.');
var test = document.getElementById('test');
test.focus();
window.getSelection().setPosition(test, 0);
Markup.dump(test, 'before');
extendSelectionForwardByLineCommand();
extendSelectionForwardByWordCommand();
copyCommand();
pasteCommand();
Markup.dump(test, 'after');
</script>
</body>
</html>