1 description('Test for proper behavior of Range.insertNode(documentFragment) when startContainer != endContainer');
3 var p
= document
.createElement('p');
4 var t1
= document
.createTextNode('12345');
6 var t2
= document
.createTextNode('ABCDE');
8 document
.body
.appendChild(p
);
9 var r
= document
.createRange();
12 shouldBeEqualToString("r.toString()", "ABC");
14 var df
= document
.createDocumentFragment();
15 var t3
= document
.createTextNode("PQR");
16 var t4
= document
.createTextNode("XYZ");
21 shouldBe("p.childNodes.length", "4");
22 shouldBe("p.childNodes[0]", "t1");
23 shouldBe("p.childNodes[1]", "t3");
24 shouldBe("p.childNodes[2]", "t4");
25 shouldBe("p.childNodes[3]", "t2");
27 shouldBeFalse("r.collapsed");
28 shouldBe("r.commonAncestorContainer", "p");
29 shouldBe("r.startContainer", "p");
30 shouldBe("r.startOffset", "1");
31 shouldBe("r.endContainer", "t2");
32 shouldBe("r.endOffset", "3");
33 shouldBeEqualToString("r.toString()", "PQRXYZABC")
35 // clean up after ourselves
36 document
.body
.removeChild(p
);