Index: third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp |
index c8a234d1e1cb9aee533fa542ee1176a5ddbf9f30..5f114cf6b8f25bff7b0b037495ef027cfda03d09 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp |
@@ -38,6 +38,7 @@ LayoutMultiColumnSet::LayoutMultiColumnSet(LayoutFlowThread* flowThread) |
: LayoutBlockFlow(nullptr) |
, m_fragmentainerGroups(*this) |
, m_flowThread(flowThread) |
+ , m_initialHeightCalculated(false) |
{ |
} |
@@ -244,13 +245,20 @@ LayoutUnit LayoutMultiColumnSet::pageLogicalTopForOffset(LayoutUnit offset) cons |
return fragmentainerGroupAtFlowThreadOffset(offset).columnLogicalTopForOffset(offset); |
} |
-bool LayoutMultiColumnSet::recalculateColumnHeight(BalancedColumnHeightCalculation calculationMode) |
+bool LayoutMultiColumnSet::recalculateColumnHeight() |
{ |
- if (calculationMode == GuessFromFlowThreadPortion) |
- m_tallestUnbreakableLogicalHeight = LayoutUnit(); |
+ if (m_oldLogicalTop != logicalTop() && multiColumnFlowThread()->enclosingFlowThread()) { |
+ // Preceding spanners or column sets have been moved or resized. This means that the |
+ // fragmentainer groups that we have inserted need to be re-inserted. Restart column |
+ // balancing. |
+ resetColumnHeight(); |
+ return true; |
+ } |
+ |
bool changed = false; |
for (auto& group : m_fragmentainerGroups) |
- changed = group.recalculateColumnHeight(calculationMode) || changed; |
+ changed = group.recalculateColumnHeight() || changed; |
+ m_initialHeightCalculated = true; |
return changed; |
} |
@@ -258,6 +266,8 @@ void LayoutMultiColumnSet::resetColumnHeight() |
{ |
m_fragmentainerGroups.deleteExtraGroups(); |
m_fragmentainerGroups.first().resetColumnHeight(); |
+ m_tallestUnbreakableLogicalHeight = LayoutUnit(); |
+ m_initialHeightCalculated = false; |
} |
void LayoutMultiColumnSet::beginFlow(LayoutUnit offsetInFlowThread) |