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