blob: c41896967858600653b7c77f19a2b1934efcce2f [file] [log] [blame]
<html>
<script src="../../resources/js-test-pre.js"></script>
<script>
description("This tests that innerWidth/innerHeight on an frame window returns the size of the frame itself in CSS pixels, regardless of page scale.");
window.jsTestIsAsync = true;
function runTest() {
frame = document.getElementById('iframe');
originalWidth = frame.contentWindow.innerWidth;
originalHeight = frame.contentWindow.innerHeight;
if (window.internals)
window.internals.setPageScaleFactor(2, 0, 0);
shouldBeNonZero("frame.contentWindow.innerWidth");
shouldBeNonZero("frame.contentWindow.innerHeight");
shouldBe("frame.contentWindow.innerWidth", "originalWidth");
shouldBe("frame.contentWindow.innerHeight", "originalHeight");
finishJSTest();
}
window.onload = function() {
// We must use setTimeout since the innerWidth/innerHeight are not yet valid for the iframe.
window.setTimeout(runTest, 0);
}
</script>
<iframe id="iframe" style="width: 100%; height: 100%;"></iframe>
<script src="../../resources/js-test-post.js"></script>
</html>