| OLD | NEW |
| 1 <body> | 1 <body> |
| 2 <p>Test Range.comparePoint and Range.isPointInRange Firefox extensions.</p> | 2 <p>Test Range.comparePoint and Range.isPointInRange Firefox extensions.</p> |
| 3 <div id=log></div> | 3 <div id=log></div> |
| 4 <script> | 4 <script> |
| 5 if (window.testRunner) | 5 if (window.testRunner) |
| 6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
| 7 | 7 |
| 8 var hadError = false; | 8 var hadError = false; |
| 9 function logError(message) | 9 function logError(message) |
| 10 { | 10 { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 shouldThrow("ra.comparePoint(document.createElement('b'), 0)", "WRONG_DOCUMENT_E
RR"); | 40 shouldThrow("ra.comparePoint(document.createElement('b'), 0)", "WRONG_DOCUMENT_E
RR"); |
| 41 shouldThrow("ra.comparePoint(null, 0)", "HIERARCHY_REQUEST_ERR"); | 41 shouldThrow("ra.comparePoint(null, 0)", "HIERARCHY_REQUEST_ERR"); |
| 42 shouldBe("ra.comparePoint(document.body, 0)", -1); | 42 shouldBe("ra.comparePoint(document.body, 0)", -1); |
| 43 shouldBe("ra.comparePoint(document.documentElement, 0)", -1); | 43 shouldBe("ra.comparePoint(document.documentElement, 0)", -1); |
| 44 shouldBe("ra.isPointInRange(document.createElement('b'), 0)", false); | 44 shouldBe("ra.isPointInRange(document.createElement('b'), 0)", false); |
| 45 shouldBe("ra.isPointInRange(document.documentElement, 0)", false); | 45 shouldBe("ra.isPointInRange(document.documentElement, 0)", false); |
| 46 shouldBe("ra.isPointInRange(document.body, 0)", false); | 46 shouldBe("ra.isPointInRange(document.body, 0)", false); |
| 47 shouldThrow("ra.isPointInRange(null, 0)", "HIERARCHY_REQUEST_ERR"); | 47 shouldThrow("ra.isPointInRange(null, 0)", "HIERARCHY_REQUEST_ERR"); |
| 48 | 48 |
| 49 ra.detach(); | |
| 50 | |
| 51 shouldThrow("ra.comparePoint(document.createElement('b'), 0)", "INVALID_STATE_ER
R"); | |
| 52 shouldThrow("ra.comparePoint(document.body, 0)", "INVALID_STATE_ERR"); | |
| 53 shouldThrow("ra.comparePoint(null, 0)", "INVALID_STATE_ERR"); | |
| 54 shouldThrow("ra.isPointInRange(document.createElement('b'), 0)", "INVALID_STATE_
ERR"); | |
| 55 shouldThrow("ra.isPointInRange(document.body, 0)", "INVALID_STATE_ERR"); | |
| 56 shouldThrow("ra.isPointInRange(null, 0)", "INVALID_STATE_ERR"); | |
| 57 | |
| 58 if (!hadError) | 49 if (!hadError) |
| 59 document.getElementById("log").innerHTML = "PASS"; | 50 document.getElementById("log").innerHTML = "PASS"; |
| 60 | 51 |
| 61 </script> | 52 </script> |
| OLD | NEW |