Treatment of adjoining margins of an anonymous block and block child

Hi there,

Yet another question! :)

This is a test from the WebKit test suite: http://roberthogan.net/css/025.html

It fails on FF, apparently because FF is happy to consider the margins
of an anonymous block and its block-flow child as adjoining - so if
they can't collapse (for example because the block is self-collapsing
) the anonymous block adds in the margin from the element it wraps to
its own after-side.

In the test it is the anonymous block wrapping the 'clear' div that
adds the margin from that element to its own height.  I believe it
does this because it is following the rule: "If the top and bottom
margins of an element with clearance are adjoining, its margins
collapse with the adjoining margins of following siblings but that
resulting margin does not collapse with the bottom margin of the
parent block." Presumably this rule should not apply to anonymous
blocks but I can't see that in the spec.

What is the correct behaviour here?

Thanks,
Robert

Received on Sunday, 12 August 2012 16:26:04 UTC