Chrome 65.0.3325.181 on Windows 10.0.16299.309. Monitor: 27″, 3840×2160.
Display scaled to 150%, typing in Chrome’s console:
document.documentElement.scrollTop = 1 1 document.documentElement.scrollTop 0.6666666865348816
document.documentElement.scrollTop = 9 9 document.documentElement.scrollTop 8.666666984558105
Another test with window.scrollBy(x, y)
and window.scrollY
, starting at the top of the page:
(function f() {
scrollBy(0, 1)
console.log(scrollY)
if (scrollY < 10) {
f()
}
})()
Output (15 lines – factor of 1.5 of the expected number):
0.6666666865348816 1.3333333730697632 2 2.6666667461395264 3.3333332538604736 4 4.666666507720947 5.333333492279053 6 6.666666507720947 7.333333492279053 8 8.666666984558105 9.333333015441895 10
Yet another test with window.scroll(x, y)
:
(function f(n) {
scroll(0, n)
console.log(scrollY)
if (scrollY < 10) {
f(n + 1)
}
})(1)
Output (10 lines – as expected because of no accumulation):
0.6666666865348816 2 2.6666667461395264 4 4.666666507720947 6 6.666666507720947 8 8.666666984558105 10
Display scaled to 125%:
document.documentElement.scrollTop = 1 1 document.documentElement.scrollTop 0.800000011920929
It seems to me that the value that is really set is “calculated” by value - 1 + 1/scale
if value * scale
is not integral.
Is that a bug on my site, Windows’s or Chrome’s?