Closed Bug 53076 Opened 24 years ago Closed 13 years ago

document.width gets window.innerWidth value

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
Windows 95
defect

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 ?
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
Workaround used (CSSP). Besides NN4 and IE4/5, the whole site http://www.bestmat.be is now M18 compliant.
martin.jacobs@skynet.be - could you attach testcases demonstrating any of these bugs that you are still seeing in recent builds? Thanks :-) Gerv
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.
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
I guess 'maximize' tip will still work. Used in http://www.bestmat.be/nl/info.html About NS 6.0, a scoop ? :-)
Yup, too late for Netscape 6.0 --> Future
Status: NEW → ASSIGNED
Component: DOM Level 1 → DOM Level 0
Target Milestone: --- → Future
Keywords: dom0
CC'ing Waterson who wrote the code in nsHTMLDocument.cpp, line 2740. Is this a bug in your own code or somewhere deeper?
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! :-)
Window problem, over to danm.
Assignee: jst → danm
Status: ASSIGNED → NEW
passing to desale
QA Contact: janc → desale
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
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
Assignee: danm.moz → nobody
Filter on "Nobody_NScomTLD_20080620"
QA Contact: desale → general
Depends on: 585877
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.

Attachment

General

Creator:
Created:
Updated:
Size: