W3C home > Mailing lists > Public > www-style@w3.org > March 2013

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 29 Mar 2013 12:25:14 -0400
Message-ID: <5155C06A.8030808@mit.edu>
To: www-style list <www-style@w3.org>
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

This archive was generated by hypermail 2.3.1 : Friday, 29 March 2013 16:25:43 UTC