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 30 matching lines...) Expand all Loading... | |
49 // TODO(layout-dev): remove const constraint from MutablePhysicalSpace method | 50 // TODO(layout-dev): remove const constraint from MutablePhysicalSpace method |
50 NGPhysicalConstraintSpace* MutablePhysicalSpace() const { | 51 NGPhysicalConstraintSpace* MutablePhysicalSpace() const { |
51 return physical_space_; | 52 return physical_space_; |
52 } | 53 } |
53 | 54 |
54 // Read-only Getters. | 55 // Read-only Getters. |
55 const NGPhysicalConstraintSpace* PhysicalSpace() const { | 56 const NGPhysicalConstraintSpace* PhysicalSpace() const { |
56 return physical_space_; | 57 return physical_space_; |
57 } | 58 } |
58 | 59 |
60 const Vector<std::unique_ptr<const NGLogicalRect>>& Exclusions() const { | |
61 WRITING_MODE_IGNORED( | |
62 "Exclusions are stored directly in physical constraint" | |
63 "space."); | |
ikilpatrick
2016/10/28 23:18:24
can fit on previous line?
Gleb Lanbin
2016/10/28 23:54:09
Done.
| |
64 return PhysicalSpace()->Exclusions(); | |
65 } | |
66 | |
59 NGDirection Direction() const { return static_cast<NGDirection>(direction_); } | 67 NGDirection Direction() const { return static_cast<NGDirection>(direction_); } |
60 | 68 |
61 NGWritingMode WritingMode() const { | 69 NGWritingMode WritingMode() const { |
62 return static_cast<NGWritingMode>(writing_mode_); | 70 return static_cast<NGWritingMode>(writing_mode_); |
63 } | 71 } |
64 | 72 |
65 // Adds the exclusion in the physical constraint space. | 73 // Adds the exclusion in the physical constraint space. |
66 // Passing the exclusion ignoring the writing mode is fine here since the | 74 // Passing the exclusion ignoring the writing mode is fine here since the |
67 // exclusion is set in physical coordinates. | 75 // exclusion is set in physical coordinates. |
68 void AddExclusion(const NGExclusion* exclusion) const; | 76 void AddExclusion(const NGLogicalRect& exclusion) const; |
69 | 77 |
70 // Size of the container. Used for the following three cases: | 78 // Size of the container. Used for the following three cases: |
71 // 1) Percentage resolution. | 79 // 1) Percentage resolution. |
72 // 2) Resolving absolute positions of children. | 80 // 2) Resolving absolute positions of children. |
73 // 3) Defining the threshold that triggers the presence of a scrollbar. Only | 81 // 3) Defining the threshold that triggers the presence of a scrollbar. Only |
74 // applies if the corresponding scrollbarTrigger flag has been set for the | 82 // applies if the corresponding scrollbarTrigger flag has been set for the |
75 // direction. | 83 // direction. |
76 NGLogicalSize ContainerSize() const; | 84 NGLogicalSize ContainerSize() const; |
77 | 85 |
78 // Offset relative to the root constraint space. | 86 // Offset relative to the root constraint space. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 }; | 142 }; |
135 | 143 |
136 inline std::ostream& operator<<(std::ostream& stream, | 144 inline std::ostream& operator<<(std::ostream& stream, |
137 const NGConstraintSpace& value) { | 145 const NGConstraintSpace& value) { |
138 return stream << value.ToString(); | 146 return stream << value.ToString(); |
139 } | 147 } |
140 | 148 |
141 } // namespace blink | 149 } // namespace blink |
142 | 150 |
143 #endif // NGConstraintSpace_h | 151 #endif // NGConstraintSpace_h |
OLD | NEW |