<!DOCTYPE html>
<html>
<body>
<div id="test" contenteditable="true"><div>foo</div>bar</div>
<script src="../../resources/dump-as-markup.js"></script>
<script>
if (window.testRunner)
    testRunner.dumpEditingCallbacks();

Markup.description('This demonstrates a bug in interchange newline handling during paste.\n'
+ 'The selection being pasted into contain multiple blocks, which breaks the old code in paste that handled interchange newlines.')

var s = window.getSelection();
var e = document.getElementById("test");

s.setPosition(e, 0);
s.modify("move", "forward", "character");
s.modify("extend", "forward", "line");
document.execCommand("InsertHTML", false, "<div>bar</div>baz<br class='Apple-interchange-newline'>");

Markup.dump('test');
</script>
</body>
</html>
