JavaScript cannot obtain dimensions of the *visible* window area

RESOLVED DUPLICATE of bug 48634

Status

()

Core
DOM: Core & HTML
P3
enhancement
RESOLVED DUPLICATE of bug 48634
19 years ago
14 years ago

People

(Reporter: ian.paterson, Assigned: Dan M)

Tracking

Trunk
Future
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
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)?

Updated

19 years ago
QA Contact: gerardok → desale

Comment 1

19 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
(Assignee)

Comment 2

19 years ago
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 3

19 years ago
Mass moving M18 bugs to M19
Target Milestone: M18 → M19

Comment 4

18 years ago
mass-moving all bugs to m21 that are not dogfood+ or nsbeta2+ or nsbeta2-
Target Milestone: M19 → M21
(Assignee)

Comment 5

18 years ago
moving en masse all bugs that didn't get nsbeta3 nomination to "future" milestone
Target Milestone: M21 → Future
Keywords: dom1
Component: DOM Level 1 → DOM HTML

Comment 6

17 years ago
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala

Updated

17 years ago
Component: DOM HTML → DOM Level 0
Keywords: dom1

Updated

16 years ago
Depends on: 111207

Comment 7

14 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
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.