3 <script src=
"../../../resources/js-test.js"></script>
7 var range
= document
.createRange();
8 range
.selectNodeContents(iframe
);
12 function checkRange() {
13 shouldBe("range.startContainer", "iframe.contentDocument.body");
14 shouldBeTrue("range.collapsed");
17 description("Range set* functions should not throw WRONG_DOCUMENT_ERR.");
18 window
.iframe
= document
.createElement("iframe");
19 document
.body
.appendChild(iframe
);
20 iframe
.contentDocument
.write("<html><head><body>content</body></html>");
22 // Move range start to the iframe document. According to the DOM
23 // Range spec, this should collapse the Range to the new boundary.
24 // http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Changing
25 // http://www.w3.org/TR/dom/#interface-range
27 window
.range
= newRange();
28 shouldNotThrow("range.setStart(iframe.contentDocument.body, 0)");
31 window
.range
= newRange();
32 shouldNotThrow("range.setEnd(iframe.contentDocument.body, 0)");
35 window
.range
= newRange();
36 shouldNotThrow("range.setStartAfter(iframe.contentDocument.body.firstChild)");
39 window
.range
= newRange();
40 shouldNotThrow("range.setStartBefore(iframe.contentDocument.body.firstChild)");
43 window
.range
= newRange();
44 shouldNotThrow("range.setEndAfter(iframe.contentDocument.body.firstChild)");
47 window
.range
= newRange();
48 shouldNotThrow("range.setEndBefore(iframe.contentDocument.body.firstChild)");
51 iframe
.parentNode
.removeChild(iframe
);