Open Bug 616296 Opened 11 years ago Updated 11 years ago

empty element margins that collapse with top margin of parent not considered when clearing [MARGIN-C]


(Core :: Layout: Block and Inline, defect)

Not set




(Reporter: dbaron, Unassigned)


(Depends on 1 open bug, Blocks 1 open bug)


(Keywords: css2)


(1 file)

We fail:
because the margins of the element with class="empty" (which should collapse with the top margin of the element with class="clear" and should be above its top border edge) appear to end up not being considered when we compute the clearance.

Contrast this case with the case in bug 493380, which is similar, but where I believe we're currently correct because the margin is a bottom margin on the element being cleared and not its child, and therefore affects the position of the element's top border edge differently.
Attached file reduced testcase
This can be reduced to a very small and easy setup without float and clear.
The margin-bottom of the empty element always gets doubled.

Do I have a thinking error? I can clearly see what the bug is, but isn't this constellation rather common? Shouldn't we have seen such issues more often before?
Depends on: 50959
You need to log in before you can comment on or make changes to this bug.