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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp

Issue 1406973008: Calculate minimum column height after layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review Created 5 years, 1 month 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: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index e394118edb9f5e1d1721112df0aa43ff0bff9fd4..8a9c65ee99a9f7da1dff121e2250a815366e5e52 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -737,17 +737,6 @@ LayoutUnit LayoutBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTop,
return newLogicalTop;
}
-static inline LayoutUnit calculateMinimumPageHeight(const ComputedStyle& style, const RootInlineBox& lastLine)
-{
- // We may require a certain minimum number of lines per page in order to satisfy
- // orphans and widows, and that may affect the minimum page height.
- unsigned lineCount = std::max<unsigned>(style.hasAutoOrphans() ? 1 : style.orphans(), style.widows());
- const RootInlineBox* firstLine = &lastLine;
- for (unsigned i = 1; i < lineCount && firstLine->prevRootBox(); i++)
- firstLine = firstLine->prevRootBox();
- return lastLine.lineBottomWithLeading() - firstLine->lineTopWithLeading();
-}
-
static inline bool shouldSetStrutOnBlock(const LayoutBlockFlow& block, const RootInlineBox& lineBox, LayoutUnit lineLogicalOffset, int lineIndex, LayoutUnit remainingLogicalHeight)
{
bool wantsStrutOnBlock = false;
@@ -786,7 +775,6 @@ void LayoutBlockFlow::adjustLinePositionForPagination(RootInlineBox& lineBox, La
// line and all following lines.
LayoutUnit logicalOffset = lineBox.lineTopWithLeading();
LayoutUnit lineHeight = lineBox.lineBottomWithLeading() - logicalOffset;
- updateMinimumPageHeight(logicalOffset, calculateMinimumPageHeight(styleRef(), lineBox));
logicalOffset += delta;
lineBox.setPaginationStrut(LayoutUnit());
lineBox.setIsFirstAfterPageBreak(false);
@@ -836,7 +824,7 @@ void LayoutBlockFlow::adjustLinePositionForPagination(RootInlineBox& lineBox, La
paginatedContentWasLaidOut(logicalOffset);
}
-LayoutUnit LayoutBlockFlow::adjustForUnsplittableChild(LayoutBox& child, LayoutUnit logicalOffset)
+LayoutUnit LayoutBlockFlow::adjustForUnsplittableChild(LayoutBox& child, LayoutUnit logicalOffset) const
{
if (child.paginationBreakability() == AllowAnyBreaks)
return logicalOffset;
@@ -845,7 +833,6 @@ LayoutUnit LayoutBlockFlow::adjustForUnsplittableChild(LayoutBox& child, LayoutU
if (child.isFloating())
childLogicalHeight += marginBeforeForChild(child) + marginAfterForChild(child);
LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
- updateMinimumPageHeight(logicalOffset, childLogicalHeight);
if (!pageLogicalHeight)
return logicalOffset;
LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, AssociateWithLatterPage);
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.h ('k') | third_party/WebKit/Source/core/layout/LayoutFlowThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698