OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 NGFloatingObject_h | 5 #ifndef NGFloatingObject_h |
6 #define NGFloatingObject_h | 6 #define NGFloatingObject_h |
7 | 7 |
8 #include "core/layout/ng/geometry/ng_box_strut.h" | 8 #include "core/layout/ng/geometry/ng_box_strut.h" |
9 #include "core/layout/ng/ng_block_node.h" | 9 #include "core/layout/ng/ng_block_node.h" |
10 #include "core/layout/ng/ng_constraint_space.h" | 10 #include "core/layout/ng/ng_constraint_space.h" |
11 #include "core/layout/ng/ng_exclusion.h" | 11 #include "core/layout/ng/ng_exclusion.h" |
12 #include "core/style/ComputedStyle.h" | 12 #include "core/style/ComputedStyle.h" |
13 #include "core/style/ComputedStyleConstants.h" | 13 #include "core/style/ComputedStyleConstants.h" |
14 #include "platform/heap/Handle.h" | 14 #include "wtf/RefPtr.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 class NGPhysicalFragment; | 18 class NGPhysicalFragment; |
19 | 19 |
20 // Struct that keeps all information needed to position floats in LayoutNG. | 20 // Struct that keeps all information needed to position floats in LayoutNG. |
21 struct CORE_EXPORT NGFloatingObject | 21 struct CORE_EXPORT NGFloatingObject : public RefCounted<NGFloatingObject> { |
22 : public GarbageCollectedFinalized<NGFloatingObject> { | |
23 NGFloatingObject(const NGConstraintSpace* space, | 22 NGFloatingObject(const NGConstraintSpace* space, |
24 const NGConstraintSpace* parent_space, | 23 const NGConstraintSpace* parent_space, |
25 const ComputedStyle& style, | 24 const ComputedStyle& style, |
26 const NGBoxStrut& margins, | 25 const NGBoxStrut& margins, |
27 NGPhysicalFragment* fragment) | 26 NGPhysicalFragment* fragment) |
28 : space(space), | 27 : space(space), |
29 original_parent_space(parent_space), | 28 original_parent_space(parent_space), |
30 margins(margins), | 29 margins(margins), |
31 fragment(fragment) { | 30 fragment(fragment) { |
32 exclusion_type = NGExclusion::kFloatLeft; | 31 exclusion_type = NGExclusion::kFloatLeft; |
(...skipping 16 matching lines...) Expand all Loading... |
49 RefPtr<NGPhysicalFragment> fragment; | 48 RefPtr<NGPhysicalFragment> fragment; |
50 | 49 |
51 // In the case where a legacy FloatingObject is attached to not its own | 50 // In the case where a legacy FloatingObject is attached to not its own |
52 // parent, e.g. a float surrounded by a bunch of nested empty divs, | 51 // parent, e.g. a float surrounded by a bunch of nested empty divs, |
53 // NG float fragment's LeftOffset() cannot be used as legacy FloatingObject's | 52 // NG float fragment's LeftOffset() cannot be used as legacy FloatingObject's |
54 // left offset because that offset should be relative to the original float | 53 // left offset because that offset should be relative to the original float |
55 // parent. | 54 // parent. |
56 // {@code left_offset} is calculated when we know to which parent this float | 55 // {@code left_offset} is calculated when we know to which parent this float |
57 // would be attached. | 56 // would be attached. |
58 LayoutUnit left_offset; | 57 LayoutUnit left_offset; |
59 | |
60 DEFINE_INLINE_TRACE() { | |
61 } | |
62 }; | 58 }; |
63 | 59 |
64 } // namespace blink | 60 } // namespace blink |
65 | 61 |
66 #endif // NGFloatingObject_h | 62 #endif // NGFloatingObject_h |
OLD | NEW |