| 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 7dd15498787ce8cc6a45bfd7a3df4fbea49e4c71..982fafd0581cf152ffad702220b3e2a011217f0a 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
|
| @@ -695,10 +695,6 @@ LayoutUnit LayoutBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTop,
|
|
|
| // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one.
|
| LayoutUnit logicalTopAfterUnsplittable = adjustForUnsplittableChild(child, logicalTop);
|
| - LayoutUnit childLogicalHeight = child.logicalHeight();
|
| - bool neededBreakForUnsplittable = logicalTopAfterUnsplittable != logicalTop;
|
| - if (neededBreakForUnsplittable)
|
| - setPageBreak(logicalTop, childLogicalHeight - (logicalTopAfterUnsplittable - logicalTop));
|
|
|
| // Some sanity checks: No matter what the reason is for pushing the child to the next page or
|
| // column, the amount should be the same.
|
| @@ -728,26 +724,7 @@ LayoutUnit LayoutBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTop,
|
| }
|
| }
|
|
|
| - if (!neededBreakForUnsplittable) {
|
| - if (LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(newLogicalTop)) {
|
| - LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(newLogicalTop, AssociateWithLatterPage);
|
| - LayoutUnit spaceShortage = childLogicalHeight - remainingLogicalHeight;
|
| - if (spaceShortage > 0) {
|
| - // If the child crosses a column boundary, report a break, in case nothing inside it
|
| - // has already done so. The column balancer needs to know how much it has to stretch
|
| - // the columns to make more content fit. If no breaks are reported (but do occur),
|
| - // the balancer will have no clue. Only measure the space after the last column
|
| - // boundary, in case it crosses more than one.
|
| - LayoutUnit spaceShortageInLastColumn = intMod(spaceShortage, pageLogicalHeight);
|
| - setPageBreak(newLogicalTop, spaceShortageInLastColumn ? spaceShortageInLastColumn : spaceShortage);
|
| - } else if (remainingLogicalHeight == pageLogicalHeight && offsetFromLogicalTopOfFirstPage() + child.logicalTop()) {
|
| - // We're at the very top of a page or column, and it's not the first one. This child
|
| - // may turn out to be the smallest piece of content that causes a page break, so we
|
| - // need to report it.
|
| - setPageBreak(newLogicalTop, childLogicalHeight);
|
| - }
|
| - }
|
| - }
|
| + paginatedContentWasLaidOut(newLogicalTop);
|
|
|
| // Similar to how we apply clearance. Go ahead and boost height() to be the place where we're going to position the child.
|
| setLogicalHeight(logicalHeight() + (newLogicalTop - logicalTop));
|
| @@ -830,7 +807,6 @@ void LayoutBlockFlow::adjustLinePositionForPagination(RootInlineBox& lineBox, La
|
| clearShouldBreakAtLineToAvoidWidow();
|
| setDidBreakAtLineToAvoidWidow();
|
| }
|
| - setPageBreak(logicalOffset, lineHeight - remainingLogicalHeight);
|
| if (shouldSetStrutOnBlock(*this, lineBox, logicalOffset, lineIndex, remainingLogicalHeight)) {
|
| // Note that when setting the strut on a block, it may be propagated to parent blocks
|
| // later on, if a block's logical top is flush with that of its parent. We don't want
|
| @@ -842,6 +818,7 @@ void LayoutBlockFlow::adjustLinePositionForPagination(RootInlineBox& lineBox, La
|
| paginationStrut += marginBefore(); // Floats' margins do not collapse with page or column boundaries.
|
| setPaginationStrutPropagatedFromChild(paginationStrut);
|
| } else {
|
| + logicalOffset += remainingLogicalHeight;
|
| delta += remainingLogicalHeight;
|
| lineBox.setPaginationStrut(remainingLogicalHeight);
|
| lineBox.setIsFirstAfterPageBreak(true);
|
| @@ -850,9 +827,9 @@ void LayoutBlockFlow::adjustLinePositionForPagination(RootInlineBox& lineBox, La
|
| // We're at the very top of a page or column.
|
| if (lineBox != firstRootBox())
|
| lineBox.setIsFirstAfterPageBreak(true);
|
| - if (lineBox != firstRootBox() || offsetFromLogicalTopOfFirstPage())
|
| - setPageBreak(logicalOffset, lineHeight);
|
| }
|
| +
|
| + paginatedContentWasLaidOut(logicalOffset);
|
| }
|
|
|
| LayoutUnit LayoutBlockFlow::adjustForUnsplittableChild(LayoutBox& child, LayoutUnit logicalOffset)
|
| @@ -1703,14 +1680,8 @@ bool LayoutBlockFlow::mustSeparateMarginAfterForChild(const LayoutBox& child) co
|
|
|
| LayoutUnit LayoutBlockFlow::applyBeforeBreak(LayoutBox& child, LayoutUnit logicalOffset)
|
| {
|
| - if (child.hasForcedBreakBefore()) {
|
| - if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) {
|
| - LayoutUnit offsetBreakAdjustment = 0;
|
| - if (flowThread->addForcedColumnBreak(offsetFromLogicalTopOfFirstPage() + logicalOffset, &child, true, &offsetBreakAdjustment))
|
| - return logicalOffset + offsetBreakAdjustment;
|
| - }
|
| + if (child.hasForcedBreakBefore())
|
| return nextPageLogicalTop(logicalOffset, AssociateWithFormerPage);
|
| - }
|
| return logicalOffset;
|
| }
|
|
|
| @@ -1720,11 +1691,6 @@ LayoutUnit LayoutBlockFlow::applyAfterBreak(LayoutBox& child, LayoutUnit logical
|
| // So our margin doesn't participate in the next collapsing steps.
|
| marginInfo.clearMargin();
|
|
|
| - if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) {
|
| - LayoutUnit offsetBreakAdjustment = 0;
|
| - if (flowThread->addForcedColumnBreak(offsetFromLogicalTopOfFirstPage() + logicalOffset, &child, false, &offsetBreakAdjustment))
|
| - return logicalOffset + offsetBreakAdjustment;
|
| - }
|
| return nextPageLogicalTop(logicalOffset, AssociateWithFormerPage);
|
| }
|
| return logicalOffset;
|
|
|