| 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 NGUnpositionedFloat_h | 5 #ifndef NGUnpositionedFloat_h |
| 6 #define NGUnpositionedFloat_h | 6 #define NGUnpositionedFloat_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/geometry/ng_logical_size.h" | 9 #include "core/layout/ng/geometry/ng_logical_size.h" |
| 10 #include "core/layout/ng/ng_block_break_token.h" | 10 #include "core/layout/ng/ng_block_break_token.h" |
| 11 #include "core/layout/ng/ng_block_node.h" | 11 #include "core/layout/ng/ng_block_node.h" |
| 12 #include "core/layout/ng/ng_exclusion.h" | 12 #include "core/layout/ng/ng_exclusion.h" |
| 13 #include "core/style/ComputedStyleConstants.h" |
| 13 #include "platform/wtf/Optional.h" | 14 #include "platform/wtf/Optional.h" |
| 14 #include "platform/wtf/RefPtr.h" | 15 #include "platform/wtf/RefPtr.h" |
| 15 | 16 |
| 16 namespace blink { | 17 namespace blink { |
| 17 | 18 |
| 18 class NGPhysicalBoxFragment; | 19 class NGPhysicalBoxFragment; |
| 19 | 20 |
| 20 // Struct that keeps all information needed to position floats in LayoutNG. | 21 // Struct that keeps all information needed to position floats in LayoutNG. |
| 21 struct CORE_EXPORT NGUnpositionedFloat | 22 struct CORE_EXPORT NGUnpositionedFloat |
| 22 : public RefCounted<NGUnpositionedFloat> { | 23 : public RefCounted<NGUnpositionedFloat> { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // context. They are stored for convinence and could be recomputed with other | 83 // context. They are stored for convinence and could be recomputed with other |
| 83 // data on this object. | 84 // data on this object. |
| 84 NGBoxStrut margins; | 85 NGBoxStrut margins; |
| 85 | 86 |
| 86 // The fragment for this unpositioned float. This is only present if it's in | 87 // The fragment for this unpositioned float. This is only present if it's in |
| 87 // a different writing mode than the BFC. | 88 // a different writing mode than the BFC. |
| 88 WTF::Optional<RefPtr<NGPhysicalBoxFragment>> fragment; | 89 WTF::Optional<RefPtr<NGPhysicalBoxFragment>> fragment; |
| 89 | 90 |
| 90 bool IsLeft() const; | 91 bool IsLeft() const; |
| 91 bool IsRight() const; | 92 bool IsRight() const; |
| 93 EClear ClearType() const; |
| 92 | 94 |
| 93 private: | 95 private: |
| 94 NGUnpositionedFloat(const NGBoxStrut& margins, | 96 NGUnpositionedFloat(const NGBoxStrut& margins, |
| 95 const NGLogicalSize& available_size, | 97 const NGLogicalSize& available_size, |
| 96 const NGLogicalSize& percentage_size, | 98 const NGLogicalSize& percentage_size, |
| 97 const NGLogicalOffset& origin_offset, | 99 const NGLogicalOffset& origin_offset, |
| 98 const NGLogicalOffset& from_offset, | 100 const NGLogicalOffset& from_offset, |
| 99 NGBlockNode* node, | 101 NGBlockNode* node, |
| 100 NGBlockBreakToken* token) | 102 NGBlockBreakToken* token) |
| 101 : node(node), | 103 : node(node), |
| 102 token(token), | 104 token(token), |
| 103 available_size(available_size), | 105 available_size(available_size), |
| 104 percentage_size(percentage_size), | 106 percentage_size(percentage_size), |
| 105 origin_offset(origin_offset), | 107 origin_offset(origin_offset), |
| 106 from_offset(from_offset), | 108 from_offset(from_offset), |
| 107 margins(margins) {} | 109 margins(margins) {} |
| 108 }; | 110 }; |
| 109 | 111 |
| 110 } // namespace blink | 112 } // namespace blink |
| 111 | 113 |
| 112 #endif // NGUnpositionedFloat_h | 114 #endif // NGUnpositionedFloat_h |
| OLD | NEW |