Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Range / compareBoundaryPoints-1.html
blob6144a4c019b7ea9af6158d5c420a30a140d8509c
1 <p>This tests to see that Range::compareBoundaryPoints throws a WrongDocumentError exception if the two ranges are in different documents, or if one is detached.</p>
2 <div id="div" contenteditable="true">dog<a href="http://www.google.com/">food</a></div>
3 <ul id="console"></ul>
5 <script>
6 function log(str) {
7 var console = document.getElementById("console");
8 var li = document.createElement("li");
9 li.appendChild(document.createTextNode(str));
10 console.appendChild(li);
13 if (window.testRunner)
14 window.testRunner.dumpAsText();
16 var div = document.getElementById("div");
17 var text = div.firstChild;
18 var link = div.lastChild;
19 div.focus();
21 text.parentNode.removeChild(text);
23 var r1 = document.createRange();
24 r1.setStart(link, 0);
25 r1.setEnd(link, 0);
27 var r2 = document.createRange();
28 r2.setStart(text, 0);
29 r2.setEnd(text, 0);
31 try {
32 var compare = r1.compareBoundaryPoints(Range.START_TO_START, r2);
33 log("Error. compareBoundaryPoints should have thrown an exception.");
34 } catch (e) {
35 var expected = "WrongDocumentError: Failed to execute 'compareBoundaryPoints' on 'Range': The source range is in a different document than this range.";
36 if (e != expected)
37 log("Error. Exception thrown should have been: " + expected);
39 </script>