Index: Source/WebCore/rendering/RenderBlockLineLayout.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderBlockLineLayout.cpp (revision 143750) |
+++ Source/WebCore/rendering/RenderBlockLineLayout.cpp (working copy) |
@@ -2281,8 +2281,8 @@ |
} |
} else if (object->isFloating()) { |
// The top margin edge of a self-collapsing block that clears a float intrudes up into it by the height of the margin, |
- // so in order to place this child float at the top content edge of the self-collapsing block add the margin back in before placement. |
- LayoutUnit marginOffset = (m_block->isSelfCollapsingBlock() && m_block->style()->clear() && m_block->getClearDelta(m_block, LayoutUnit())) ? m_block->collapsedMarginBeforeForChild(m_block) : LayoutUnit(); |
+ // so in order to place this first child float at the top content edge of the self-collapsing block add the margin back in before placement. |
+ LayoutUnit marginOffset = (!object->previousSibling() && m_block->isSelfCollapsingBlock() && m_block->style()->clear() && m_block->getClearDelta(m_block, LayoutUnit())) ? m_block->collapsedMarginBeforeForChild(m_block) : LayoutUnit(); |
LayoutUnit oldLogicalHeight = m_block->logicalHeight(); |
m_block->setLogicalHeight(oldLogicalHeight + marginOffset); |
m_block->positionNewFloatOnLine(m_block->insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine, lineInfo, width); |