OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NGFloatingObject_h |
| 6 #define NGFloatingObject_h |
| 7 |
| 8 #include "core/layout/ng/ng_block_node.h" |
| 9 #include "core/layout/ng/ng_constraint_space.h" |
| 10 #include "core/layout/ng/ng_units.h" |
| 11 #include "core/style/ComputedStyle.h" |
| 12 #include "core/style/ComputedStyleConstants.h" |
| 13 #include "platform/heap/Handle.h" |
| 14 |
| 15 namespace blink { |
| 16 |
| 17 class NGPhysicalFragment; |
| 18 |
| 19 // Struct that keeps all information needed to position floats in LayoutNG. |
| 20 struct CORE_EXPORT NGFloatingObject |
| 21 : public GarbageCollected<NGFloatingObject> { |
| 22 NGFloatingObject(NGPhysicalFragment* fragment, |
| 23 const NGConstraintSpace* space, |
| 24 NGBlockNode* node, |
| 25 const ComputedStyle& style, |
| 26 const NGBoxStrut& margins) |
| 27 : fragment(fragment), space(space), node(node), margins(margins) { |
| 28 exclusion_type = NGExclusion::kFloatLeft; |
| 29 if (style.floating() == EFloat::kRight) |
| 30 exclusion_type = NGExclusion::kFloatRight; |
| 31 clear_type = style.clear(); |
| 32 } |
| 33 |
| 34 Member<NGPhysicalFragment> fragment; |
| 35 Member<const NGConstraintSpace> space; |
| 36 Member<NGBlockNode> node; |
| 37 NGExclusion::Type exclusion_type; |
| 38 EClear clear_type; |
| 39 NGBoxStrut margins; |
| 40 |
| 41 DEFINE_INLINE_TRACE() { |
| 42 visitor->trace(fragment); |
| 43 visitor->trace(space); |
| 44 visitor->trace(node); |
| 45 } |
| 46 }; |
| 47 |
| 48 } // namespace blink |
| 49 |
| 50 #endif // NGFloatingObject_h |
OLD | NEW |