Index: Source/core/rendering/RenderBlockFlow.cpp |
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp |
index 8e86cd9c3a371df555fd7d5b3ae7a4a0cf41af42..f8d99740d3e7c1f6f28f6ac58a593bfec059e9fa 100644 |
--- a/Source/core/rendering/RenderBlockFlow.cpp |
+++ b/Source/core/rendering/RenderBlockFlow.cpp |
@@ -1864,7 +1864,22 @@ void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* ol |
parentBlockFlow->markSiblingsWithFloatsForLayout(); |
} |
- createMultiColumnFlowThreadIfNeeded(); |
+ if ((diff == StyleDifferenceLayout || !oldStyle) && document().regionBasedColumnsEnabled()) { |
eseidel
2014/04/09 17:57:51
It may read nicer as a helper. I'm not sure the be
mstensho (USE GERRIT)
2014/04/09 18:58:27
Done.
|
+ bool needsFlowThread = style()->specifiesColumns(); |
+ if (!needsFlowThread != !multiColumnFlowThread()) { |
esprehn
2014/04/09 18:19:08
Please don't do this double negation with the ! on
mstensho (USE GERRIT)
2014/04/09 18:58:27
Done.
|
+ if (needsFlowThread) { |
+ RenderMultiColumnFlowThread* flowThread = RenderMultiColumnFlowThread::createAnonymous(document(), style()); |
+ addChild(flowThread); |
+ flowThread->populate(); |
+ RenderBlockFlowRareData& rareData = ensureRareData(); |
+ ASSERT(!rareData.m_multiColumnFlowThread); |
+ rareData.m_multiColumnFlowThread = flowThread; |
esprehn
2014/04/09 18:19:08
Can all of this live in a method instead of here?
mstensho (USE GERRIT)
2014/04/09 18:58:27
Done.
|
+ } else { |
+ multiColumnFlowThread()->evacuateAndDestroy(); |
eseidel
2014/04/09 17:57:51
Is it typical for renderers to move their children
esprehn
2014/04/09 18:19:08
I don't think we normally do this, instead we usua
mstensho (USE GERRIT)
2014/04/09 18:58:27
No, I think this is pretty special. The renderer o
|
+ ASSERT(!multiColumnFlowThread()); |
+ } |
+ } |
+ } |
} |
void RenderBlockFlow::updateStaticInlinePositionForChild(RenderBox* child, LayoutUnit logicalTop) |
@@ -2778,22 +2793,6 @@ RootInlineBox* RenderBlockFlow::createRootInlineBox() |
return new RootInlineBox(*this); |
} |
-void RenderBlockFlow::createMultiColumnFlowThreadIfNeeded() |
-{ |
- if ((style()->hasAutoColumnCount() && style()->hasAutoColumnWidth()) || !document().regionBasedColumnsEnabled()) |
- return; |
- |
- if (multiColumnFlowThread()) |
- return; |
- |
- setChildrenInline(false); |
- RenderMultiColumnFlowThread* flowThread = RenderMultiColumnFlowThread::createAnonymous(document(), style()); |
- RenderBlock::addChild(flowThread); |
- RenderBlockFlowRareData& rareData = ensureRareData(); |
- ASSERT(!rareData.m_multiColumnFlowThread); |
- rareData.m_multiColumnFlowThread = flowThread; |
-} |
- |
RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() |
{ |
if (m_rareData) |