gecko-dev/layout/reftests/scrolling/subpixel-1.html
Robert O'Callahan fede4b2197 Bug 754556. Ensure that setting scroll positions in CSS pixels doesn't unexpectedly move the scroll position, especially not in the wrong direction. r=matspal
If the current scroll position is fractional, e.g. y=N.4 CSS pixels, and something tries to read the
position in CSS pixels and scroll to that position (e.g. calling window.scrollTo(0, rootElem.scrollTop),
or equivalently window.scrollBy(0, 0)), it can actually end up scrolling backwards. So create a new
method nsIScrollableFrame::ScrollToCSSPixels which ensures that scrolling to a CSS pixel offset tries to
preserve the current fractional scroll position if that's possible, and if that's not possible at least does
not allow the scroll position to move in the wrong direction.
2012-05-15 17:58:09 +12:00

13 lines
284 B
HTML

<!DOCTYPE HTML>
<html>
<body style="margin:0" onload="doTest()">
<div style="height:1205.6px"></div>
<div id="d" style="height:0.6px; background:red"></div>
<script>
function doTest() {
window.scrollTo(0, document.documentElement.scrollTop);
}
</script>
</body>
</html>