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

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

Issue 144463015: [New multicol] Avoid 1px tall multicol if percent height is unresolvable. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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/newmulticol/unresolvable-percent-max-height-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderMultiColumnSet.cpp
diff --git a/Source/core/rendering/RenderMultiColumnSet.cpp b/Source/core/rendering/RenderMultiColumnSet.cpp
index 07c05a6eb34d4f73e83cb0014cca7fbe584553bf..d66f8896fc4b1a371ef6a9930c9740cabec2b953 100644
--- a/Source/core/rendering/RenderMultiColumnSet.cpp
+++ b/Source/core/rendering/RenderMultiColumnSet.cpp
@@ -40,8 +40,8 @@ RenderMultiColumnSet::RenderMultiColumnSet(RenderFlowThread* flowThread)
, m_computedColumnCount(1)
, m_computedColumnWidth(0)
, m_computedColumnHeight(0)
- , m_maxColumnHeight(LayoutUnit::max())
- , m_minSpaceShortage(LayoutUnit::max())
+ , m_maxColumnHeight(RenderFlowThread::maxLogicalHeight())
+ , m_minSpaceShortage(RenderFlowThread::maxLogicalHeight())
, m_minimumColumnHeight(0)
{
}
@@ -148,8 +148,8 @@ LayoutUnit RenderMultiColumnSet::calculateBalancedHeight(bool initial) const
// amount of space shortage found during layout.
ASSERT(m_minSpaceShortage > 0); // We should never _shrink_ the height!
- ASSERT(m_minSpaceShortage != LayoutUnit::max()); // If this happens, we probably have a bug.
- if (m_minSpaceShortage == LayoutUnit::max())
+ ASSERT(m_minSpaceShortage != RenderFlowThread::maxLogicalHeight()); // If this happens, we probably have a bug.
+ if (m_minSpaceShortage == RenderFlowThread::maxLogicalHeight())
return m_computedColumnHeight; // So bail out rather than looping infinitely.
return m_computedColumnHeight + m_minSpaceShortage;
@@ -191,7 +191,7 @@ bool RenderMultiColumnSet::recalculateBalancedHeight(bool initial)
if (m_computedColumnHeight == oldColumnHeight)
return false; // No change. We're done.
- m_minSpaceShortage = LayoutUnit::max();
+ m_minSpaceShortage = RenderFlowThread::maxLogicalHeight();
clearForcedBreaks();
return true; // Need another pass.
}
@@ -244,12 +244,15 @@ void RenderMultiColumnSet::prepareForLayout()
if (multicolBlock->requiresBalancing()) {
// Set maximum column height. We will not stretch beyond this.
- m_maxColumnHeight = LayoutUnit::max();
- if (!multicolStyle->logicalHeight().isAuto())
+ m_maxColumnHeight = RenderFlowThread::maxLogicalHeight();
+ if (!multicolStyle->logicalHeight().isAuto()) {
m_maxColumnHeight = multicolBlock->computeContentLogicalHeight(multicolStyle->logicalHeight(), -1);
+ if (m_maxColumnHeight == -1)
+ m_maxColumnHeight = RenderFlowThread::maxLogicalHeight();
+ }
if (!multicolStyle->logicalMaxHeight().isUndefined()) {
LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight(multicolStyle->logicalMaxHeight(), -1);
- if (m_maxColumnHeight > logicalMaxHeight)
+ if (logicalMaxHeight != -1 && m_maxColumnHeight > logicalMaxHeight)
m_maxColumnHeight = logicalMaxHeight;
}
m_maxColumnHeight = heightAdjustedForSetOffset(m_maxColumnHeight);
« no previous file with comments | « LayoutTests/fast/multicol/newmulticol/unresolvable-percent-max-height-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698