Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Range / set-wrong-document-err.html
blob1a428954911a2f6a416d26f27164fefbbefbf9ec
1 <!DOCTYPE html>
2 <body>
3 <script src="../../../resources/js-test.js"></script>
4 <script>
6 function newRange() {
7 var range = document.createRange();
8 range.selectNodeContents(iframe);
9 return range;
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)");
29 checkRange();
31 window.range = newRange();
32 shouldNotThrow("range.setEnd(iframe.contentDocument.body, 0)");
33 checkRange();
35 window.range = newRange();
36 shouldNotThrow("range.setStartAfter(iframe.contentDocument.body.firstChild)");
37 checkRange();
39 window.range = newRange();
40 shouldNotThrow("range.setStartBefore(iframe.contentDocument.body.firstChild)");
41 checkRange();
43 window.range = newRange();
44 shouldNotThrow("range.setEndAfter(iframe.contentDocument.body.firstChild)");
45 checkRange();
47 window.range = newRange();
48 shouldNotThrow("range.setEndBefore(iframe.contentDocument.body.firstChild)");
49 checkRange();
51 iframe.parentNode.removeChild(iframe);
52 </script>
53 </body>