4 <script src=
"../../resources/js-test.js"></script>
6 description("This tests that innerWidth/innerHeight on an frame window returns the size of the frame itself in CSS pixels, regardless of page scale.");
7 window
.jsTestIsAsync
= true;
10 frame
= document
.getElementById('iframe');
11 originalWidth
= frame
.contentWindow
.innerWidth
;
12 originalHeight
= frame
.contentWindow
.innerHeight
;
15 window
.internals
.setPageScaleFactor(2);
17 shouldBeNonZero("frame.contentWindow.innerWidth");
18 shouldBeNonZero("frame.contentWindow.innerHeight");
19 shouldBe("frame.contentWindow.innerWidth", "originalWidth");
20 shouldBe("frame.contentWindow.innerHeight", "originalHeight");
24 window
.onload = function() {
25 // We must use setTimeout since the innerWidth/innerHeight are not yet valid for the iframe.
26 window
.setTimeout(runTest
, 0);
30 <body style=
"width: 1000px; height: 1000px">
31 <iframe id=
"iframe" style=
"width: 100%; height: 100%;"></iframe>