18 lines
606 B
HTML
18 lines
606 B
HTML
<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>
|