| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../js/resources/js-test-pre.js"></script> | 4 <script src="../js/resources/js-test-pre.js"></script> |
| 5 <script> | 5 <script> |
| 6 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."); | 6 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."); |
| 7 window.jsTestIsAsync = true; | 7 window.jsTestIsAsync = true; |
| 8 | 8 |
| 9 function runTest() { | 9 function runTest() { |
| 10 frame = document.getElementById('iframe'); | 10 frame = document.getElementById('iframe'); |
| 11 originalWidth = frame.contentWindow.innerWidth; | 11 originalWidth = frame.contentWindow.innerWidth; |
| 12 originalHeight = frame.contentWindow.innerHeight; | 12 originalHeight = frame.contentWindow.innerHeight; |
| 13 | 13 |
| 14 if (window.internals) | 14 if (window.eventSender) |
| 15 window.internals.setPageScaleFactor(2, 0, 0); | 15 window.eventSender.setPageScaleFactor(2, 0, 0); |
| 16 | 16 |
| 17 shouldBeNonZero("frame.contentWindow.innerWidth"); | 17 shouldBeNonZero("frame.contentWindow.innerWidth"); |
| 18 shouldBeNonZero("frame.contentWindow.innerHeight"); | 18 shouldBeNonZero("frame.contentWindow.innerHeight"); |
| 19 shouldBe("frame.contentWindow.innerWidth", "originalWidth"); | 19 shouldBe("frame.contentWindow.innerWidth", "originalWidth"); |
| 20 shouldBe("frame.contentWindow.innerHeight", "originalHeight"); | 20 shouldBe("frame.contentWindow.innerHeight", "originalHeight"); |
| 21 finishJSTest(); | 21 finishJSTest(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 window.onload = function() { | 24 window.onload = function() { |
| 25 // We must use setTimeout since the innerWidth/innerHeight are not yet
valid for the iframe. | 25 // We must use setTimeout since the innerWidth/innerHeight are not yet
valid for the iframe. |
| 26 window.setTimeout(runTest, 0); | 26 window.setTimeout(runTest, 0); |
| 27 } | 27 } |
| 28 </script> | 28 </script> |
| 29 </head> | 29 </head> |
| 30 <body style="width: 1000px; height: 1000px"> | 30 <body style="width: 1000px; height: 1000px"> |
| 31 <iframe id="iframe" style="width: 100%; height: 100%;"></iframe> | 31 <iframe id="iframe" style="width: 100%; height: 100%;"></iframe> |
| 32 <script src="../js/resources/js-test-post.js"></script> | 32 <script src="../js/resources/js-test-post.js"></script> |
| 33 </body> | 33 </body> |
| 34 </html> | 34 </html> |
| OLD | NEW |