Chromium Code Reviews| Index: Source/core/rendering/RenderBlockFlow.cpp |
| diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp |
| index afc0212fa770522ad2b8b05610560df1286d5192..276b8a04976dab08cec661d116cc748680c42e6b 100644 |
| --- a/Source/core/rendering/RenderBlockFlow.cpp |
| +++ b/Source/core/rendering/RenderBlockFlow.cpp |
| @@ -546,11 +546,44 @@ void RenderBlockFlow::setLogicalTopForChild(RenderBox* child, LayoutUnit logical |
| } |
| } |
| +class ColumnSpannerLayoutScope { |
| +public: |
| + ColumnSpannerLayoutScope() |
| + : m_spanner(0) { } |
|
Julien - ping for review
2014/11/26 21:09:00
Nit: I prefer to stick with a statement per line,
mstensho (USE GERRIT)
2014/11/27 21:20:29
Done.
|
| + |
| + ~ColumnSpannerLayoutScope() |
| + { |
| + if (!m_spanner) |
| + return; |
| + m_spanner->flowThreadContainingBlock()->exitColumnSpannerAfterLayout(m_spanner, m_spanner->parentBlock()->logicalHeight()); |
| + } |
| + |
| + LayoutUnit enterSpanner(RenderBox* spanner, SubtreeLayoutScope& layoutScope) |
| + { |
| + ASSERT(!m_spanner); |
| + m_spanner = spanner; |
| + return m_spanner->flowThreadContainingBlock()->enterColumnSpannerBeforeLayout(m_spanner, m_spanner->parentBlock()->logicalHeight(), layoutScope); |
| + } |
| + |
| +private: |
| + RenderBox* m_spanner; |
| +}; |
| + |
| void RenderBlockFlow::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, LayoutUnit& previousFloatLogicalBottom) |
| { |
| LayoutUnit oldPosMarginBefore = maxPositiveMarginBefore(); |
| LayoutUnit oldNegMarginBefore = maxNegativeMarginBefore(); |
| + SubtreeLayoutScope layoutScope(*child); |
| + |
| + ColumnSpannerLayoutScope columnSpannerLayoutScope; |
| + if (child->isColumnSpanAll()) { |
| + LayoutUnit adjustment = columnSpannerLayoutScope.enterSpanner(child, layoutScope); |
| + // A spanner needs to start at an exact column boundary inside the flow thread, so that it |
| + // doesn't bleed into a preceding column. That's what the adjustment is about. |
| + setLogicalHeight(logicalHeight() + adjustment); |
| + } |
| + |
| // The child is a normal flow object. Compute the margins we will use for collapsing now. |
| child->computeAndSetBlockDirectionMargins(this); |
| @@ -592,7 +625,6 @@ void RenderBlockFlow::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, |
| previousFloatLogicalBottom = std::max(previousFloatLogicalBottom, oldLogicalTop + childRenderBlockFlow->lowestFloatLogicalBottom()); |
| } |
| - SubtreeLayoutScope layoutScope(*child); |
| if (!child->needsLayout()) |
| child->markForPaginationRelayoutIfNeeded(layoutScope); |