Index: Source/core/rendering/RenderMultiColumnSpannerSet.h |
diff --git a/Source/core/rendering/RenderMultiColumnSpannerSet.h b/Source/core/rendering/RenderMultiColumnSpannerSet.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6f0d5d8849963b28a7e54c0bff6ea4a79bc0a819 |
--- /dev/null |
+++ b/Source/core/rendering/RenderMultiColumnSpannerSet.h |
@@ -0,0 +1,52 @@ |
+// 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. |
+ |
+#ifndef RenderMultiColumnSpannerSet_h |
+#define RenderMultiColumnSpannerSet_h |
+ |
+#include "core/rendering/RenderMultiColumnSet.h" |
+ |
+namespace blink { |
+ |
+// "Column" set for column-span:all elements. Positions the portion of the flow thread that a |
+// spanner takes up. The actual renderer that sets column-span all is laid out as part of flow |
+// thread layout (although it cannot use the flow thread width when calculating its own with; it has |
+// to pretend that the containing block is the multicol container, not the flow |
+// thread). RenderMultiColumnSpannerSet just makes sure that it's positioned correctly among other |
+// column sets, within the multicol container. |
+// |
+// FIXME: should consider not inheriting from RenderMultiColumnSet (but rather from some common base |
+// class). Most of what's in RenderMultiColumnSet is of no interest to us. |
+class RenderMultiColumnSpannerSet FINAL : public RenderMultiColumnSet { |
+public: |
+ virtual bool isRenderMultiColumnSpannerSet() const OVERRIDE { return true; } |
+ |
+ static RenderMultiColumnSpannerSet* createAnonymous(RenderMultiColumnFlowThread*, RenderStyle* parentStyle, RenderBox*); |
+ |
+ RenderBox* rendererInFlowThread() const { return m_rendererInFlowThread; } |
+ |
+ // Copy margin properties from the column-span:all renderer to this spanner set. Block direction |
+ // margins on column spanners are not to collapse with anything in the adjacent columns. Having |
+ // to worry about that in general block layout code inside the flow thread would be complex and |
+ // messy, so they are applied on the spanner set instead, and ignored on the actual |
+ // column-span:all renderer during flow thread layout. |
+ void updateMarginProperties(); |
+ |
+protected: |
+ virtual bool recalculateColumnHeight(BalancedHeightCalculation) OVERRIDE; |
+ virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const OVERRIDE; |
+ virtual LayoutUnit pageLogicalHeight() const OVERRIDE; |
+ virtual const char* renderName() const OVERRIDE; |
+ |
+private: |
+ RenderMultiColumnSpannerSet(RenderMultiColumnFlowThread*, RenderBox*); |
+ |
+ RenderBox* m_rendererInFlowThread; // The actual column-span:all renderer inside the flow thread. |
+}; |
+ |
+DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMultiColumnSpannerSet, isRenderMultiColumnSpannerSet()); |
+ |
+} // namespace blink |
+ |
+#endif |