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/ng_block_node.h" | 8 #include "core/layout/ng/ng_block_node.h" |
9 #include "core/layout/ng/ng_constraint_space.h" | 9 #include "core/layout/ng/ng_constraint_space.h" |
10 #include "core/layout/ng/ng_units.h" | 10 #include "core/layout/ng/ng_units.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 node(node), | 31 node(node), |
32 margins(margins) { | 32 margins(margins) { |
33 exclusion_type = NGExclusion::kFloatLeft; | 33 exclusion_type = NGExclusion::kFloatLeft; |
34 if (style.floating() == EFloat::kRight) | 34 if (style.floating() == EFloat::kRight) |
35 exclusion_type = NGExclusion::kFloatRight; | 35 exclusion_type = NGExclusion::kFloatRight; |
36 clear_type = style.clear(); | 36 clear_type = style.clear(); |
37 } | 37 } |
38 | 38 |
39 RefPtr<NGPhysicalFragment> fragment; | 39 RefPtr<NGPhysicalFragment> fragment; |
40 // TODO(glebl): Constraint space should be const here. | 40 // TODO(glebl): Constraint space should be const here. |
41 Member<NGConstraintSpace> space; | 41 RefPtr<NGConstraintSpace> space; |
42 | 42 |
43 // Parent space is used so we can calculate the inline offset relative to | 43 // Parent space is used so we can calculate the inline offset relative to |
44 // the original parent of this float. | 44 // the original parent of this float. |
45 Member<const NGConstraintSpace> original_parent_space; | 45 RefPtr<const NGConstraintSpace> original_parent_space; |
46 Member<NGBlockNode> node; | 46 Member<NGBlockNode> node; |
47 NGExclusion::Type exclusion_type; | 47 NGExclusion::Type exclusion_type; |
48 EClear clear_type; | 48 EClear clear_type; |
49 NGBoxStrut margins; | 49 NGBoxStrut margins; |
50 | 50 |
51 // In the case where a legacy FloatingObject is attached to not its own | 51 // 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, | 52 // 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 | 53 // 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 | 54 // left offset because that offset should be relative to the original float |
55 // parent. | 55 // parent. |
56 // {@code left_offset} is calculated when we know to which parent this float | 56 // {@code left_offset} is calculated when we know to which parent this float |
57 // would be attached. | 57 // would be attached. |
58 LayoutUnit left_offset; | 58 LayoutUnit left_offset; |
59 | 59 |
60 DEFINE_INLINE_TRACE() { | 60 DEFINE_INLINE_TRACE() { |
61 visitor->trace(space); | |
62 visitor->trace(original_parent_space); | |
63 visitor->trace(node); | 61 visitor->trace(node); |
64 } | 62 } |
65 }; | 63 }; |
66 | 64 |
67 } // namespace blink | 65 } // namespace blink |
68 | 66 |
69 #endif // NGFloatingObject_h | 67 #endif // NGFloatingObject_h |
OLD | NEW |