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

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

Issue 138913007: Move RenderBlock::checkForPaginationLogicalHeightChange method to proper parent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/RenderBlockFlow.h ('k') | no next file » | 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 8370a7bc4aa3b91467243ff59d1a790b6f19c449..f40a75d8a94a8c165ead0df4ba92a78b4116edc9 100644
--- a/Source/core/rendering/RenderBlockFlow.cpp
+++ b/Source/core/rendering/RenderBlockFlow.cpp
@@ -187,6 +187,38 @@ void RenderBlockFlow::willBeDestroyed()
RenderBlock::willBeDestroyed();
}
+void RenderBlockFlow::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight)
+{
+ ColumnInfo* colInfo = columnInfo();
+ if (hasColumns()) {
+ if (!pageLogicalHeight) {
+ LayoutUnit oldLogicalHeight = logicalHeight();
+ setLogicalHeight(0);
+ // We need to go ahead and set our explicit page height if one exists, so that we can
+ // avoid doing two layout passes.
+ updateLogicalHeight();
+ LayoutUnit columnHeight = contentLogicalHeight();
+ if (columnHeight > 0) {
+ pageLogicalHeight = columnHeight;
+ hasSpecifiedPageLogicalHeight = true;
+ }
+ setLogicalHeight(oldLogicalHeight);
+ }
+ if (colInfo->columnHeight() != pageLogicalHeight && everHadLayout()) {
+ colInfo->setColumnHeight(pageLogicalHeight);
+ pageLogicalHeightChanged = true;
+ }
+
+ if (!hasSpecifiedPageLogicalHeight && !pageLogicalHeight)
+ colInfo->clearForcedBreaks();
+
+ colInfo->setPaginationUnit(paginationUnit());
+ } else if (isRenderFlowThread()) {
+ pageLogicalHeight = 1; // This is just a hack to always make sure we have a page logical height.
+ pageLogicalHeightChanged = toRenderFlowThread(this)->pageLogicalSizeChanged();
+ }
+}
+
bool RenderBlockFlow::relayoutForPagination(bool hasSpecifiedPageLogicalHeight, LayoutUnit pageLogicalHeight, LayoutStateMaintainer& statePusher)
{
if (!hasColumns())
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698