OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
3 <iframe id="nullbody" src="resources/quirks-empty.html"></iframe><br> | 3 <iframe id="nullbody" src="resources/quirks-empty.html"></iframe><br> |
4 <iframe id="nullroot" src="resources/quirks-empty.html"></iframe><br> | 4 <iframe id="nullroot" src="resources/quirks-empty.html"></iframe><br> |
5 <script> | 5 <script> |
6 description("Verifies that asking for the scrollingElement of a document with
null body or null documentElement doesn't crash"); | 6 description("Verifies that asking for the scrollingElement of a document with
null body or null documentElement doesn't crash"); |
7 var jsTestIsAsync = true; | 7 var jsTestIsAsync = true; |
8 | 8 |
9 if (window.internals) | |
10 internals.settings.setScrollTopLeftInteropEnabled(true); | |
11 | |
12 function runtests() | 9 function runtests() |
13 { | 10 { |
14 // Verify scrollTopLeftInterop is actually enabled. | 11 // Verify scrollTopLeftInterop is actually enabled. |
15 shouldBe("document.scrollingElement", "document.documentElement"); | 12 shouldBe("document.scrollingElement", "document.documentElement"); |
16 | 13 |
17 // Verify null body doesn't crash. | 14 // Verify null body doesn't crash. |
18 var nullbody = document.getElementById("nullbody"); | 15 var nullbody = document.getElementById("nullbody"); |
19 nullbody.contentDocument.documentElement.removeChild(nullbody.contentDocumen
t.body); | 16 nullbody.contentDocument.documentElement.removeChild(nullbody.contentDocumen
t.body); |
20 shouldBeEqualToString("nullbody.contentDocument.compatMode", "BackCompat"); | 17 shouldBeEqualToString("nullbody.contentDocument.compatMode", "BackCompat"); |
21 shouldBeNull("nullbody.contentDocument.body"); | 18 shouldBeNull("nullbody.contentDocument.body"); |
(...skipping 13 matching lines...) Expand all Loading... |
35 function onload(e) { | 32 function onload(e) { |
36 e.target.loaded = true; | 33 e.target.loaded = true; |
37 if (nullbody.loaded && nullroot.loaded) | 34 if (nullbody.loaded && nullroot.loaded) |
38 runtests(); | 35 runtests(); |
39 } | 36 } |
40 | 37 |
41 nullbody.addEventListener('load', onload); | 38 nullbody.addEventListener('load', onload); |
42 nullroot.addEventListener('load', onload); | 39 nullroot.addEventListener('load', onload); |
43 | 40 |
44 </script> | 41 </script> |
OLD | NEW |