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

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

From: Simon Sapin <simon.sapin@exyr.org>
Date: Fri, 29 Mar 2013 18:37:57 +0100
Message-ID: <5155D175.7080406@exyr.org>
To: www-style@w3.org
Le 29/03/2013 18:03, Tab Atkins Jr. a écrit :
> On Fri, Mar 29, 2013 at 9:25 AM, Boris Zbarsky<bzbarsky@mit.edu>  wrote:
>> >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,
>> >sincehttp://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.
> Oh, no, not at all.  You still want to return the used value *of the
> 'width' property*.  'box-sizing' changes how the 'width' property is
> interpreted when figuring out the width of the content box, but it
> doesn't actually change the value of the 'width' property itself.

The spec for box-sizing writes about the specified width (specified 
value of the 'width' property) as well as the content width (width of 
the content area of the CSS box), but nothing on the used value of the 
'width' property.

In WeasyPrint I chose to have the used value be the same as the width of 
the content area, but it could well be otherwise.

Should the spec be clarified?

-- 
Simon Sapin
Received on Friday, 29 March 2013 17:38:22 UTC

This archive was generated by hypermail 2.3.1 : Friday, 29 March 2013 17:38:23 UTC