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

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

Issue 2570643002: Only the first layout pass needs to go deep when pagination state changes. (Closed)
Patch Set: Different approach: establish separate LayoutState for in-flow and out-of-flow objects. Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 90580735abd81b1b7186e0d19831340fb5888269..1514c642f90d7823cb023e6b5ee137a82bf5982e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -408,22 +408,23 @@ void LayoutBlockFlow::layoutBlock(bool relayoutChildren) {
relayoutChildren |= logicalWidthChanged;
TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope);
- LayoutState state(*this, 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();
- }
+ bool paginationStateChanged = m_paginationStateChanged;
bool preferredLogicalWidthsWereDirty = preferredLogicalWidthsDirty();
// Multiple passes might be required for column based layout.
// The number of passes could be as high as the number of columns.
LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread();
do {
+ LayoutState state(*this, 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();
+ }
+
layoutChildren(relayoutChildren, layoutScope);
if (!preferredLogicalWidthsWereDirty && preferredLogicalWidthsDirty()) {
@@ -448,6 +449,13 @@ void LayoutBlockFlow::layoutBlock(bool relayoutChildren) {
break;
} while (true);
+ LayoutState state(*this, logicalWidthChanged);
+ if (paginationStateChanged) {
+ // We still haven't laid out positioned descendants, and we need to perform
+ // a deep layout on those too if pagination state changed.
+ state.setPaginationStateChanged();
+ }
+
// Remember the automatic logical height we got from laying out the children.
LayoutUnit unconstrainedHeight = logicalHeight();
LayoutUnit unconstrainedClientAfterEdge = clientLogicalBottom();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698