OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef RenderMultiColumnSpannerPlaceholder_h | 5 #ifndef RenderMultiColumnSpannerPlaceholder_h |
6 #define RenderMultiColumnSpannerPlaceholder_h | 6 #define RenderMultiColumnSpannerPlaceholder_h |
7 | 7 |
8 #include "core/rendering/RenderMultiColumnFlowThread.h" | 8 #include "core/rendering/RenderMultiColumnFlowThread.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 // Placeholder renderer for column-span:all elements. The column-span:all render
er itself is a | 12 // Placeholder renderer for column-span:all elements. The column-span:all render
er itself is a |
13 // descendant of the flow thread, but due to its out-of-flow nature, we need som
ething on the | 13 // descendant of the flow thread, but due to its out-of-flow nature, we need som
ething on the |
14 // outside to take care of its positioning and sizing. RenderMultiColumnSpannerP
laceholder objects | 14 // outside to take care of its positioning and sizing. RenderMultiColumnSpannerP
laceholder objects |
15 // are siblings of RenderMultiColumnSet objects, i.e. direct children of the mul
ticol container. | 15 // are siblings of RenderMultiColumnSet objects, i.e. direct children of the mul
ticol container. |
16 class RenderMultiColumnSpannerPlaceholder final : public RenderBox { | 16 class RenderMultiColumnSpannerPlaceholder final : public RenderBox { |
17 public: | 17 public: |
18 virtual bool isOfType(RenderObjectType type) const override { return type ==
RenderObjectRenderMultiColumnSpannerPlaceholder || RenderBox::isOfType(type); } | 18 virtual bool isOfType(RenderObjectType type) const override { return type ==
RenderObjectRenderMultiColumnSpannerPlaceholder || RenderBox::isOfType(type); } |
19 | 19 |
20 static RenderMultiColumnSpannerPlaceholder* createAnonymous(RenderStyle* par
entStyle, RenderBox*); | 20 static RenderMultiColumnSpannerPlaceholder* createAnonymous(RenderStyle* par
entStyle, RenderBox*); |
21 | 21 |
22 RenderFlowThread* flowThread() const { return toRenderBlockFlow(parent())->m
ultiColumnFlowThread(); } | 22 RenderFlowThread* flowThread() const { return toRenderBlockFlow(parent())->m
ultiColumnFlowThread(); } |
23 | 23 |
24 RenderBox* rendererInFlowThread() const { return m_rendererInFlowThread; } | 24 RenderBox* rendererInFlowThread() const { return m_rendererInFlowThread; } |
25 void setRendererInFlowThread(RenderBox* renderer) { m_rendererInFlowThread =
renderer; } | |
26 void spannerWillBeRemoved(); | |
27 void updateMarginProperties(); | 25 void updateMarginProperties(); |
28 | 26 |
29 protected: | 27 protected: |
30 virtual void willBeRemovedFromTree() override; | 28 virtual void willBeRemovedFromTree() override; |
31 virtual bool needsPreferredWidthsRecalculation() const override; | 29 virtual bool needsPreferredWidthsRecalculation() const override; |
32 virtual void layout() override; | 30 virtual void layout() override; |
33 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; | 31 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; |
34 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&) override; | 32 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&) override; |
35 virtual void paint(const PaintInfo&, const LayoutPoint& paintOffset) overrid
e; | 33 virtual void paint(const PaintInfo&, const LayoutPoint& paintOffset) overrid
e; |
36 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) override; | 34 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) override; |
37 virtual const char* renderName() const override; | 35 virtual const char* renderName() const override; |
38 | 36 |
39 private: | 37 private: |
40 RenderMultiColumnSpannerPlaceholder(RenderBox*); | 38 RenderMultiColumnSpannerPlaceholder(RenderBox*); |
41 | 39 |
42 RenderBox* m_rendererInFlowThread; // The actual column-span:all renderer in
side the flow thread. | 40 RenderBox* m_rendererInFlowThread; // The actual column-span:all renderer in
side the flow thread. |
43 }; | 41 }; |
44 | 42 |
45 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMultiColumnSpannerPlaceholder, isRenderMul
tiColumnSpannerPlaceholder()); | 43 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMultiColumnSpannerPlaceholder, isRenderMul
tiColumnSpannerPlaceholder()); |
46 | 44 |
47 } // namespace blink | 45 } // namespace blink |
48 | 46 |
49 #endif | 47 #endif |
OLD | NEW |