Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / iframe-inner-size-scaling.html
bloba0db3f33536cdbf07068be7b3f5fa632c4ed50e5
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <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;
9 function runTest() {
10 frame = document.getElementById('iframe');
11 originalWidth = frame.contentWindow.innerWidth;
12 originalHeight = frame.contentWindow.innerHeight;
14 if (window.internals)
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");
21 finishJSTest();
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);
28 </script>
29 </head>
30 <body style="width: 1000px; height: 1000px">
31 <iframe id="iframe" style="width: 100%; height: 100%;"></iframe>
32 </body>
33 </html>