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

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

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
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..e3dda8837aaf1c837d0917ec88185e067c297f30
--- /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 isOfType(RenderObjectType type) const override { return type == RenderObjectRenderMultiColumnSpannerSet || RenderMultiColumnSet::isOfType(type); }
+
+ 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
« no previous file with comments | « Source/core/rendering/RenderMultiColumnSet.cpp ('k') | Source/core/rendering/RenderMultiColumnSpannerSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698