Index: Source/core/rendering/RenderBlock.cpp |
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp |
index fbd1d494c7b239d82916e9157fdf4fbe33c34109..b758cdfa0459b33f084493eb8e4d9ca14a8c1687 100644 |
--- a/Source/core/rendering/RenderBlock.cpp |
+++ b/Source/core/rendering/RenderBlock.cpp |
@@ -6488,8 +6488,13 @@ void RenderBlock::adjustLinePositionForPagination(RootInlineBox* lineBox, Layout |
lineBox->setPaginationStrut(remainingLogicalHeight); |
lineBox->setIsFirstAfterPageBreak(true); |
} |
- } else if (remainingLogicalHeight == pageLogicalHeight && lineBox != firstRootBox()) |
- lineBox->setIsFirstAfterPageBreak(true); |
+ } else if (remainingLogicalHeight == pageLogicalHeight) { |
+ // We're at the very top of a page or column. |
+ if (lineBox != firstRootBox()) |
+ lineBox->setIsFirstAfterPageBreak(true); |
+ if (lineBox != firstRootBox() || offsetFromLogicalTopOfFirstPage()) |
+ setPageBreak(logicalOffset, lineHeight); |
+ } |
} |
bool RenderBlock::lineWidthForPaginatedLineChanged(RootInlineBox* rootBox, LayoutUnit lineDelta, RenderFlowThread* flowThread) const |