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

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: Fix test failures in debug mode. 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
« no previous file with comments | « Source/core/rendering/LayoutState.cpp ('k') | Source/core/rendering/RenderFlowThread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlockFlow.cpp
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp
index 1e5e7fd046b940073b8555b2fc13061822a561cd..7e1806454ed73e3d3bdf72ce01d3917d374d03d6 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);
+
+ // FIXME: 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();
}
}
« no previous file with comments | « Source/core/rendering/LayoutState.cpp ('k') | Source/core/rendering/RenderFlowThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698