Index: third_party/WebKit/Source/core/layout/LayoutMultiColumnSpannerPlaceholder.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutMultiColumnSpannerPlaceholder.cpp b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSpannerPlaceholder.cpp |
index cd010bfc3356e96a2ecfb6e5008e6caa3fa4d393..cd055b618c7f4ded53f71d92cc1a3430503c8276 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnSpannerPlaceholder.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSpannerPlaceholder.cpp |
@@ -10,8 +10,9 @@ namespace blink { |
static void copyMarginProperties(ComputedStyle& placeholderStyle, |
const ComputedStyle& spannerStyle) { |
- // We really only need the block direction margins, but there are no setters for that in |
- // ComputedStyle. Just copy all margin sides. The inline ones don't matter anyway. |
+ // We really only need the block direction margins, but there are no setters |
+ // for that in ComputedStyle. Just copy all margin sides. The inline ones |
+ // don't matter anyway. |
placeholderStyle.setMarginLeft(spannerStyle.marginLeft()); |
placeholderStyle.setMarginRight(spannerStyle.marginRight()); |
placeholderStyle.setMarginTop(spannerStyle.marginTop()); |
@@ -47,12 +48,13 @@ void LayoutMultiColumnSpannerPlaceholder:: |
// No longer a valid spanner, due to style changes. |this| is now dead. |
if (objectInFlowThread->style()->hasOutOfFlowPosition() && |
!oldStyle->hasOutOfFlowPosition()) { |
- // We went from being a spanner to being out-of-flow positioned. When an object becomes |
- // out-of-flow positioned, we need to lay out its parent, since that's where the |
- // now-out-of-flow object gets added to the right containing block for out-of-flow |
- // positioned objects. Since neither a spanner nor an out-of-flow object is guaranteed |
- // to have this parent in its containing block chain, we need to mark it here, or we |
- // risk that the object isn't laid out. |
+ // We went from being a spanner to being out-of-flow positioned. When an |
+ // object becomes out-of-flow positioned, we need to lay out its parent, |
+ // since that's where the now-out-of-flow object gets added to the right |
+ // containing block for out-of-flow positioned objects. Since neither a |
+ // spanner nor an out-of-flow object is guaranteed to have this parent in |
+ // its containing block chain, we need to mark it here, or we risk that |
+ // the object isn't laid out. |
objectInFlowThread->parent()->setNeedsLayout( |
LayoutInvalidationReason::ColumnsChanged); |
} |
@@ -69,8 +71,8 @@ void LayoutMultiColumnSpannerPlaceholder::updateMarginProperties() { |
void LayoutMultiColumnSpannerPlaceholder::insertedIntoTree() { |
LayoutBox::insertedIntoTree(); |
- // The object may previously have been laid out as a non-spanner, but since it's a spanner now, |
- // it needs to be relaid out. |
+ // The object may previously have been laid out as a non-spanner, but since |
+ // it's a spanner now, it needs to be relaid out. |
m_layoutObjectInFlowThread->setNeedsLayoutAndPrefWidthsRecalc( |
LayoutInvalidationReason::ColumnsChanged); |
} |
@@ -79,8 +81,9 @@ void LayoutMultiColumnSpannerPlaceholder::willBeRemovedFromTree() { |
if (m_layoutObjectInFlowThread) { |
LayoutBox* exSpanner = m_layoutObjectInFlowThread; |
m_layoutObjectInFlowThread->clearSpannerPlaceholder(); |
- // Even if the placeholder is going away, the object in the flow thread might live on. Since |
- // it's not a spanner anymore, it needs to be relaid out. |
+ // Even if the placeholder is going away, the object in the flow thread |
+ // might live on. Since it's not a spanner anymore, it needs to be relaid |
+ // out. |
exSpanner->setNeedsLayoutAndPrefWidthsRecalc( |
LayoutInvalidationReason::ColumnsChanged); |
} |
@@ -105,20 +108,22 @@ LayoutUnit LayoutMultiColumnSpannerPlaceholder::maxPreferredLogicalWidth() |
void LayoutMultiColumnSpannerPlaceholder::layout() { |
ASSERT(needsLayout()); |
- // The placeholder, like any other block level object, has its logical top calculated and set |
- // before layout. Copy this to the actual column-span:all object before laying it out, so that |
- // it gets paginated correctly, in case we have an enclosing fragmentation context. |
+ // The placeholder, like any other block level object, has its logical top |
+ // calculated and set before layout. Copy this to the actual column-span:all |
+ // object before laying it out, so that it gets paginated correctly, in case |
+ // we have an enclosing fragmentation context. |
m_layoutObjectInFlowThread->setLogicalTop(logicalTop()); |
// Lay out the actual column-span:all element. |
m_layoutObjectInFlowThread->layoutIfNeeded(); |
- // The spanner has now been laid out, so its height is known. Time to update the placeholder's |
- // height as well, so that we take up the correct amount of space in the multicol container. |
+ // The spanner has now been laid out, so its height is known. Time to update |
+ // the placeholder's height as well, so that we take up the correct amount of |
+ // space in the multicol container. |
updateLogicalHeight(); |
- // Take the overflow from the spanner, so that it gets |
- // propagated to the multicol container and beyond. |
+ // Take the overflow from the spanner, so that it gets propagated to the |
+ // multicol container and beyond. |
m_overflow.reset(); |
addContentsVisualOverflow(m_layoutObjectInFlowThread->visualOverflowRect()); |
addLayoutOverflow(m_layoutObjectInFlowThread->layoutOverflowRect()); |