This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22766 - document.width, document.height, etc available for cross-platform
Summary: document.width, document.height, etc available for cross-platform
Status: RESOLVED DUPLICATE of bug 22772
Alias: None
Product: CSS
Classification: Unclassified
Component: CSSOM (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 enhancement
Target Milestone: ---
Assignee: Simon Pieters
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-23 08:46 UTC by Jim Michaels
Modified: 2013-09-02 13:50 UTC (History)
4 users (show)

See Also:


Attachments

Description Jim Michaels 2013-07-23 08:46:27 UTC
I would like to see the following DOM Attributes/properties:

- viewport information:
top:Int32, 
width:Int32, 
height:Int32.
left may not be needed, unless the browser mfr decides to make vertical tabs instead of horizontal tabs (so the user has more viewing space? but it might be hard to read).

- document information:
width:Int32, 
height:Int32, 
scrollThumbPositionH/scrollThumbPosH/scrollSliderPosH:Int32, scrollThumbPositionV/scrollThumbPosV/scrollSliderPosV:Int32, 
scrollEnabledH:Boolean, 
scrollEnabledV:Boolean.
Comment 1 Jim Michaels 2013-07-23 08:59:00 UTC
I figure that the scroll properties should be read-only, along with the viewport information, unless perhaps someone wants to change the viewport's "top". but that doesn't seem likely. I can't remember any instance when I needed to change the viewport.

reasons: the viewport information and document size info is helpful when trying to calculate positions and sizes dynamically for divs when doing absolute/relative or shackled positioning with layers - this is hard to do currently without enough info, I usually end up doing it with js a little, but not enough to go on.

if anyone can think of reasons why any of the properties should not be readonly, please speak up.
Comment 2 Boris Zbarsky 2013-07-23 15:22:59 UTC
Shouldn't all those be doubles instead of ints?  Certainly viewport dimensions and scroll positions can trivially be non-integer numbers of CSS pixels...
Comment 3 Simon Pieters 2013-08-08 09:39:01 UTC
(In reply to comment #1)
> reasons: the viewport information and document size info is helpful when
> trying to calculate positions and sizes dynamically for divs when doing
> absolute/relative or shackled positioning with layers - this is hard to do
> currently without enough info, I usually end up doing it with js a little,
> but not enough to go on.

Can you elaborate on this? What are you trying to do, exactly? Can you point to an example where you have done this and how you tried to work around the lack of the proposed feature, and how it was not sufficient? What are your requirements?

I'm not trying to put you off, I'm just trying to understand the use case and the requirements so I can evaluate the proposal.
Comment 4 Simon Pieters 2013-09-02 13:50:06 UTC

*** This bug has been marked as a duplicate of bug 22772 ***