blob: af936d414685dd7f6c7918aedd9dafd7524c1242 [file] [log] [blame]
<p>This tests for a bug in Range::createContextualFragment, it would fail if the range started in a text node. You should see 'The quick brown fox, jumps over the lazy dog" below.</p>
<div id="div" contenteditable="true">The , jumps over the lazy dog.</div>
<script>
if (window.testRunner)
window.testRunner.dumpAsText();
var div = document.getElementById("div");
var text = div.firstChild;
var sel = window.getSelection();
sel.setPosition(text, 4);
var range = sel.getRangeAt(0);
var html = "quick brown fox";
var frag = range.createContextualFragment(html);
range.insertNode(frag);
</script>