Index: Source/core/layout/LayoutBlockFlowLine.cpp |
diff --git a/Source/core/layout/LayoutBlockFlowLine.cpp b/Source/core/layout/LayoutBlockFlowLine.cpp |
index 924b1d52140ee051dd94115e57b832038eeab219..d53c69885a1253ba41211417689d080984c18cdb 100644 |
--- a/Source/core/layout/LayoutBlockFlowLine.cpp |
+++ b/Source/core/layout/LayoutBlockFlowLine.cpp |
@@ -1545,6 +1545,9 @@ void LayoutBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& pa |
if (!layoutState.hasInlineChild() && o->isInline()) |
layoutState.setHasInlineChild(true); |
+ if (o->isBR() && o->style()->clear() != CNONE) |
+ layoutState.setContainsBRWithClear(true); |
+ |
if (o->isReplaced() || o->isFloating() || o->isOutOfFlowPositioned()) { |
LayoutBox* box = toLayoutBox(o); |
@@ -1840,6 +1843,12 @@ bool LayoutBlockFlow::matchedEndLine(LineLayoutState& layoutState, const InlineB |
if (resolver.position() == endLineStart) { |
if (resolver.status() != endLineStatus) |
return false; |
+ |
+ // A trailing BR can be collapsed as it usually doesn't contribute to the height, |
+ // but if it has a clear style we need to force it to layout in the context of floats |
+ // to honor that style. |
+ if (layoutState.containsBRWithClear() && containsFloats()) |
+ return false; |
return checkPaginationAndFloatsAtEndLine(layoutState); |
} |