Re: [css2] Margin-Collapsing and min-height

On 4/21/14, 4:24 PM, Robert Hogan wrote:
> "The following algorithm describes how the two properties influence the
> used value of the 'height' property:

The basic problem is that min/max-height was pretty underspecified for a 
while.

It talks about redoing layout with a different value for the height, but 
didn't use to say whether that's a new computed value, used value, or 
something else.

In practice, implementations interpret it inconsistently, sometimes even 
within an implementation.

The spec attempted to clarify that it's the used value that changed, but 
it's possible that those updates were inconsistently applied, because in 
addition to the note you quote there is this note in 
http://www.w3.org/TR/CSS2/box.html#collapsing-margins :

   The bottom margin of an in-flow block box with a 'height' of 'auto'
   and a 'min-height' of zero collapses with its last in-flow
   block-level child's bottom margin if the box has no bottom padding
   and no bottom border and the child's bottom margin does not collapse
   with a top margin that has clearance.

The "'min-height' of zero" stipulation there is only necessary if 
min-height on the parent can in fact affect margin collapsing behavior. 
  But the actual normative rules only talk about "bottom margin of a 
last in-flow child and bottom margin of its parent if the parent has 
'auto' computed height".  So my best guess is that either someone forget 
to change the normative text when adding both this note and the note in 
http://www.w3.org/TR/CSS2/visudet.html#min-max-heights or the note here 
is wrong.  It's hard to tell which is the case without some archeology.  :(

> So can the behaviour be improved or should it remain as it is? Am I
> right in thinking the rendering in WebKit/IE/Presto is correct per the spec?

It seems correct per the current normative text of the spec.  Whether 
the current normative text of the spec reflects what the working group 
was _trying_ to have the spec say in this case is not clear to me.  :(

-Boris

Received on Tuesday, 22 April 2014 06:13:00 UTC