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

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: Adressed comments 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 90671e46dfb6dd6edd0603c695ac1853c4caf191..d0e70caa2ce2b055049c8664e2afa3857ffba947 100644
--- a/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -1563,6 +1563,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);
@@ -1858,6 +1861,11 @@ bool LayoutBlockFlow::matchedEndLine(LineLayoutState& layoutState, const InlineB
if (resolver.position() == endLineStart) {
if (resolver.status() != endLineStatus)
return false;
+
+ // Be careful not to ignore <br> with clear style for partial layout where the block
+ // contains floats. It might mislead height of the block into being shorter than expected.
leviw_travelin_and_unemployed 2015/05/19 21:29:52 Can we word this better? Specifically mention the
changseok 2015/05/20 14:22:24 Updated.
+ 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