New issue
Advanced search Search tips

Issue 873870 link

Starred by 1 user

Issue metadata

Status: Available
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Scroll sequence sometimes ends with tiny backward scroll

Reported by abrahams...@googlemail.com, Aug 14

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.32 Safari/537.36

Steps to reproduce the problem:
1. Open a long web page with scroll bars such as
https://bugs.chromium.org/p/chromium/issues/list
and scroll half way down.

2. Hit F12 and paste this into the console:

let prev = window.pageYOffset
window.addEventListener("scroll", () => {
	const curr = window.pageYOffset
	const diff = curr - prev
	if (diff < 0) console.log(diff)
	else console.warn(diff)
	prev = curr
})

3. Repeat the following:

Scroll down
Scroll up

What is the expected behavior?
Scrolling down should only produce positive changes of pageYOffset.
Scrolling up should only produce negative changes of pageYOffset.

What went wrong?
Sometimes the scroll ends with a tiny scroll step backward.

I.e. when scrolling up, the sequence ends with a minimal scroll-down that should not have happened.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 69.0.3497.32  Channel: beta
OS Version: 10.0
Flash Version: 

I tested this with 5 different mice/touchpads on Mac/Windows.
I was able to reproduce this in Chrome Beta, Chrome Canary, and Opera.
I was not able to reproduce this in Edge or Firefox.
 
2018-08-14 01_58_50-Issues - chromium - An open-source project to help move the web forward. - Monor.png
4.4 KB View Download
Labels: Needs-Triage-M69 Needs-Bisect
Labels: -Needs-Bisect Triaged-ET Target-70 M-70 FoundIn-70 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Mac 10.13.3, Win-10 and Ubuntu 17.10 using chrome reported version #69.0.3497.32 and latest canary #70.0.3522.0.
This is a non-regression issue as it is observed from M60 old builds. 

Hence, marking it as untriaged to get more inputs from dev team.

Thanks...!!
Cc: bokan@chromium.org
Labels: -Pri-2 Pri-3
Status: Available (was: Untriaged)
I can repro on Windows 70.0.3523.0. Seems to only happen when scrolling down. My guess is that the scroll lands on a fractional pixel and we floor it, causing a negative scroll so it's technically correct. Not sending a scroll here means an app trying to keep up with the scroll could accumulate error as a result.

We could maybe do a little better here by avoiding the fractional bit of the scroll but that would require a bit of thought and I don't think this is high priority. Is this causing a real-world breakage or pain in some way?
Hi Bokan, thanks for taking a look.

> Seems to only happen when scrolling down.
Not sure what you mean, I'm scrolling up.

> Is this causing a real-world breakage or pain in some way?
We toggle things when scrolling up (like backt to top button) but sometimes they unintentionally disappear. It seems as if the user has scrolled back down when he has not.
Labels: -Target-70
Owner: eirage@chromium.org
> Not sure what you mean, I'm scrolling up.

The issue occurred for me regularly when I would scroll down but never when I scroll up. 

> We toggle things when scrolling up (like backt to top button) but sometimes they unintentionally disappear. It seems as if the user has scrolled back down when he has not.

Ok - That's fairly compelling. It's easy to work around so not high priority but we should probably fix it. +eirage@ since you're steeped in precision issues. PTAL when you get a chance.

Sign in to add a comment