| 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_macros.h" |
| 9 #include "core/layout/ng/ng_physical_constraint_space.h" | 10 #include "core/layout/ng/ng_physical_constraint_space.h" |
| 10 #include "core/layout/ng/ng_writing_mode.h" | 11 #include "core/layout/ng/ng_writing_mode.h" |
| 11 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
| 12 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
| 13 #include "wtf/Vector.h" | 14 #include "wtf/Vector.h" |
| 14 | 15 |
| 15 namespace blink { | 16 namespace blink { |
| 16 | 17 |
| 17 class LayoutBox; | 18 class LayoutBox; |
| 18 class NGFragment; | 19 class NGFragment; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 39 // TODO(layout-dev): remove const constraint from MutablePhysicalSpace method | 40 // TODO(layout-dev): remove const constraint from MutablePhysicalSpace method |
| 40 NGPhysicalConstraintSpace* MutablePhysicalSpace() const { | 41 NGPhysicalConstraintSpace* MutablePhysicalSpace() const { |
| 41 return physical_space_; | 42 return physical_space_; |
| 42 } | 43 } |
| 43 | 44 |
| 44 // Read-only Getters. | 45 // Read-only Getters. |
| 45 const NGPhysicalConstraintSpace* PhysicalSpace() const { | 46 const NGPhysicalConstraintSpace* PhysicalSpace() const { |
| 46 return physical_space_; | 47 return physical_space_; |
| 47 } | 48 } |
| 48 | 49 |
| 50 const Vector<std::unique_ptr<const NGLogicalRect>>& Exclusions() const { |
| 51 WRITING_MODE_IGNORED( |
| 52 "Exclusions are stored directly in physical constraint space."); |
| 53 return PhysicalSpace()->Exclusions(); |
| 54 } |
| 55 |
| 49 NGDirection Direction() const { return static_cast<NGDirection>(direction_); } | 56 NGDirection Direction() const { return static_cast<NGDirection>(direction_); } |
| 50 | 57 |
| 51 NGWritingMode WritingMode() const { | 58 NGWritingMode WritingMode() const { |
| 52 return static_cast<NGWritingMode>(writing_mode_); | 59 return static_cast<NGWritingMode>(writing_mode_); |
| 53 } | 60 } |
| 54 | 61 |
| 55 // Adds the exclusion in the physical constraint space. | 62 // Adds the exclusion in the physical constraint space. |
| 56 // Passing the exclusion ignoring the writing mode is fine here since the | 63 // Passing the exclusion ignoring the writing mode is fine here since the |
| 57 // exclusion is set in physical coordinates. | 64 // exclusion is set in physical coordinates. |
| 58 void AddExclusion(const NGExclusion* exclusion) const; | 65 void AddExclusion(const NGLogicalRect& exclusion) const; |
| 59 | 66 |
| 60 // Size of the container. Used for the following three cases: | 67 // Size of the container. Used for the following three cases: |
| 61 // 1) Percentage resolution. | 68 // 1) Percentage resolution. |
| 62 // 2) Resolving absolute positions of children. | 69 // 2) Resolving absolute positions of children. |
| 63 // 3) Defining the threshold that triggers the presence of a scrollbar. Only | 70 // 3) Defining the threshold that triggers the presence of a scrollbar. Only |
| 64 // applies if the corresponding scrollbarTrigger flag has been set for the | 71 // applies if the corresponding scrollbarTrigger flag has been set for the |
| 65 // direction. | 72 // direction. |
| 66 NGLogicalSize ContainerSize() const; | 73 NGLogicalSize ContainerSize() const; |
| 67 | 74 |
| 68 // Offset relative to the root constraint space. | 75 // Offset relative to the root constraint space. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 }; | 134 }; |
| 128 | 135 |
| 129 inline std::ostream& operator<<(std::ostream& stream, | 136 inline std::ostream& operator<<(std::ostream& stream, |
| 130 const NGConstraintSpace& value) { | 137 const NGConstraintSpace& value) { |
| 131 return stream << value.ToString(); | 138 return stream << value.ToString(); |
| 132 } | 139 } |
| 133 | 140 |
| 134 } // namespace blink | 141 } // namespace blink |
| 135 | 142 |
| 136 #endif // NGConstraintSpace_h | 143 #endif // NGConstraintSpace_h |
| OLD | NEW |