blob: 3e299b19791dedb0e98db0d76699b871b864e79e [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body id="body">
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that a page with a content inset will not affect the bounds of the main frame scroll view. It will appear as the same as the web area's sbounds");
if (window.accessibilityController) {
var webArea = accessibilityController.rootElement.childAtIndex(0);
var webX = webArea.x;
var webY = webArea.y - webArea.height;
var scrollView = webArea.parentElement();
var scrollViewX = scrollView.x;
// to get what the y that we're expecting, we need to subtract the height, because Cocoa requires the bottom point to be consider the y origin.
var scrollViewY = scrollView.y - scrollView.height;
var scrollViewHeight = scrollView.height;
debug("The position of the web area and the scroll view should be the same when there's no content inset");
shouldBeTrue("webX == scrollViewX && webY == scrollViewY");
debug("\n");
window.internals.setTopContentInset(100);
var newScrollViewHeight = scrollView.height;
var newScrollViewY = scrollView.y - scrollView.height;
debug("After setting the content inset, the new y position should be less than the initial");
shouldBe("newScrollViewY - scrollViewY", "100")
debug("\n");
debug("The content inset also reduces the height of the scroll view, which should be reflected here.");
shouldBeTrue("scrollViewHeight > newScrollViewHeight");
debug("\n");
}
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>