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

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

Issue 2454083002: Need a deep layout pass when becoming (un)fragmented. (Closed)
Patch Set: Created 4 years, 2 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
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.
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698