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 eff4a92a2984d6d0e01a3bbd28dca308342cce72..6c9bbd1bed553b823e171b1a2706a7cc458c6593 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp |
@@ -492,6 +492,14 @@ inline bool LayoutBlockFlow::layoutBlockFlow(bool relayoutChildren, |
LayoutState state(*this, locationOffset(), pageLogicalHeight, |
pageLogicalHeightChanged, logicalWidthChanged); |
+ if (m_paginationStateChanged) { |
+ // We now need a deep layout to clean up struts after pagination, if we |
+ // just ceased to be paginated, or, if we just became paginated on the |
+ // other hand, we now need the deep layout, to insert pagination struts. |
+ m_paginationStateChanged = false; |
+ state.setPaginationStateChanged(); |
+ } |
+ |
// We use four values, maxTopPos, maxTopNeg, maxBottomPos, and maxBottomNeg, |
// to track our current maximal positive and negative margins. These values |
// are used when we are collapsed with adjacent blocks, so for example, if you |
@@ -4206,6 +4214,7 @@ void LayoutBlockFlow::createOrDestroyMultiColumnFlowThreadIfNeeded( |
// spanners, paged containers may not). |
multiColumnFlowThread()->evacuateAndDestroy(); |
ASSERT(!multiColumnFlowThread()); |
+ m_paginationStateChanged = true; |
} |
} |
@@ -4225,6 +4234,7 @@ void LayoutBlockFlow::createOrDestroyMultiColumnFlowThreadIfNeeded( |
LayoutMultiColumnFlowThread* flowThread = createMultiColumnFlowThread(type); |
addChild(flowThread); |
+ m_paginationStateChanged = true; |
// Check that addChild() put the flow thread as a direct child, and didn't do |
// fancy things. |