Opened 13 years ago
Closed 13 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: |
Description
Hi evryone !
I noticed a problem with the getViewport function in firefox (2.0.0.6).
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 13 years ago by
Milestone: | 1.0 |
---|
comment:2 Changed 13 years ago by
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 13 years ago by
http://developer.mozilla.org/en/docs/DOM:element.clientHeight
0 clientHeight isn't in the spec, so we really need the test case since it's clearly a browser bug.
comment:5 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
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.
OK, please provide a testcase.