| Index: Source/core/rendering/RenderBlockFlow.cpp
|
| diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp
|
| index 8370a7bc4aa3b91467243ff59d1a790b6f19c449..037a505caf74f5a9d98c25129a1c1ac03f9d9b91 100644
|
| --- a/Source/core/rendering/RenderBlockFlow.cpp
|
| +++ b/Source/core/rendering/RenderBlockFlow.cpp
|
| @@ -1527,15 +1527,21 @@ bool RenderBlockFlow::mustSeparateMarginAfterForChild(const RenderBox* child) co
|
| LayoutUnit RenderBlockFlow::applyBeforeBreak(RenderBox* child, LayoutUnit logicalOffset)
|
| {
|
| // FIXME: Add page break checking here when we support printing.
|
| - bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns();
|
| - bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->m_pageLogicalHeight; // FIXME: Once columns can print we have to check this.
|
| RenderFlowThread* flowThread = flowThreadContainingBlock();
|
| + bool isInsideMulticolFlowThread = flowThread && !flowThread->isRenderNamedFlowThread();
|
| + bool checkColumnBreaks = isInsideMulticolFlowThread || view()->layoutState()->isPaginatingColumns();
|
| + bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->m_pageLogicalHeight; // FIXME: Once columns can print we have to check this.
|
| bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread();
|
| - bool checkBeforeAlways = (checkColumnBreaks && child->style()->columnBreakBefore() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakBefore() == PBALWAYS)
|
| + bool checkBeforeAlways = (checkColumnBreaks && child->style()->columnBreakBefore() == PBALWAYS)
|
| + || (checkPageBreaks && child->style()->pageBreakBefore() == PBALWAYS)
|
| || (checkRegionBreaks && child->style()->regionBreakBefore() == PBALWAYS);
|
| if (checkBeforeAlways && inNormalFlow(child) && hasNextPage(logicalOffset, IncludePageBoundary)) {
|
| - if (checkColumnBreaks)
|
| - view()->layoutState()->addForcedColumnBreak(child, logicalOffset);
|
| + if (checkColumnBreaks) {
|
| + if (isInsideMulticolFlowThread)
|
| + checkRegionBreaks = true;
|
| + else
|
| + view()->layoutState()->addForcedColumnBreak(child, logicalOffset);
|
| + }
|
| if (checkRegionBreaks) {
|
| LayoutUnit offsetBreakAdjustment = 0;
|
| if (flowThread->addForcedRegionBreak(offsetFromLogicalTopOfFirstPage() + logicalOffset, child, true, &offsetBreakAdjustment))
|
| @@ -1549,11 +1555,13 @@ LayoutUnit RenderBlockFlow::applyBeforeBreak(RenderBox* child, LayoutUnit logica
|
| LayoutUnit RenderBlockFlow::applyAfterBreak(RenderBox* child, LayoutUnit logicalOffset, MarginInfo& marginInfo)
|
| {
|
| // FIXME: Add page break checking here when we support printing.
|
| - bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns();
|
| - bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->m_pageLogicalHeight; // FIXME: Once columns can print we have to check this.
|
| RenderFlowThread* flowThread = flowThreadContainingBlock();
|
| + bool isInsideMulticolFlowThread = flowThread && !flowThread->isRenderNamedFlowThread();
|
| + bool checkColumnBreaks = isInsideMulticolFlowThread || view()->layoutState()->isPaginatingColumns();
|
| + bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->m_pageLogicalHeight; // FIXME: Once columns can print we have to check this.
|
| bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread();
|
| - bool checkAfterAlways = (checkColumnBreaks && child->style()->columnBreakAfter() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakAfter() == PBALWAYS)
|
| + bool checkAfterAlways = (checkColumnBreaks && child->style()->columnBreakAfter() == PBALWAYS)
|
| + || (checkPageBreaks && child->style()->pageBreakAfter() == PBALWAYS)
|
| || (checkRegionBreaks && child->style()->regionBreakAfter() == PBALWAYS);
|
| if (checkAfterAlways && inNormalFlow(child) && hasNextPage(logicalOffset, IncludePageBoundary)) {
|
| LayoutUnit marginOffset = marginInfo.canCollapseWithMarginBefore() ? LayoutUnit() : marginInfo.margin();
|
| @@ -1561,8 +1569,12 @@ LayoutUnit RenderBlockFlow::applyAfterBreak(RenderBox* child, LayoutUnit logical
|
| // So our margin doesn't participate in the next collapsing steps.
|
| marginInfo.clearMargin();
|
|
|
| - if (checkColumnBreaks)
|
| - view()->layoutState()->addForcedColumnBreak(child, logicalOffset);
|
| + if (checkColumnBreaks) {
|
| + if (isInsideMulticolFlowThread)
|
| + checkRegionBreaks = true;
|
| + else
|
| + view()->layoutState()->addForcedColumnBreak(child, logicalOffset);
|
| + }
|
| if (checkRegionBreaks) {
|
| LayoutUnit offsetBreakAdjustment = 0;
|
| if (flowThread->addForcedRegionBreak(offsetFromLogicalTopOfFirstPage() + logicalOffset + marginOffset, child, false, &offsetBreakAdjustment))
|
|
|