Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/ColumnBalancer.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp b/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp |
| index 989f2d8d0d04ee35211470212a40d4bf7c8780ec..3585c79961f766f3f800d0b2151aea63b9925969 100644 |
| --- a/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp |
| +++ b/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp |
| @@ -92,8 +92,7 @@ LayoutUnit InitialColumnHeightFinder::initialMinimalBalancedHeight() const |
| { |
| unsigned index = contentRunIndexWithTallestColumns(); |
| LayoutUnit startOffset = index > 0 ? m_contentRuns[index - 1].breakOffset() : group().logicalTopInFlowThread(); |
| - LayoutUnit logicalHeightEstimate = m_contentRuns[index].columnLogicalHeight(startOffset); |
| - return std::max(logicalHeightEstimate, m_minimumColumnLogicalHeight); |
| + return m_contentRuns[index].columnLogicalHeight(startOffset); |
| } |
| void InitialColumnHeightFinder::examineBoxAfterEntering(const LayoutBox& box) |
| @@ -113,8 +112,15 @@ void InitialColumnHeightFinder::examineBoxAfterEntering(const LayoutBox& box) |
| LayoutUnit unsplittableLogicalHeight = box.logicalHeight(); |
| if (box.isFloating()) |
| unsplittableLogicalHeight += box.marginBefore() + box.marginAfter(); |
| - if (m_minimumColumnLogicalHeight < unsplittableLogicalHeight) |
| - m_minimumColumnLogicalHeight = unsplittableLogicalHeight; |
| + if (m_tallestUnbreakableLogicalHeight < unsplittableLogicalHeight) |
|
leviw_travelin_and_unemployed
2015/11/20 22:26:31
I like max(). Clearly, max(countFolksWhoLikeMax(fo
mstensho (USE GERRIT)
2015/11/23 09:06:31
Done.
|
| + m_tallestUnbreakableLogicalHeight = unsplittableLogicalHeight; |
| + } else if (box.isLayoutBlockFlow()) { |
| + if (LayoutMultiColumnFlowThread* innerFlowThread = toLayoutBlockFlow(box).multiColumnFlowThread()) { |
| + LayoutUnit offsetInInnerFlowThread = flowThreadOffset() - innerFlowThread->blockOffsetInEnclosingFlowThread(); |
| + LayoutUnit innerUnbreakableHeight = innerFlowThread->tallestUnbreakableLogicalHeight(offsetInInnerFlowThread); |
| + if (m_tallestUnbreakableLogicalHeight < innerUnbreakableHeight) |
| + m_tallestUnbreakableLogicalHeight = innerUnbreakableHeight; |
| + } |
| } |
| } |
| @@ -138,8 +144,8 @@ void InitialColumnHeightFinder::examineLine(const RootInlineBox& line) |
| LayoutUnit lineTop = line.lineTopWithLeading(); |
| LayoutUnit lineTopInFlowThread = flowThreadOffset() + lineTop; |
| LayoutUnit minimumLogialHeight = columnLogicalHeightRequirementForLine(line.block().styleRef(), line); |
| - if (m_minimumColumnLogicalHeight < minimumLogialHeight) |
| - m_minimumColumnLogicalHeight = minimumLogialHeight; |
| + if (m_tallestUnbreakableLogicalHeight < minimumLogialHeight) |
| + m_tallestUnbreakableLogicalHeight = minimumLogialHeight; |
| ASSERT(isFirstAfterBreak(lineTopInFlowThread) || !line.paginationStrut()); |
| if (isFirstAfterBreak(lineTopInFlowThread)) |
| recordStrutBeforeOffset(lineTopInFlowThread, line.paginationStrut()); |