[cssom-view] scrollWidth vs clientWidth

Hi,

I cannot tell, from reading the spec, what the difference between the 
clientWidth and scrollWidth is supposed to be (and also clientHeight and 
scrollHeight, of course).

The scrollWidth is:

> the computed value of the padding-left property of A, plus the computed value of the padding-right  property of A, plus the content width of A. 

The clientWidth is:

> the viewport height excluding the size of a rendered scroll bar (if any) if the element is the root element and the height of the padding edge (excluding the width of any rendered scrollbar between the padding edge and the border edge) otherwise. 

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?

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.

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

     David Flanagan

Received on Monday, 16 August 2010 23:04:19 UTC