W3C home > Mailing lists > Public > www-style@w3.org > August 2010

Re: [cssom-view] scrollWidth vs clientWidth

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 17 Aug 2010 07:56:00 +0200
To: www-style@w3.org, "David Flanagan" <david@davidflanagan.com>
Message-ID: <op.vhkirmb364w2qv@anne-van-kesterens-macbook-pro.local>
On Tue, 17 Aug 2010 01:03:33 +0200, David Flanagan  
<david@davidflanagan.com> wrote:
> I understand that for the root element clientWidth is the viewport width  
> rather than the full content width, and I assume from that that  
> clientWidth is supposed to exclude overflowing content and scrollWidth  
> is supposed to include it.
> Is my assumption correct?

There's a few more special cases, see


for the latest version of the draft.

> I suppose that the CSS 2.1 specification must somewhere explain that the  
> "content width" of an element is different (in the case of overflow)  
> than the width of the "content edge" of the element, but I can't figure  
> out where it says that.

It says the content edge is determined by the 'height' / 'width'. 'content  
width' is a term defined by CSSOM View as it is not in CSS 2.1. It is  
somewhat confusing and ideally a revision to CSS would at some point more  
clearly define all the boxes so CSSOM View would only have to reference.

> Perhaps you could add a non-normative green note to the spec to clarify  
> the distinction between these two properties.

I think it would be better actually if one day someone contributes a  
graphic to visualize the whole thing. If that day never comes I might take  
a stab at it myself.

Anne van Kesteren
Received on Tuesday, 17 August 2010 05:56:34 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:37 UTC