New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 772393 link

Starred by 4 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 414283



Sign in to add a comment

scrollTop getter/setter value is affected by zoom-factor

Reported by dea...@gmail.com, Oct 6 2017

Issue description

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

Steps to reproduce the problem:
1. zoom page
2. call element.scrollTop = 5;
3. call console.log(element.scrollTop)

What is the expected behavior?
5

but for 125% zoom I've got 4.800000190734863

What went wrong?
I've got value that depends of zoom-factor.

If I try to fix it:

zoom = 1.25
element.scrollTop = 5 / zoom;
console.log(element.scrollTop * zoom)

I've got correct value (5), but scroll position is wrong.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 61.0.3163.100  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
index.html
788 bytes View Download

Comment 1 by phistuck@gmail.com, Oct 6 2017

Why would it not be affected by the zoom factor?

Comment 2 by dea...@gmail.com, Oct 7 2017

In case of zoom-in, pixels are bigger, so scroll to 5 pixels should scroll exactly to 6-th pixel, not 5.5. And it's work just fine. 

The problem is read scrollTo value from script. It's differs from value I set just before:

this code:
element.scrollTop = 5;
console.log(element.scrollTop)

prints 4.800000190734863 instead of 5. And magic happens only with scrollTo, other properties are OK: what I set is what I read.
Cc: susanjuniab@chromium.org
Labels: Needs-Triage-M61 Needs-Feedback
reporter@ Thanks for the issue.

Tried to reproduce this issue on Windows 7 ,Mac OS 10.12.6 using the latest Canary 63.0.3236.0 and Stable 61.0.3163.100 following the below steps.

1. Launched Chrome and opened the given .html file.
2. Zoomed the page to 125% and executed steps 2 & 3 in console of Devtools.

Please find the attached screen shots of the results in Windows and Mac and confirm if anything is missed from our end.

Request you to please provide us the screen cast for better understanding and help us with the expected behavior.

Thanks..
772393.png
63.4 KB View Download
772393_Mac.png
63.6 KB View Download

Comment 4 by dea...@gmail.com, Oct 9 2017

susanjuniab@ The example html page already have zoom factor for test purposes, so you don't need to set it manually.
<div id="element" style="zoom:125%;

If you remove "zoom:125%" style, then numbers will be same on 100%, and only begins to change on zoomed pages.

So I don't think you missed something - as you can see, you set up value for scrollTop property (5) and read back absolutely different value (approx 4.48...).

In real-world application I don't know how to manually fix it: I have a scroll view, scroll it down to 65px, catch onscroll event and have no idea where the view really stands.

Btw, scrollTop set/get values absolutely identical on all browsers, except Chrome.
Project Member

Comment 5 by sheriffbot@chromium.org, Oct 9 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "susanjuniab@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: M-63 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Able to reproduce this issue on Mac 10.12.6, Win-10 and Ubuntu 14.04 using chrome reported version #61.0.3163.100 and latest canary #63.0.3236.0.
This is a non-regression issue as it is observed from M50 old builds. 

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

Thanks...!!

Comment 7 by bokan@chromium.org, Oct 12 2017

Blockedon: 414283
Labels: -OS-Linux -OS-Windows -Pri-2 -OS-Mac Hotlist-Input-Dev Pri-3
Status: Available (was: Untriaged)
This is a consequence of the fact that Blink stores all scroll offsets as Ints so we lose some precision in the conversion. This would be fixed by issue 414283, unfortunately that's not a short term fix...
Project Member

Comment 8 by sheriffbot@chromium.org, Oct 15

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment