<!DOCTYPE HTML> <html> <body> <div style="width: 1000px; height: 1000px; position: absolute; top: 0; left: 0;"></div> <div style="width: 100px; height: 100px; position: absolute; top: 100px; left: 0; background: green"></div> <p> Test for <i><a href="rdar://problem/6643103">rdar://problem/6643103</a> Unscaled values from body.scrollHeight</i>. </p> <script src="../../resources/js-test.js"></script> <script> var floatPrecision = 0.00001; function checkValue(actual, expected) { if (window.eventSender) { shouldBeCloseTo(actual, expected, floatPrecision); } } if (window.testRunner) { testRunner.dumpAsText(); checkValue('document.scrollingElement.scrollHeight', 1000) checkValue('document.scrollingElement.scrollWidth', 1000); // Scrolling right to 50. document.scrollingElement.scrollLeft = 50; checkValue('document.scrollingElement.scrollLeft', 50); // Zooming in. eventSender.zoomPageIn(); checkValue('document.scrollingElement.scrollHeight', 1000); checkValue('document.scrollingElement.scrollWidth', 1000); checkValue('document.scrollingElement.scrollTop', 0); checkValue('document.scrollingElement.scrollLeft', 50); // Scrolling down to 100. document.scrollingElement.scrollTop = 100; checkValue('document.scrollingElement.scrollTop', 100); // Zooming back out. eventSender.zoomPageOut(); checkValue('document.scrollingElement.scrollTop', 100); checkValue('document.scrollingElement.scrollLeft', 50); } </script> </body> </html>