3 <script src=
"../../../resources/js-test.js"></script>
7 description('Test Range.insertNode(fragment) when the fragment is empty and the range is collapsed');
9 var p
= document
.createElement('p');
10 var t1
= document
.createTextNode('12345');
12 var t2
= document
.createTextNode('ABCDE');
14 document
.body
.appendChild(p
);
15 var r
= document
.createRange();
18 shouldBeEqualToString("r.toString()", "");
20 var df
= document
.createDocumentFragment();
23 shouldBe("p.childNodes.length", "2");
24 shouldBe("p.childNodes[0]", "t1");
25 shouldBe("p.childNodes[1]", "t2");
27 shouldBeTrue("r.collapsed");
28 shouldBe("r.startContainer", "p");
29 shouldBe("r.startOffset", "1");
30 shouldBe("r.endContainer", "p");
31 shouldBe("r.endOffset", "1");
32 shouldBeEqualToString("r.toString()", "")
34 document
.body
.removeChild(p
);