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

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

Issue 2382733002: Introduce markChildForPaginationRelayoutIfNeeded(). (Closed)
Patch Set: Created 4 years, 3 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/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index d2285ac8f6bc584732cbabbeb72f05fdce6c60d1..d19f443b5f94744cc9a38d1f5bbb5810212a00c5 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -4053,13 +4053,15 @@ bool LayoutBox::hasNonCompositedScrollbars() const
return false;
}
-void LayoutBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScope)
+void LayoutBox::markChildForPaginationRelayoutIfNeeded(LayoutBox& child, SubtreeLayoutScope& layoutScope)
{
- ASSERT(!needsLayout());
- // If fragmentation height has changed, we need to lay out. No need to enter the layoutObject if it
- // is childless, though.
- if (view()->layoutState()->pageLogicalHeightChanged() && slowFirstChild())
- layoutScope.setChildNeedsLayout(this);
+ DCHECK(!child.needsLayout());
+ LayoutState* layoutState = view()->layoutState();
+ if (!layoutState->isPaginated())
+ return;
+
+ if (layoutState->pageLogicalHeightChanged() || (layoutState->pageLogicalHeight() && layoutState->pageLogicalOffset(child, child.logicalTop()) != child.pageLogicalOffset()))
+ layoutScope.setChildNeedsLayout(&child);
}
void LayoutBox::markOrthogonalWritingModeRoot()

Powered by Google App Engine
This is Rietveld 408576698