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 NGExclusion_h |
| 6 #define NGExclusion_h |
| 7 |
| 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/ng/geometry/ng_logical_rect.h" |
| 10 #include "wtf/Vector.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 // Struct that represents NG exclusion. |
| 15 struct CORE_EXPORT NGExclusion { |
| 16 // Type of NG exclusion. |
| 17 enum Type { |
| 18 // Undefined exclusion type. |
| 19 // At this moment it's also used to represent CSS3 exclusion. |
| 20 kExclusionTypeUndefined = 0, |
| 21 // Exclusion that is created by LEFT float. |
| 22 kFloatLeft = 1, |
| 23 // Exclusion that is created by RIGHT float. |
| 24 kFloatRight = 2 |
| 25 }; |
| 26 |
| 27 // Rectangle in logical coordinates the represents this exclusion. |
| 28 NGLogicalRect rect; |
| 29 |
| 30 // Type of this exclusion. |
| 31 Type type; |
| 32 |
| 33 bool operator==(const NGExclusion& other) const; |
| 34 String ToString() const; |
| 35 }; |
| 36 |
| 37 CORE_EXPORT std::ostream& operator<<(std::ostream&, const NGExclusion&); |
| 38 |
| 39 struct CORE_EXPORT NGExclusions { |
| 40 NGExclusions(); |
| 41 NGExclusions(const NGExclusions& other); |
| 42 |
| 43 Vector<std::unique_ptr<const NGExclusion>> storage; |
| 44 |
| 45 // Last left/right float exclusions are used to enforce the top edge alignment |
| 46 // rule for floats and for the support of CSS "clear" property. |
| 47 const NGExclusion* last_left_float; // Owned by storage. |
| 48 const NGExclusion* last_right_float; // Owned by storage. |
| 49 |
| 50 NGExclusions& operator=(const NGExclusions& other); |
| 51 |
| 52 void Add(const NGExclusion& exclusion); |
| 53 }; |
| 54 |
| 55 } // namespace blink |
| 56 |
| 57 #endif // NGExclusion_h |
OLD | NEW |