| 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 NGConstraintSpace_h | 5 #ifndef NGConstraintSpace_h |
| 6 #define NGConstraintSpace_h | 6 #define NGConstraintSpace_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/ng/ng_units.h" | 9 #include "core/layout/ng/ng_units.h" |
| 10 #include "core/layout/ng/ng_writing_mode.h" | 10 #include "core/layout/ng/ng_writing_mode.h" |
| 11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
| 12 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class LayoutBox; | 16 class LayoutBox; |
| 17 class NGFragment; | 17 class NGBoxFragment; |
| 18 class NGLayoutOpportunityIterator; | 18 class NGLayoutOpportunityIterator; |
| 19 | 19 |
| 20 // TODO(glebl@): unused, delete. | 20 // TODO(glebl@): unused, delete. |
| 21 enum NGExclusionType { | 21 enum NGExclusionType { |
| 22 kNGClearNone = 0, | 22 kNGClearNone = 0, |
| 23 kNGClearFloatLeft = 1, | 23 kNGClearFloatLeft = 1, |
| 24 kNGClearFloatRight = 2, | 24 kNGClearFloatRight = 2, |
| 25 kNGClearFragment = 4 | 25 kNGClearFragment = 4 |
| 26 }; | 26 }; |
| 27 | 27 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // (ie. fit-content). This is used for inline-block, floats, etc. | 100 // (ie. fit-content). This is used for inline-block, floats, etc. |
| 101 bool IsShrinkToFit() const { return is_shrink_to_fit_; } | 101 bool IsShrinkToFit() const { return is_shrink_to_fit_; } |
| 102 | 102 |
| 103 // If specified a layout should produce a Fragment which fragments at the | 103 // If specified a layout should produce a Fragment which fragments at the |
| 104 // blockSize if possible. | 104 // blockSize if possible. |
| 105 NGFragmentationType BlockFragmentationType() const; | 105 NGFragmentationType BlockFragmentationType() const; |
| 106 | 106 |
| 107 // Modifies constraint space to account for a placed fragment. Depending on | 107 // Modifies constraint space to account for a placed fragment. Depending on |
| 108 // the shape of the fragment this will either modify the inline or block | 108 // the shape of the fragment this will either modify the inline or block |
| 109 // size, or add an exclusion. | 109 // size, or add an exclusion. |
| 110 void Subtract(const NGFragment*); | 110 void Subtract(const NGBoxFragment*); |
| 111 | 111 |
| 112 NGLayoutOpportunityIterator* LayoutOpportunities( | 112 NGLayoutOpportunityIterator* LayoutOpportunities( |
| 113 unsigned clear = kNGClearNone, | 113 unsigned clear = kNGClearNone, |
| 114 bool for_inline_or_bfc = false); | 114 bool for_inline_or_bfc = false); |
| 115 | 115 |
| 116 DEFINE_INLINE_VIRTUAL_TRACE() {} | 116 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 117 | 117 |
| 118 String ToString() const; | 118 String ToString() const; |
| 119 | 119 |
| 120 private: | 120 private: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 inline std::ostream& operator<<(std::ostream& stream, | 160 inline std::ostream& operator<<(std::ostream& stream, |
| 161 const NGConstraintSpace& value) { | 161 const NGConstraintSpace& value) { |
| 162 return stream << value.ToString(); | 162 return stream << value.ToString(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace blink | 165 } // namespace blink |
| 166 | 166 |
| 167 #endif // NGConstraintSpace_h | 167 #endif // NGConstraintSpace_h |
| OLD | NEW |