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

Unified Diff: Source/core/rendering/RenderBlockFlow.cpp

Issue 209863003: [New Multicolumn] balancer confused by content with top margins. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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/rendering/RenderBlockFlow.cpp
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp
index 1e5e7fd046b940073b8555b2fc13061822a561cd..b43d5e271053c7f5773953cd644851c66238a36c 100644
--- a/Source/core/rendering/RenderBlockFlow.cpp
+++ b/Source/core/rendering/RenderBlockFlow.cpp
@@ -228,8 +228,20 @@ void RenderBlockFlow::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogi
if (!hasSpecifiedPageLogicalHeight && !pageLogicalHeight)
colInfo->clearForcedBreaks();
} else if (isRenderFlowThread()) {
- pageLogicalHeight = 1; // This is just a hack to always make sure we have a page logical height.
- pageLogicalHeightChanged = toRenderFlowThread(this)->pageLogicalSizeChanged();
+ RenderFlowThread* flowThread = toRenderFlowThread(this);
+
+ // This is a hack to always make sure we have a page logical height, if said height is
+ // known. The page logical height thing in LayoutState is meaningless for flow thread-based
+ // pagination (page height isn't necessarily uniform throughout the flow thread), but as
+ // long as it is used universally as a means to determine whether page height is known or
+ // not, we need this. Page height is unknown when column balancing is enabled and flow
+ // thread height is still unknown (i.e. during the first layout pass). When it's unknown, we
+ // need to prevent the pagination code from assuming page breaks everywhere and thereby
+ // eating every top margin. It should be trivial to clean up and get rid of this hack once
+ // the old multicol implementation is gone.
+ pageLogicalHeight = flowThread->isPageLogicalHeightKnown() ? LayoutUnit(1) : LayoutUnit(0);
+
+ pageLogicalHeightChanged = flowThread->pageLogicalSizeChanged();
}
}

Powered by Google App Engine
This is Rietveld 408576698