LEFT | RIGHT |
(no file at all) | |
| 1 <!DOCTYPE html> |
1 <html> | 2 <html> |
2 <script src="../../resources/js-test-pre.js"></script> | 3 <script src="../../resources/js-test-pre.js"></script> |
3 <script> | 4 <script> |
4 description("This tests that innerWidth/innerHeight on an frame window r
eturns the size of the frame itself in CSS pixels, regardless of page scale."); | 5 description("This tests that innerWidth/innerHeight on an frame window r
eturns the size of the frame itself in CSS pixels, regardless of page scale."); |
5 window.jsTestIsAsync = true; | 6 window.jsTestIsAsync = true; |
6 | 7 |
7 function runTest() { | 8 function runTest() { |
8 frame = document.getElementById('iframe'); | 9 frame = document.getElementById('iframe'); |
9 originalWidth = frame.contentWindow.innerWidth; | 10 originalWidth = frame.contentWindow.innerWidth; |
10 originalHeight = frame.contentWindow.innerHeight; | 11 originalHeight = frame.contentWindow.innerHeight; |
11 | 12 |
12 if (window.internals) | 13 if (window.internals) |
13 window.internals.setPageScaleFactor(2, 0, 0); | 14 window.internals.setPageScaleFactor(2, 0, 0); |
14 | 15 |
15 shouldBeNonZero("frame.contentWindow.innerWidth"); | 16 shouldBeNonZero("frame.contentWindow.innerWidth"); |
16 shouldBeNonZero("frame.contentWindow.innerHeight"); | 17 shouldBeNonZero("frame.contentWindow.innerHeight"); |
17 shouldBe("frame.contentWindow.innerWidth", "originalWidth"); | 18 shouldBe("frame.contentWindow.innerWidth", "originalWidth"); |
18 shouldBe("frame.contentWindow.innerHeight", "originalHeight"); | 19 shouldBe("frame.contentWindow.innerHeight", "originalHeight"); |
19 finishJSTest(); | 20 finishJSTest(); |
20 } | 21 } |
21 | 22 |
22 window.onload = function() { | 23 window.onload = function() { |
23 // We must use setTimeout since the innerWidth/innerHeight are not yet
valid for the iframe. | 24 // We must use setTimeout since the innerWidth/innerHeight are not yet
valid for the iframe. |
24 window.setTimeout(runTest, 0); | 25 window.setTimeout(runTest, 0); |
25 } | 26 } |
26 </script> | 27 </script> |
27 <iframe id="iframe" style="width: 100%; height: 100%;"></iframe> | 28 <body style="width: 700px; height: 500px"> |
28 <script src="../../resources/js-test-post.js"></script> | 29 <iframe id="iframe" style="width: 100%; height: 100%;"></iframe> |
| 30 <script src="../../resources/js-test-post.js"></script> |
| 31 </body> |
29 </html> | 32 </html> |
LEFT | RIGHT |