Closed
Bug 53076
Opened 24 years ago
Closed 13 years ago
document.width gets window.innerWidth value
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
RESOLVED
INVALID
Future
People
(Reporter: martin.jacobs, Unassigned)
References
()
Details
(Keywords: dom0)
Attachments
(2 files)
As tested on 2000091505 (with a window smaller than its document and no borders)
document.width now gives window.innerWidth value instead of its real width.
Though document.height still returns correct value.
This wasn't the case with NS6PR2, giving an easy way to open a window with
precise dimensions, depending on its loaded content.
Would I use another method ?
Reporter | ||
Comment 1•24 years ago
|
||
Hey ! Now, with 2000092005, document.height came down to zero, so that, still
in a window much smaller than document :
- document.width takes window.innerWidth value and
- document.height is zero.
Please confirm this is a bug.
Summary: document.width gets window.innerWidth value → document.width gets window.innerWidth value
Reporter | ||
Comment 2•24 years ago
|
||
Workaround used (CSSP).
Besides NN4 and IE4/5,
the whole site http://www.bestmat.be
is now M18 compliant.
Comment 3•24 years ago
|
||
martin.jacobs@skynet.be - could you attach testcases demonstrating any of these
bugs that you are still seeing in recent builds?
Thanks :-)
Gerv
Reporter | ||
Comment 4•24 years ago
|
||
Reporter | ||
Comment 5•24 years ago
|
||
Attached testcase shows document.width/height and offsetWidth/Height values in
smaller window.
Since 20000920, there's one bug more : offsetWidth shortened too.
That's why window needs to be maximized first to get its correct width.
Comment 6•24 years ago
|
||
OK, I'm convinced. Thanks for this :-) Confirming. (Be aware, though, that this
won't make it into Netscape 6.0 release 1 - it's too late.)
Gerv
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 7•24 years ago
|
||
I guess 'maximize' tip will still work.
Used in http://www.bestmat.be/nl/info.html
About NS 6.0, a scoop ? :-)
Comment 8•24 years ago
|
||
Yup, too late for Netscape 6.0 --> Future
Status: NEW → ASSIGNED
Component: DOM Level 1 → DOM Level 0
Target Milestone: --- → Future
Comment 9•24 years ago
|
||
CC'ing Waterson who wrote the code in nsHTMLDocument.cpp, line 2740. Is this a
bug in your own code or somewhere deeper?
Comment 10•24 years ago
|
||
See bug 44480. Should you be using window.[width|height]? Or should the reporter
of that bug be using document.inner[Width|Height]? Anyway, it's easy enough to
sort out, once somebody makes up their mind what each property's value should
mean! :-)
Comment 11•24 years ago
|
||
Blast from the past:
http://lxr.mozilla.org/classic/source/lib/libmocha/lm_doc.c#382
/be
Comment 14•23 years ago
|
||
I was going to submit the same bug but found it here. The same thing happens
with document.body.offsetWidth, which I assume means one property maps to the other.
This is in Moz 0.91 build 2001060703
Comment 15•20 years ago
|
||
as of
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
document.height returns 0, if absolutely positioned elements are present.
see new testcase.
using position:relative; (the default) the correct values are returned.
reference at
http://www.mozilla.org/docs/dom/domref/dom_doc_ref20.html#1024930
states what it SHOULD do.
I know this is a feature, not officially part of the W3 DOM as far as I
understand it. It is however the only way I know to get the actual height of the
entire content inside a rendered document. This makes document.height very useful.
The code is already there, it just seems broken.
This is hardware:all, OS:all, not PC/Win95.
Should I file a new bug?
-merryx-mas
Comment 16•20 years ago
|
||
Comment 18•13 years ago
|
||
document.width is gone.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•