Closed
Bug 26793
Opened 25 years ago
Closed 20 years ago
JavaScript cannot obtain dimensions of the *visible* window area
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Core
DOM: Core & HTML
Tracking
()
Future
People
(Reporter: ian.paterson, Assigned: danm.moz)
References
Details
There seems to be no way for JavaScript to discover the dimensions of the
visible window area (which is often important when positioning content)...
'window.innerWidth/Height' include the area underneath the scrollbars. And
there is currently no sure way to discover if these are present.
(by the way, accessing Nav 4.x 'scrollbars.visible' property throws an uncaught
exception on M13, and it wouldn't solve the problem in most cases anyway).
document.width doesn't help either.
I would suggest that the innerWidth/Height properties are reduced to reflect
the visible area if the scrollbars are present. Is there ever a need for
including the thickness of the scrollbars (when the area is not available for
layout)?
Comment 1•25 years ago
|
||
Aside for compatibility with Nav 4.x, there isn't a standard governing this.
Danm, are we just doing the wrong thing w.r.t. scrollbars?
Assignee: vidur → danm
Yes, the code that returns the size of the content area knows nothing about
gecko's decision whether to include scroll bars within the content area.
Targeting to my window sizing milestone gulag for further consideration.
Status: NEW → ASSIGNED
Target Milestone: M18
Comment 4•25 years ago
|
||
mass-moving all bugs to m21 that are not dogfood+ or nsbeta2+ or nsbeta2-
Target Milestone: M19 → M21
moving en masse all bugs that didn't get nsbeta3 nomination to "future" milestone
Target Milestone: M21 → Future
Updated•24 years ago
|
Component: DOM Level 1 → DOM HTML
Comment 7•20 years ago
|
||
(In reply to comment #0)
> There seems to be no way for JavaScript to discover the dimensions of the
> visible window area (which is often important when positioning content)...
>
> 'window.innerWidth/Height' include the area underneath the scrollbars. And
> there is currently no sure way to discover if these are present.
By verifying if window.innerWidth is equal to
document.documentElement.offsetWidth, then one can assess if a vertical
scrollbar is present.
> I would suggest that the innerWidth/Height properties are reduced to reflect
> the visible area if the scrollbars are present.
We've been through this in countless of bugfiles before with a lot of demos:
bug 187342, bug 219392, bug 140308, attachment 91256 [details] seems to still work, bug
131029, even bug 189112, bug 48634.
Resolving as DUPLICATE of bug 48634
*** This bug has been marked as a duplicate of 48634 ***
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•