blob: 1818b7635ae9c37a43264fec1ff824f9973e0346 [file] [log] [blame]
<!DOCTYPE html>
<style>
iframe {
position: absolute;
left: 100px;
top: 100px;
height: 120px;
width: 120px;
padding: 10px;
border: none;
}
.spacer {
height: 2000px;
}
</style>
<iframe src="data:text/html;charset=utf-8,<html><body style='width:1000px;height:1000px;'>Should be covered by a green overlay.</body></html>"></iframe>
<div id="console"></div>
<div class="spacer"></div>
<script src="../resources/js-test.js"></script>
<script src="../resources/run-after-layout-and-paint.js"></script>
<script src="resources/non-fast-scrollable-region-testing.js"></script>
<script>
window.jsTestIsAsync = true;
description('This test ensures non-fast scrollable areas are calculated ' +
'correctly when page is scaled.');
onload = function() {
if (window.internals)
internals.setPageScaleFactor(2);
else
testFailed('This test requires internals.setPageScaleFactor to be available.');
runAfterLayoutAndPaint(function(){
nonFastScrollableRects = internals.nonFastScrollableRects(document);
shouldBe('nonFastScrollableRects.length', '1');
// The non-fast region in the space of the scaled layer but prints it in
// absolute coordinates so the rect is scaled here.
shouldBeEqualToString('rectToString(nonFastScrollableRects[0])', '[220, 220, 240, 240]');
drawNonFastScrollableRegionOverlays();
finishJSTest();
});
};
</script>