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

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