blob: 50d62a9295930f18b005316952a25ab9b038fcb9 [file] [log] [blame]
<script src="../../resources/js-test.js"></script>
description("This test ensures that document content width (height) as reported by scrollWidth (scrollHeight) is invariant to changes in page scale factor.");
if (window.internals)
var body = document.body;
// According to CSSOM (
// the scrollWidth of the body element (in Quirks mode) is defined as
// max(document content width, value of innerWidth).
// In this test, we want to measure the document content width (height),
// rather than innerWidth (innerHeight), so we make the body element
// larger than the innerWidth (innerHeight).["width"] = window.innerWidth + 100 + "px";["height"] = window.innerHeight + 100 + "px";
var originalScrollWidth = body.scrollWidth;
var originalScrollHeight = body.scrollHeight;
var scale = 1.1;
if (window.eventSender)
// As we have increased the scale factor, the innerWidth will be less
// as fewer CSS pixels will be rendered in the same viewport, so
// body.scrollWidth (scrollHeight) will still be measuring the document
// content width (height).
shouldBe("body.scrollWidth", "originalScrollWidth");
shouldBe("body.scrollHeight", "originalScrollHeight");