Closed Bug 1105326 Opened 10 years ago Closed 10 years ago

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

Categories

(Firefox for Android Graveyard :: Toolbar, defect)

33 Branch
ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1071620

People

(Reporter: lorenzo.stanco, Unassigned)

References

Details

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.
OS: Linux → Android
Hardware: x86_64 → ARM
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
Closed: 10 years ago
Resolution: --- → DUPLICATE
(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.
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.