4 <script src=
"../../../resources/js-test.js"></script>
8 <iframe src=
"about:blank"></iframe>
10 description("Test whether Range.selectNode and Range.selectNodeContents work across documents");
12 var otherDocument
= document
.implementation
.createDocument(null, "doc", null);
13 var elem
= otherDocument
.createElement("elem");
14 otherDocument
.documentElement
.appendChild(elem
);
16 var selectNodeRange
= document
.createRange();
17 selectNodeRange
.selectNode(elem
);
19 shouldBeTrue("selectNodeRange.startContainer === otherDocument.documentElement");
20 shouldBeTrue("selectNodeRange.endContainer === otherDocument.documentElement");
21 shouldBeTrue("selectNodeRange.startContainer.ownerDocument === otherDocument");
22 shouldBeTrue("selectNodeRange.endContainer.ownerDocument === otherDocument");
23 shouldBeTrue("selectNodeRange.cloneContents().ownerDocument === otherDocument");
25 var selectNodeContentsRange
= document
.createRange();
26 selectNodeContentsRange
.selectNodeContents(elem
);
28 shouldBeTrue("selectNodeRange.startContainer === otherDocument.documentElement");
29 shouldBeTrue("selectNodeRange.endContainer === otherDocument.documentElement");
30 shouldBeTrue("selectNodeContentsRange.startContainer.ownerDocument === otherDocument");
31 shouldBeTrue("selectNodeContentsRange.endContainer.ownerDocument === otherDocument");
32 shouldBeTrue("selectNodeRange.cloneContents().ownerDocument === otherDocument");