Chromium Code Reviews

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

Issue 296413007: [New Multicolumn] Add support for column-span:all (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@359976
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: Source/core/rendering/RenderMultiColumnSpannerPlaceholder.h
diff --git a/Source/core/rendering/RenderMultiColumnSpannerPlaceholder.h b/Source/core/rendering/RenderMultiColumnSpannerPlaceholder.h
new file mode 100644
index 0000000000000000000000000000000000000000..317711c417de7befc467add57bcc8261ba967538
--- /dev/null
+++ b/Source/core/rendering/RenderMultiColumnSpannerPlaceholder.h
@@ -0,0 +1,42 @@
+// 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 RenderMultiColumnSpannerPlaceholder_h
+#define RenderMultiColumnSpannerPlaceholder_h
+
+#include "core/rendering/RenderBox.h"
+
+namespace WebCore {
+
+class RenderMultiColumnFlowThread;
+
+// An empty placeholder box inserted at the position in the render tree where the column-span:all
+// rendererer would naturally occur, had it not been column-span:all. A spanner box is moved from
+// its original position to become a sibling of the column sets. In other words it becomes a direct
+// child of the multicol container, since anything logically in the ancestry between the spanner and
+// the multicol container shouldn't affect the spanner (e.g. such ancestors should not affect the
+// size of the spanner, nor should their background be painted). The placeholder is used during flow
+// thread layout to figure out when to move from one column set to the next.
+class RenderMultiColumnSpannerPlaceholder FINAL : public RenderBox {
+public:
+ static RenderMultiColumnSpannerPlaceholder* createAnonymous(RenderMultiColumnFlowThread*, RenderBox* spanner, RenderStyle*);
+
+ virtual bool isRenderMultiColumnSpannerPlaceholder() const OVERRIDE { return true; }
+
+ // Get the actual spanner renderer; a sibling of the column sets.
+ RenderBox* spanner() const { return m_spanner; }
+
+private:
+ RenderMultiColumnSpannerPlaceholder(RenderMultiColumnFlowThread*, RenderBox* spanner);
+
+ virtual const char* renderName() const OVERRIDE;
+
+ RenderBox* m_spanner;
+};
+
+DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMultiColumnSpannerPlaceholder, isRenderMultiColumnSpannerPlaceholder());
+
+} // namespace WebCore
+
+#endif // RenderMultiColumnSpannerPlaceholder_h

Powered by Google App Engine