mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-12 14:37:50 +00:00
fede4b2197
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.
8 lines
162 B
HTML
8 lines
162 B
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<body style="margin:0">
|
|
<div style="height:1205.6px"></div>
|
|
<div id="d" style="height:0.6px; background:red"></div>
|
|
</body>
|
|
</html>
|