<html>'s clientHeight is incorrect and inconsistent with desktop Firefox or other Android browsers

RESOLVED DUPLICATE of bug 1071620

Status

()

Firefox for Android
Toolbar
RESOLVED DUPLICATE of bug 1071620
4 years ago
2 years ago

People

(Reporter: Lorenzo Stanco, Unassigned)

Tracking

(Depends on: 1 bug)

33 Branch
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0
Build ID: 20141013200257

Steps to reproduce:

I noticed .clientHeight value is incorrect on <html> element. This happens only in Firefox for Android, not on desktop, and it does not happen in other Android browser (stock, for example).


Actual results:

I prepared a test that alerts value of window.innerHeight and document.querySelector("html").clientHeight before and after document loads. The document is a simple page with many text paragraphs:
http://www.lorenzostanco.com/stack/ffbug.html


Expected results:

In desktop Firefox all four values are identical. This is true also on other Android browsers. In Firefox for Android they are all different.
(Reporter)

Updated

4 years ago
OS: Linux → Android
Hardware: x86_64 → ARM

Updated

4 years ago
Component: General → Graphics, Panning and Zooming
Thanks for the report and test case! We actually already have a bug for this on file as it's a rather tricky problem to solve given the architecture of our code.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1071620
(Reporter)

Comment 2

4 years ago
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #1)
> Thanks for the report and test case! We actually already have a bug for this
> on file as it's a rather tricky problem to solve given the architecture of
> our code.
> *** This bug has been marked as a duplicate of bug 1071620 ***

But 1071620 is about window.innerHeight, not about <html>'s clientHeight. Maybe they are somewhat related in a deeper way?

To me, the problem was <html>'s clientHeight, in fact. I was measuring window size to set an element's size to fill the entire viewport. Using <html>'s clientHeight my element grows too much tall, and I managed to solve it using window.innerHeight!
I'm pretty sure it's the same underlying problem. I copied your page to http://people.mozilla.org/~kgupta/bug/1105326.html and added a button to trigger the measure function on demand. Once the page is done loading and you click the button you get the same consistent values for window.innerHeight and the <html>'s clientHeight. It's only during the loading process that the values fluctuate. Both the innerHeight and the clientHeight are dependent on the CSS viewport which is what we're fiddling with during the page load, and that's what causes the problem.
You need to log in before you can comment on or make changes to this bug.