W3C home > Mailing lists > Public > www-style@w3.org > June 2011

Re: Behaviour of getComputedStyle with box-sizing: border-box

From: Anne van Kesteren <annevk@opera.com>
Date: Sun, 19 Jun 2011 15:34:33 +0200
To: www-style@w3.org, "Boris Zbarsky" <bzbarsky@mit.edu>
Message-ID: <op.vxbrzvvl64w2qv@anne-van-kesterens-macbook-pro.local>
On Thu, 16 Jun 2011 06:09:46 +0200, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> Or to put this in testcase terms:
>
>    <style>
>      body { width: 200px; }
>      div { width: auto; box-sizing: border-box; padding: 10px; }
>    </style>
>    <body><div></div></body>
>
> The question is whether getComputedStyle for 'width' on the div should  
> return 180px or 200px (neither of which is the CSS 2.1 computed value;  
> the former is the used width and the latter is what would work for  
> round-tripping).

Per the specification that should be 180px. Not sure it is worth special  
casing box-sizing.

http://dev.w3.org/csswg/cssom/#dom-window-getcomputedstyle
http://dev.w3.org/csswg/cssom/#resolved-value


> Note also https://bugzilla.mozilla.org/show_bug.cgi?id=520992 (which  
> seems to be the only Gecko bug report related to this I've found).
>
> -Boris


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Sunday, 19 June 2011 13:35:04 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:41 GMT