Index: Source/core/layout/LayoutBlockFlow.cpp |
diff --git a/Source/core/layout/LayoutBlockFlow.cpp b/Source/core/layout/LayoutBlockFlow.cpp |
index d5aa6480168454a965083e47349e587897ca1998..01ab7038773e0ec0bc5541ad2ac6054d82546cd0 100644 |
--- a/Source/core/layout/LayoutBlockFlow.cpp |
+++ b/Source/core/layout/LayoutBlockFlow.cpp |
@@ -1311,7 +1311,7 @@ LayoutUnit LayoutBlockFlow::collapseMargins(LayoutBox& child, MarginInfo& margin |
// If margins would pull us past the top of the next page, then we need to pull back and pretend like the margins |
// collapsed into the page edge. |
LayoutState* layoutState = view()->layoutState(); |
- if (layoutState->isPaginated() && layoutState->pageLogicalHeight() && logicalTop > beforeCollapseLogicalTop) { |
+ if (layoutState->isPaginated() && isPageLogicalHeightKnown(beforeCollapseLogicalTop) && logicalTop > beforeCollapseLogicalTop) { |
LayoutUnit oldLogicalTop = logicalTop; |
logicalTop = std::min(logicalTop, nextPageLogicalTop(beforeCollapseLogicalTop)); |
setLogicalHeight(logicalHeight() + (logicalTop - oldLogicalTop)); |
@@ -1532,7 +1532,7 @@ LayoutUnit LayoutBlockFlow::estimateLogicalTopPosition(LayoutBox& child, const M |
// Adjust logicalTopEstimate down to the next page if the margins are so large that we don't fit on the current |
// page. |
LayoutState* layoutState = view()->layoutState(); |
- if (layoutState->isPaginated() && layoutState->pageLogicalHeight() && logicalTopEstimate > logicalHeight()) |
+ if (layoutState->isPaginated() && isPageLogicalHeightKnown(logicalHeight()) && logicalTopEstimate > logicalHeight()) |
logicalTopEstimate = std::min(logicalTopEstimate, nextPageLogicalTop(logicalHeight())); |
logicalTopEstimate += getClearDelta(&child, logicalTopEstimate); |