RE: [cssom-view] Incorrect definitions of scrollWidth and scrollHeight

On Tue, 16 Apr 2013 17:32:41 +0200, Leif Arne Storset <lstorset@opera.com> wrote:

> (resending to the list to fix an address error)
> 
> On Tue, 16 Apr 2013 15:16:10 +0200, Simon Pieters <simonp@opera.com>
> wrote:
> 
> > On Fri, 06 May 2011 16:51:49 +0200, Leif Arne Storset
> > <lstorset@opera.com> wrote:
> >
> >> Apologies for the missent message. Here's the full text:
> >>
> >> Not sure if anybody's taking care of CSSOM View while Anne's away,
> >> but here goes:
> >>
> >> The definitions of scrollWidth and scrollHeight [0] don't match Gecko
> >> and Trident (IE9)'s behavior, which is something like the following:
> >>
> >> If the element is the root element and the Document is not in quirks
> >> mode return the dimensions of the document or the viewport, whichever
> >> is larger. The dimensions of the document include any positioned
> >> elements and overflow.
> >>
> >> WebKit (Chrome) and Presto don't conform to this, but Presto will in
> >> an upcoming release.
> >>
> >> 0. http://dev.w3.org/csswg/cssom-view/#dom-element-scrollwidth

> >
> > This appears to have been fixed at some point.
> 
> Yeah, I believe Anne fixed it in July of that year. (If you're working your way
> through the archives — if so, good job — you won't have seen his reply of 14
> July 2011 because it isn't linked to my message.)
> 
> -- Leif Arne Storset
> Opera Software
> Oslo, Norway
> 
> > The spec now says:
> >
> > [[
> > If the element is the root element and the Document is not in quirks
> > mode return max(document content width, value of innerWidth).
> > ]]
> >
> > https://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-

> view/Overview.html#wid
> > l-Element-scrollWidth

This doesn't exactly match Trident/Gecko/Webkit/Presto behavior when scrollbars are present and the viewport is larger than the document content.  innerWidth/innerHeight explicitly includes the size of the rendered scrollbar, whereas scrollWidth/scrollHeight on the root element excludes the scrollbar.

-Matt

Received on Wednesday, 17 April 2013 12:11:21 UTC