Re: [CSS21] margin computed value

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 UTC