New issue
Advanced search Search tips

Issue 716572 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 713765
Owner: ----
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Chrome doesn't always report correct scrollTop value

Reported by nekr.fab...@gmail.com, Apr 28 2017

Issue description

Steps to reproduce the problem:
1. Go to https://output.jsbin.com/xarawew (or open attached index.html)
2. Fast scroll down on a popup (white block)
3. Whole pages scrolls

What is the expected behavior?
Only white block should be scrolled since overscroll is prevented on that block via touch events

What went wrong?
Whole pages scrolls

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version:   Channel: stable
OS Version: 
Flash Version: 

This seems to be specific to the markup I have in this repro. If I have just a scrollable  box with content if works fine, but I use current markup issues is reproducible (I copied it without modifications from my project).

Issue exists on all Stable, Beta and Canary channels. It doesn't exist if toolbar (URL bar) is places at a bottom of the screen in Canary.

Here is a video which demonstrates the issue: https://www.youtube.com/watch?v=8ioIk0i3eVU

Problem is that during top level scroll when top bar is about to hide -- Chrome doesn't fully scroll the white block, or at least doesn't report scrollTop correctly. Maximum scrollTop value which it reports is: <full_scroll_value> - 1.

To fix the issue uncomment this line in the repro:
// clientY < startY && (scrollTop + 1) + clientHeight >= scrollHeight

and comment this line:
clientY < startY && scrollTop + clientHeight >= scrollHeight

This solves the issue in Chrome. Works everywhere else just fine even without the "fix".
 
index.html
6.8 KB View Download

Comment 1 by bokan@chromium.org, Apr 28 2017

Labels: -Pri-2 Hotlist-Input-Dev Pri-3
I can't reproduce this on a Nexus 5X, but I'd bet this has something to do with the screen pixel density and us not treating the fractional pixels correctly. What device are you using and what's the output of `window.devicePixelRatio`?
devicePixelRatio is 3. It's OnePlus One on CyanogenMod 13. 

Comment 3 by rbyers@chromium.org, Apr 28 2017

FWIW I also can't reproduce on Nexus 6p DPR=3.5 Chrome 59 Beta.

Maybe CyanogenMod is doing something unusual?

Comment 4 by bokan@chromium.org, May 10 2017

Cc: bokan@chromium.org
Mergedinto: 713765
Status: Duplicate (was: Unconfirmed)
Ok, I managed to repro on a Galaxy S7 with a DPR of 4. That said, this is a dup of  issue 713765  I think.

As eae@ mentioned there, the rounding here is done intentionally and changing it would have compat impact on existing content. The recommended workaround for now is to use getBoundingClientRect().height for the clientHeight as that isn't rounded.

Comment 5 Deleted

Sign in to add a comment