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() |