Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Range / bug-19527.html
blob80f7f5cbdcaea2182b60c49032f99b4c56950048
1 <body>
2 <p>Test Range.comparePoint and Range.isPointInRange Firefox extensions.</p>
3 <div id=log></div>
4 <script>
5 if (window.testRunner)
6 testRunner.dumpAsText();
8 var hadError = false;
9 function logError(message)
11 document.getElementById("log").innerHTML += message + "<br>";
12 hadError = true;
15 function shouldThrow(expr, exceptionName)
17 try {
18 eval(expr);
19 logError('<code>' + expr + '</code> didn\'t raise an exception');
20 } catch (ex) {
21 if (ex.code != ex[exceptionName])
22 logError('<code>' + expr +'</code> raised a wrong exception: ' + ex.code + ' vs. ' + ex[exceptionName] + ' (' + exceptionName + ')');
26 function shouldBe(expr, expected)
28 try {
29 var actual = eval(expr);
30 if (actual != expected)
31 logError('<code>' + expr + '</code>: actual ' + actual + ", expected " + expected);
32 } catch (ex) {
33 logError('<code>' + expr +'</code> raised an exception: ' + ex);
37 var ra = document.createRange();
38 ra.selectNode(document.getElementsByTagName("p")[0]);
40 shouldThrow("ra.comparePoint(document.createElement('b'), 0)", "WRONG_DOCUMENT_ERR");
41 shouldThrow("ra.comparePoint(null, 0)", "HIERARCHY_REQUEST_ERR");
42 shouldBe("ra.comparePoint(document.body, 0)", -1);
43 shouldBe("ra.comparePoint(document.documentElement, 0)", -1);
44 shouldBe("ra.isPointInRange(document.createElement('b'), 0)", false);
45 shouldBe("ra.isPointInRange(document.documentElement, 0)", false);
46 shouldBe("ra.isPointInRange(document.body, 0)", false);
47 shouldThrow("ra.isPointInRange(null, 0)", "HIERARCHY_REQUEST_ERR");
49 if (!hadError)
50 document.getElementById("log").innerHTML = "PASS";
52 </script>