[cssom] Interaction of getComputedStyle.width/height and box-sizing

Per the current CSSOM spec, getComputedStyle.width/height return the 
used value.

It's not clear to me exactly which of the various values box-sizing 
affects, since http://dev.w3.org/csswg/css-ui/#box-sizing is far too 
vague to actually _say_ what it does.  But it seems pretty clear that 
the used value would be affected, if things are at all sane,

Which means that given this markup:

   <div style="border: 10px solid; width: 100px; box-sizing: border-box">

the used width will be 80px.

However Presto and WebKit report "100px" from getComputedStyle.  Gecko 
currently reports "80px" but we consider that a bug 
(https://bugzilla.mozilla.org/show_bug.cgi?id=520992 ).  IE9 seems to 
report "80px" as well....

I _think_ we want to define this in the spec such that doing:

   foo.style.width = getComputedStyle(foo).width;

is a no-op, which means returning "100px" above, for what it's worth.

-Boris

Received on Friday, 29 March 2013 16:25:42 UTC