W3C home > Mailing lists > Public > www-style@w3.org > November 2009

Re: [CSS21] margin computed value

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 09 Nov 2009 15:50:52 -0500
Message-ID: <4AF880AC.8080509@mit.edu>
To: Andrey Mikhalev <amikhal@abisoft.spb.ru>
CC: www-style@w3.org
On 11/9/09 3:34 PM, Andrey Mikhalev wrote:
> well, "Computed values are processed as far as possible without
> formatting the document".
> resolving margin:auto needs layout-dependent computations only for
> in-flow block-level and absolutely positioned elements
> (10.3.3/4, 10.3.7/8)
> there's no reason to defer resolving of 'auto' to 0 in all other cases.

Sort of.  Consider this case:

<!DOCTYPE html>
<html>
<body>
   <span style="margin-left: auto; margin-right: auto">
     <span style="display: block; margin: inherit; width: 50%">Text</span>
   </span>
</body>
</html>

In this case, computing the value to 0 for the outer span makes the 
layout different for the inner span than if the value computed to "auto" 
for the outer span (and you can observe that difference in Opera 10 vs 
Webkit or Gecko).  Of course it could be that in this case the behavior 
of forcing all descendants of the <span> to inherit 0 is preferable for 
some reason?

We certainly need a test for this in the test suite...

-Boris
Received on Monday, 9 November 2009 20:51:33 GMT

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