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

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

Issue 1322513003: Multicol: Min-height should have no effect if content is taller and height is auto. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use block instead of inline in test, so that we don't have to make assumptions about internal leadiā€¦ Created 5 years, 3 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 | « LayoutTests/fast/multicol/min-height-much-greater-than-content-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBlockFlow.cpp
diff --git a/Source/core/layout/LayoutBlockFlow.cpp b/Source/core/layout/LayoutBlockFlow.cpp
index 4a61c42bd3e755cbc2d2aee165a938c4d64d2172..92339397838f5d5798dd85b13e38564c4f5a490b 100644
--- a/Source/core/layout/LayoutBlockFlow.cpp
+++ b/Source/core/layout/LayoutBlockFlow.cpp
@@ -209,11 +209,23 @@ bool LayoutBlockFlow::updateLogicalWidthAndColumnWidth()
void LayoutBlockFlow::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight)
{
if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) {
- LogicalExtentComputedValues computedValues;
- computeLogicalHeight(LayoutUnit(), logicalTop(), computedValues);
- LayoutUnit columnHeight = computedValues.m_extent - borderAndPaddingLogicalHeight() - scrollbarLogicalHeight();
+ // Calculate the non-auto content box height, or set it to 0 if it's auto. We need to know
+ // this before layout, so that we can figure out where to insert column breaks. We also
+ // treat LayoutView (which may be paginated, which uses the multicol implmentation) as
+ // having non-auto height, since its height is deduced from the viewport height. We use
+ // computeLogicalHeight() to calculate the content box height. That method will clamp
+ // against max-height and min-height. Since we're now at the beginning of layout, and we
+ // don't know the actual height of the content yet, only call that method when height is
+ // definite, or we might fool ourselves into believing that columns have a definite height
+ // when they in fact don't.
+ LayoutUnit columnHeight;
+ if (hasDefiniteLogicalHeight() || isLayoutView()) {
+ LogicalExtentComputedValues computedValues;
+ computeLogicalHeight(LayoutUnit(), logicalTop(), computedValues);
+ columnHeight = computedValues.m_extent - borderAndPaddingLogicalHeight() - scrollbarLogicalHeight();
+ }
pageLogicalHeightChanged = columnHeight != flowThread->columnHeightAvailable();
- flowThread->setColumnHeightAvailable(std::max<LayoutUnit>(columnHeight, 0));
+ flowThread->setColumnHeightAvailable(std::max(columnHeight, LayoutUnit()));
} else if (isLayoutFlowThread()) {
LayoutFlowThread* flowThread = toLayoutFlowThread(this);
« no previous file with comments | « LayoutTests/fast/multicol/min-height-much-greater-than-content-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698