Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3039)

Unified Diff: Source/core/rendering/RenderMultiColumnFlowThread.cpp

Issue 218663004: Changing between multicol and regular block shouldn't recreate all renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderMultiColumnFlowThread.h ('k') | Source/core/rendering/style/RenderStyle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderMultiColumnFlowThread.cpp
diff --git a/Source/core/rendering/RenderMultiColumnFlowThread.cpp b/Source/core/rendering/RenderMultiColumnFlowThread.cpp
index 3c135121b616ae35aac50856df453c8411a4eb57..fcf0f3affb67448b9087849f6841599662ec927d 100644
--- a/Source/core/rendering/RenderMultiColumnFlowThread.cpp
+++ b/Source/core/rendering/RenderMultiColumnFlowThread.cpp
@@ -52,6 +52,40 @@ RenderMultiColumnFlowThread* RenderMultiColumnFlowThread::createAnonymous(Docume
return renderer;
}
+void RenderMultiColumnFlowThread::populate()
+{
+ RenderBlockFlow* multicolContainer = multiColumnBlockFlow();
+ ASSERT(!nextSibling());
+ // Reparent children preceding the flow thread into the flow thread. It's multicol content
+ // now. At this point there's obviously nothing after the flow thread, but renderers (column
+ // sets and spanners) will be inserted there as we insert elements into the flow thread.
+ multicolContainer->moveChildrenTo(this, multicolContainer->firstChild(), this, true);
+}
+
+void RenderMultiColumnFlowThread::evacuateAndDestroy()
+{
+ RenderBlockFlow* multicolContainer = multiColumnBlockFlow();
+
+ // Remove all sets.
+ for (RenderBox* sibling = nextSiblingBox(); sibling;) {
+ RenderBox* nextSibling = sibling->nextSiblingBox();
+ if (sibling->isRenderMultiColumnSet())
+ sibling->destroy();
+ sibling = nextSibling;
+ }
+
+ ASSERT(!previousSibling());
+ ASSERT(!nextSibling());
+
+ // Finally we can promote all flow thread's children. Before we move them to the flow thread's
+ // container, we need to unregister the flow thread, so that they aren't just re-added again to
+ // the flow thread that we're trying to empty.
+ multicolContainer->resetMultiColumnFlowThread();
+ moveAllChildrenTo(multicolContainer, true);
+
+ destroy();
+}
+
void RenderMultiColumnFlowThread::layoutColumns(bool relayoutChildren, SubtreeLayoutScope& layoutScope)
{
// Update the dimensions of our regions before we lay out the flow thread.
« no previous file with comments | « Source/core/rendering/RenderMultiColumnFlowThread.h ('k') | Source/core/rendering/style/RenderStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698