New issue
Advanced search Search tips

Issue 713765 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

clientHeight can be greater than scrollHeight when zoomed.

Reported by ptwa...@gmail.com, Apr 20 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36

Steps to reproduce the problem:
1. Open attached Zoom.html
2. Alter the browsers zoom level until scrollHeight is less than clientHeight.
3. Zoom level required to reproduce varies by machine.  In chromium on arch linux I can reproduce at 80%, 250%, and 300%.  In chrome on windows 7 I can reproduce at 67%, 75%, and 80%.

What is the expected behavior?
scrollHeight should always be greater than or equal to clientHeight.  If scrollHeight is greater than clientHeight then a scrollbar should be visible unless the CSS style overflow is set to 'visible'.

https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight

What went wrong?
At some zoom levels, scrollHeight is less than clientHeight which which can give a false positive when checking for scroll views.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 57.0.2987.133  Channel: n/a
OS Version: Arch
Flash Version: Shockwave Flash 25.0 r0

The following bugs are similar but list scrollHeight > clientHeight as the issue where the opposite is true here.

https://bugs.chromium.org/p/chromium/issues/detail?id=449702
https://bugs.chromium.org/p/chromium/issues/detail?id=261748 (example attachment derived)

Not reproducible in firefox.
 
Zoom.html
425 bytes View Download
Labels: Needs-Bisect
Status: Untriaged (was: Unconfirmed)
Reprod on Ubuntu 14.04 using Chrome 58.0.3029.81 and 59.0.3071.15

Comment 2 by bokan@chromium.org, Apr 26 2017

Cc: bokan@chromium.org
Components: -Blink>CSS Blink>Layout
Labels: -OS-Linux -Pri-2 -Needs-Bisect OS-All Pri-3
I think this is an issue with layout and precision. I expect it's been around for a really long time so a bisect won't really help.

Comment 3 by e...@chromium.org, May 1 2017

Cc: e...@chromium.org
Status: WontFix (was: Untriaged)
scrollHeight and offsetHeight use different rounding modes to avoid triggering scrollbars unnecessarily and to allow scrollable containers to be scrolled to the bottom regardless of zoom level.

While this might result in unexpected issues like this changing the rounding behavior for either will cause real-world websites to break. 

We can't really fix this without causing compat issues until we have LayoutNG.

A reasonable workaround for now would be to use getBoundingClientRect().height instead of offsetHeight as the former is *not* rounded.

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

 Issue 716572  has been merged into this issue.

Sign in to add a comment