blob: c1cfad6b44c03ab9973dabb3c52d0b045b19390e [file] [log] [blame]
<!DOCTYPE html>
<style>
body {
height: 2000px;
width: 2000px;
}
#frame {
height: 500px;
width: 200px;
}
</style>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script>
var scrollbarWidth = 15;
var scrollbarHeight = 15;
function frameViewport() {
return frame.contentWindow.visualViewport;
}
async_test(function(t) {
window.onload = t.step_func(function() {
internals.setPageScaleFactor(2);
// The page scale on the root frame shouldn't affect the viewport/scale
// values in the iframe.
var frame = document.getElementById("frame");
frame.contentWindow.scrollTo(10, 15);
assert_equals(frameViewport().width, 200 - scrollbarWidth);
assert_equals(frameViewport().height, 500 - scrollbarHeight);
assert_equals(frameViewport().pageLeft, 10);
assert_equals(frameViewport().pageTop, 15);
assert_equals(frameViewport().offsetLeft, 0);
assert_equals(frameViewport().offsetTop, 0);
assert_equals(frameViewport().scale, 1);
t.done();
});
}, 'Verify viewport dimensions for iframe.');
</script>
<iframe id="frame" srcdoc="
<style>
body {
width: 2000px;
height: 2000px;
}
</style>
"></iframe>