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

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

Issue 2529423003: Introduce resetLayout(), to offload layoutBlockFlow(). (Closed)
Patch Set: Created 4 years, 1 month 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 | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.h ('k') | 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 c25aeff888e2f5a41d8013278b9e84e802a083b7..e9c68ec0d7c578597f2143695733a6b978577e3c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -419,24 +419,13 @@ void LayoutBlockFlow::layoutBlock(bool relayoutChildren) {
}
DISABLE_CFI_PERF
-inline bool LayoutBlockFlow::layoutBlockFlow(bool relayoutChildren,
- SubtreeLayoutScope& layoutScope) {
- LayoutUnit oldLeft = logicalLeft();
- bool logicalWidthChanged = updateLogicalWidthAndColumnWidth();
- relayoutChildren |= logicalWidthChanged;
+void LayoutBlockFlow::resetLayout() {
+ if (!firstChild() && !isAnonymousBlock())
+ setChildrenInline(true);
+ setContainsInlineWithOutlineAndContinuation(false);
rebuildFloatsFromIntruding();
- 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();
- }
-
// 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
@@ -454,7 +443,7 @@ inline bool LayoutBlockFlow::layoutBlockFlow(bool relayoutChildren,
setHasMarginAfterQuirk(style()->hasMarginAfterQuirk());
}
- if (state.isPaginated()) {
+ if (view()->layoutState()->isPaginated()) {
setPaginationStrutPropagatedFromChild(LayoutUnit());
setFirstForcedBreakOffset(LayoutUnit());
@@ -470,23 +459,37 @@ inline bool LayoutBlockFlow::layoutBlockFlow(bool relayoutChildren,
setBreakBefore(LayoutBlock::breakBefore());
setBreakAfter(LayoutBlock::breakAfter());
}
+}
+
+DISABLE_CFI_PERF
+inline bool LayoutBlockFlow::layoutBlockFlow(bool relayoutChildren,
+ SubtreeLayoutScope& layoutScope) {
+ LayoutUnit oldLeft = logicalLeft();
+ bool logicalWidthChanged = updateLogicalWidthAndColumnWidth();
+ relayoutChildren |= logicalWidthChanged;
+
+ LayoutState state(*this, logicalWidthChanged);
+
+ if (m_paginationStateChanged) {
szager1 2016/11/30 20:33:28 Should this be inside resetLayout? Maybe pass a L
mstensho (USE GERRIT) 2016/11/30 20:47:58 This is something that ideally should only be done
+ // 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();
+ }
+
+ LayoutUnit previousHeight = logicalHeight();
+ resetLayout();
LayoutUnit beforeEdge = borderBefore() + paddingBefore();
LayoutUnit afterEdge =
borderAfter() + paddingAfter() + scrollbarLogicalHeight();
- LayoutUnit previousHeight = logicalHeight();
setLogicalHeight(beforeEdge);
- if (!firstChild() && !isAnonymousBlock())
- setChildrenInline(true);
-
TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope);
bool preferredLogicalWidthsWereDirty = preferredLogicalWidthsDirty();
- // Reset the flag here instead of in layoutInlineChildren() in case that
- // all inline children are removed from this block.
- setContainsInlineWithOutlineAndContinuation(false);
if (childrenInline())
layoutInlineChildren(relayoutChildren, afterEdge);
else
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698