Opened 15 years ago

Closed 15 years ago

#4435 closed defect (fixed)

getViewport returning somtetimes a null height in firefox

Reported by: guest Owned by: haysmark
Priority: high Milestone: 1.0
Component: Dijit Version: 0.9
Keywords: viewport Cc:
Blocked By: Blocking:


Hi evryone ! I noticed a problem with the getViewport function in firefox (
Sometimes it returns a 0 height. It works great on the tests page but when using it in a particular page of my app, that bug occurs, resulting the layout to be messed up (combobox opening upward every time, dialog showing above the top of screen...)
After some researches I saw the problem was coming from [10345]:

h = _document.body.clientHeight<=_window.innerHeight ? _document.body.clientHeight : _document.documentElement.clientHeight;

When the probleme is happening, _document.body.clientHeight == 0.
In my mind, this value has to be checked before doing an inferiority test.

Change History (5)

comment:1 Changed 15 years ago by bill

Milestone: 1.0

OK, please provide a testcase.

comment:2 Changed 15 years ago by guest

But that's the problem, the testcase is my application. On simples pages there is no problem, so I don't know what the problem is. I just saw the effects.

comment:3 Changed 15 years ago by haysmark

0 clientHeight isn't in the spec, so we really need the test case since it's clearly a browser bug.

comment:4 Changed 15 years ago by Douglas Hays

Milestone: 1.0
Owner: set to haysmark

Did this just get fixed?

comment:5 Changed 15 years ago by haysmark

Resolution: fixed
Status: newclosed

Reproduced. Clearly if you wrap your body in a position:absolute div, the body has no inline content and thus has 0 height. This occurs with strict dtd.

On the other hand, with no dtd, documentElement is the one with 0 height, so the [10345] check works.

I can verify that [10680] fixes this and makes getViewport compatible across all dtds.

Note: See TracTickets for help on using tickets.