Issue metadata
Sign in to add a comment
|
Chrome doesn't always report correct scrollTop value
Reported by
nekr.fab...@gmail.com,
Apr 28 2017
|
||||||||||||||||||||||||
Issue descriptionSteps 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".
,
Apr 28 2017
devicePixelRatio is 3. It's OnePlus One on CyanogenMod 13.
,
Apr 28 2017
FWIW I also can't reproduce on Nexus 6p DPR=3.5 Chrome 59 Beta. Maybe CyanogenMod is doing something unusual?
,
May 10 2017
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. |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by bokan@chromium.org
, Apr 28 2017