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

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

Issue 584033002: [New Multicolumn] Add support for column-span:all (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix ref in test. Tables don't do subpixel, and that made a difference on Windows and Mac. Created 6 years, 2 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/RenderMultiColumnSpannerSet.h ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderMultiColumnSpannerSet.cpp
diff --git a/Source/core/rendering/RenderMultiColumnSpannerSet.cpp b/Source/core/rendering/RenderMultiColumnSpannerSet.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f405698ccfea8d13d0d087563f873d420dcceb4f
--- /dev/null
+++ b/Source/core/rendering/RenderMultiColumnSpannerSet.cpp
@@ -0,0 +1,65 @@
+// 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/RenderMultiColumnSpannerSet.h"
+
+namespace blink {
+
+static void copyMarginProperties(RenderStyle* destination, const RenderStyle* source)
+{
+ destination->setMarginTop(source->marginTop());
+ destination->setMarginBottom(source->marginBottom());
+ destination->setMarginLeft(source->marginLeft());
+ destination->setMarginRight(source->marginRight());
+}
+
+RenderMultiColumnSpannerSet* RenderMultiColumnSpannerSet::createAnonymous(RenderMultiColumnFlowThread* flowThread, RenderStyle* parentStyle, RenderBox* rendererInFlowThread)
+{
+ RenderMultiColumnSpannerSet* newSpanner = new RenderMultiColumnSpannerSet(flowThread, rendererInFlowThread);
+ Document& document = flowThread->document();
+ newSpanner->setDocumentForAnonymous(&document);
+ RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(parentStyle, BLOCK);
+ copyMarginProperties(newStyle.get(), rendererInFlowThread->style());
+ newSpanner->setStyle(newStyle);
+ return newSpanner;
+}
+
+RenderMultiColumnSpannerSet::RenderMultiColumnSpannerSet(RenderMultiColumnFlowThread* flowThread, RenderBox* rendererInFlowThread)
+ : RenderMultiColumnSet(flowThread)
+ , m_rendererInFlowThread(rendererInFlowThread)
+{
+}
+
+void RenderMultiColumnSpannerSet::updateMarginProperties()
+{
+ RefPtr<RenderStyle> newStyle = RenderStyle::clone(style());
+ copyMarginProperties(newStyle.get(), m_rendererInFlowThread->style());
+ setStyle(newStyle);
+}
+
+bool RenderMultiColumnSpannerSet::recalculateColumnHeight(BalancedHeightCalculation calculationMode)
+{
+ return false;
+}
+
+void RenderMultiColumnSpannerSet::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
+{
+ computedValues.m_extent = m_rendererInFlowThread->logicalHeight();
+ computedValues.m_position = logicalTop + m_rendererInFlowThread->marginTop();
+ computedValues.m_margins.m_before = marginBefore();
+ computedValues.m_margins.m_after = marginAfter();
+}
+
+LayoutUnit RenderMultiColumnSpannerSet::pageLogicalHeight() const
+{
+ return m_rendererInFlowThread->logicalHeight();
+}
+
+const char* RenderMultiColumnSpannerSet::renderName() const
+{
+ return "RenderMultiColumnSpannerSet";
+}
+
+}
« no previous file with comments | « Source/core/rendering/RenderMultiColumnSpannerSet.h ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698