Index: Source/core/rendering/RenderMultiColumnSpannerPlaceholder.cpp |
diff --git a/Source/core/rendering/RenderMultiColumnSpannerPlaceholder.cpp b/Source/core/rendering/RenderMultiColumnSpannerPlaceholder.cpp |
index b0555a5b2af6c9766a4a282382d2e39e16ee7c6e..f028dcf4b871ce38e4399eadaad1ad898b759ece 100644 |
--- a/Source/core/rendering/RenderMultiColumnSpannerPlaceholder.cpp |
+++ b/Source/core/rendering/RenderMultiColumnSpannerPlaceholder.cpp |
@@ -7,12 +7,23 @@ |
namespace blink { |
+static void copyMarginProperties(RenderStyle* placeholderStyle, const RenderStyle* spannerStyle) |
+{ |
+ // We really only need the block direction margins, but there are no setters for that in |
+ // RenderStyle. Just copy all margin sides. The inline ones don't matter anyway. |
+ placeholderStyle->setMarginLeft(spannerStyle->marginLeft()); |
+ placeholderStyle->setMarginRight(spannerStyle->marginRight()); |
+ placeholderStyle->setMarginTop(spannerStyle->marginTop()); |
+ placeholderStyle->setMarginBottom(spannerStyle->marginBottom()); |
+} |
+ |
RenderMultiColumnSpannerPlaceholder* RenderMultiColumnSpannerPlaceholder::createAnonymous(RenderStyle* parentStyle, RenderBox* rendererInFlowThread) |
{ |
RenderMultiColumnSpannerPlaceholder* newSpanner = new RenderMultiColumnSpannerPlaceholder(rendererInFlowThread); |
Document& document = rendererInFlowThread->document(); |
newSpanner->setDocumentForAnonymous(&document); |
RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(parentStyle, BLOCK); |
+ copyMarginProperties(newStyle.get(), rendererInFlowThread->style()); |
newSpanner->setStyle(newStyle); |
return newSpanner; |
} |
@@ -32,6 +43,13 @@ void RenderMultiColumnSpannerPlaceholder::spannerWillBeRemoved() |
// |this| should be destroyed by now. |
} |
+void RenderMultiColumnSpannerPlaceholder::updateMarginProperties() |
+{ |
+ RefPtr<RenderStyle> newStyle = RenderStyle::clone(style()); |
+ copyMarginProperties(newStyle.get(), m_rendererInFlowThread->style()); |
+ setStyle(newStyle); |
+} |
+ |
void RenderMultiColumnSpannerPlaceholder::willBeRemovedFromTree() |
{ |
if (m_rendererInFlowThread) |
@@ -62,6 +80,8 @@ void RenderMultiColumnSpannerPlaceholder::computeLogicalHeight(LayoutUnit, Layou |
{ |
computedValues.m_extent = m_rendererInFlowThread->logicalHeight(); |
computedValues.m_position = logicalTop; |
+ computedValues.m_margins.m_before = marginBefore(); |
+ computedValues.m_margins.m_after = marginAfter(); |
} |
void RenderMultiColumnSpannerPlaceholder::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState) |