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 LayoutMultiColumnSpannerPlaceholder_h | 5 #ifndef LayoutMultiColumnSpannerPlaceholder_h |
6 #define LayoutMultiColumnSpannerPlaceholder_h | 6 #define LayoutMultiColumnSpannerPlaceholder_h |
7 | 7 |
8 #include "core/layout/LayoutBlockFlow.h" | 8 #include "core/layout/LayoutBlockFlow.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 // Placeholder layoutObject for column-span:all elements. The column-span:all la
youtObject itself is a | 12 // Placeholder layoutObject for column-span:all elements. The column-span:all |
13 // descendant of the flow thread, but due to its out-of-flow nature, we need som
ething on the | 13 // layoutObject itself is a descendant of the flow thread, but due to its |
14 // outside to take care of its positioning and sizing. LayoutMultiColumnSpannerP
laceholder objects | 14 // out-of-flow nature, we need something on the outside to take care of its |
15 // are siblings of LayoutMultiColumnSet objects, i.e. direct children of the mul
ticol container. | 15 // positioning and sizing. LayoutMultiColumnSpannerPlaceholder objects are |
| 16 // siblings of LayoutMultiColumnSet objects, i.e. direct children of the |
| 17 // multicol container. |
16 class LayoutMultiColumnSpannerPlaceholder final : public LayoutBox { | 18 class LayoutMultiColumnSpannerPlaceholder final : public LayoutBox { |
17 public: | 19 public: |
18 bool isOfType(LayoutObjectType type) const override { | 20 bool isOfType(LayoutObjectType type) const override { |
19 return type == LayoutObjectLayoutMultiColumnSpannerPlaceholder || | 21 return type == LayoutObjectLayoutMultiColumnSpannerPlaceholder || |
20 LayoutBox::isOfType(type); | 22 LayoutBox::isOfType(type); |
21 } | 23 } |
22 | 24 |
23 static LayoutMultiColumnSpannerPlaceholder* createAnonymous( | 25 static LayoutMultiColumnSpannerPlaceholder* createAnonymous( |
24 const ComputedStyle& parentStyle, | 26 const ComputedStyle& parentStyle, |
25 LayoutBox&); | 27 LayoutBox&); |
26 | 28 |
27 LayoutMultiColumnFlowThread* flowThread() const { | 29 LayoutMultiColumnFlowThread* flowThread() const { |
28 return toLayoutBlockFlow(parent())->multiColumnFlowThread(); | 30 return toLayoutBlockFlow(parent())->multiColumnFlowThread(); |
29 } | 31 } |
30 | 32 |
31 LayoutBox* layoutObjectInFlowThread() const { | 33 LayoutBox* layoutObjectInFlowThread() const { |
32 return m_layoutObjectInFlowThread; | 34 return m_layoutObjectInFlowThread; |
33 } | 35 } |
34 void markForLayoutIfObjectInFlowThreadNeedsLayout() { | 36 void markForLayoutIfObjectInFlowThreadNeedsLayout() { |
35 if (!m_layoutObjectInFlowThread->needsLayout()) | 37 if (!m_layoutObjectInFlowThread->needsLayout()) |
36 return; | 38 return; |
37 // The containing block of a spanner is the multicol container (our parent h
ere), but the | 39 // The containing block of a spanner is the multicol container (our parent |
38 // spanner is laid out via its spanner set (us), so we need to make sure tha
t we enter it. | 40 // here), but the spanner is laid out via its spanner set (us), so we need |
| 41 // to make sure that we enter it. |
39 setChildNeedsLayout(MarkOnlyThis); | 42 setChildNeedsLayout(MarkOnlyThis); |
40 } | 43 } |
41 | 44 |
42 void layoutObjectInFlowThreadStyleDidChange(const ComputedStyle* oldStyle); | 45 void layoutObjectInFlowThreadStyleDidChange(const ComputedStyle* oldStyle); |
43 void updateMarginProperties(); | 46 void updateMarginProperties(); |
44 | 47 |
45 const char* name() const override { | 48 const char* name() const override { |
46 return "LayoutMultiColumnSpannerPlaceholder"; | 49 return "LayoutMultiColumnSpannerPlaceholder"; |
47 } | 50 } |
48 | 51 |
(...skipping 11 matching lines...) Expand all Loading... |
60 const PaintInvalidationState&) override; | 63 const PaintInvalidationState&) override; |
61 void paint(const PaintInfo&, const LayoutPoint& paintOffset) const override; | 64 void paint(const PaintInfo&, const LayoutPoint& paintOffset) const override; |
62 bool nodeAtPoint(HitTestResult&, | 65 bool nodeAtPoint(HitTestResult&, |
63 const HitTestLocation& locationInContainer, | 66 const HitTestLocation& locationInContainer, |
64 const LayoutPoint& accumulatedOffset, | 67 const LayoutPoint& accumulatedOffset, |
65 HitTestAction) override; | 68 HitTestAction) override; |
66 | 69 |
67 private: | 70 private: |
68 LayoutMultiColumnSpannerPlaceholder(LayoutBox*); | 71 LayoutMultiColumnSpannerPlaceholder(LayoutBox*); |
69 | 72 |
70 LayoutBox* | 73 // The actual column-span:all layoutObject inside the flow thread. |
71 m_layoutObjectInFlowThread; // The actual column-span:all layoutObject in
side the flow thread. | 74 LayoutBox* m_layoutObjectInFlowThread; |
72 }; | 75 }; |
73 | 76 |
74 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutMultiColumnSpannerPlaceholder, | 77 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutMultiColumnSpannerPlaceholder, |
75 isLayoutMultiColumnSpannerPlaceholder()); | 78 isLayoutMultiColumnSpannerPlaceholder()); |
76 | 79 |
77 } // namespace blink | 80 } // namespace blink |
78 | 81 |
79 #endif | 82 #endif |
OLD | NEW |