Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1071)

Unified Diff: Source/core/layout/LayoutBlockFlowLine.cpp

Issue 1102953002: BR styled clear is ignored while partially relayouting. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Comment updated. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
« no previous file with comments | « LayoutTests/fast/block/float/br-with-clear-4-expected.html ('k') | Source/core/layout/line/LineLayoutState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698