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

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

Issue 789433006: [New Multicolumn] Let a spanner's containing block be the multicol container. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Compiling release: paint invalidation state is cleared in the super class anyway. Created 6 years 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
Index: Source/core/rendering/RenderMultiColumnSpannerPlaceholder.cpp
diff --git a/Source/core/rendering/RenderMultiColumnSpannerPlaceholder.cpp b/Source/core/rendering/RenderMultiColumnSpannerPlaceholder.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..eee694b7b97de236f75554d66c0e4133aeb10933
--- /dev/null
+++ b/Source/core/rendering/RenderMultiColumnSpannerPlaceholder.cpp
@@ -0,0 +1,74 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/rendering/RenderMultiColumnSpannerPlaceholder.h"
+
+namespace blink {
+
+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);
+ newSpanner->setStyle(newStyle);
+ return newSpanner;
+}
+
+RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder(RenderBox* rendererInFlowThread)
+ : RenderBox(0)
+ , m_rendererInFlowThread(rendererInFlowThread)
+{
+}
+
+void RenderMultiColumnSpannerPlaceholder::spannerWillBeRemoved()
+{
+ ASSERT(m_rendererInFlowThread);
+ RenderBox* renderer = m_rendererInFlowThread;
+ m_rendererInFlowThread = 0;
+ flowThread()->flowThreadDescendantWillBeRemoved(renderer);
+ // |this| should be destroyed by now.
+}
+
+void RenderMultiColumnSpannerPlaceholder::willBeRemovedFromTree()
+{
+ if (m_rendererInFlowThread)
+ m_rendererInFlowThread->clearSpannerPlaceholder();
+ RenderBox::willBeRemovedFromTree();
+}
+
+bool RenderMultiColumnSpannerPlaceholder::needsPreferredWidthsRecalculation() const
+{
+ return m_rendererInFlowThread->needsPreferredWidthsRecalculation();
+}
+
+void RenderMultiColumnSpannerPlaceholder::layout()
+{
+ ASSERT(needsLayout());
+
+ // FIXME: actual spanner positioning isn't implemented yet. Just set it to 0,0 for consistency
+ // (in case the spanner used to be something else that was laid out properly).
+ m_rendererInFlowThread->setLogicalTop(LayoutUnit());
+ m_rendererInFlowThread->setLogicalLeft(LayoutUnit());
+
+ // Lay out the actual column-span:all element.
+ m_rendererInFlowThread->layoutIfNeeded();
+
+ clearNeedsLayout();
+}
+
+void RenderMultiColumnSpannerPlaceholder::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState)
+{
+ PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *this, paintInvalidationState.paintInvalidationContainer());
+ m_rendererInFlowThread->invalidateTreeIfNeeded(newPaintInvalidationState);
+ RenderBox::invalidateTreeIfNeeded(paintInvalidationState);
+}
+
+const char* RenderMultiColumnSpannerPlaceholder::renderName() const
+{
+ return "RenderMultiColumnSpannerPlaceholder";
+}
+
+}
« no previous file with comments | « Source/core/rendering/RenderMultiColumnSpannerPlaceholder.h ('k') | Source/core/rendering/RenderMultiColumnSpannerSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698