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" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 // Return the block-direction space available in the current fragmentainer. | 60 // Return the block-direction space available in the current fragmentainer. |
61 LayoutUnit FragmentainerSpaceAvailable() const { | 61 LayoutUnit FragmentainerSpaceAvailable() const { |
62 DCHECK(HasBlockFragmentation()); | 62 DCHECK(HasBlockFragmentation()); |
63 return fragmentainer_space_available_; | 63 return fragmentainer_space_available_; |
64 } | 64 } |
65 | 65 |
66 // Whether the current constraint space is for the newly established | 66 // Whether the current constraint space is for the newly established |
67 // Formatting Context. | 67 // Formatting Context. |
68 bool IsNewFormattingContext() const { return is_new_fc_; } | 68 bool IsNewFormattingContext() const { return is_new_fc_; } |
69 | 69 |
70 // Whether the fragment produced from layout should be anonymous, (e.g. it | |
71 // may be a column in a multi-column layout). In such cases it shouldn't have | |
72 // any borders or padding. | |
73 bool IsAnonymous() const { return is_anonymous_; } | |
74 | |
70 // Whether exceeding the AvailableSize() triggers the presence of a scrollbar | 75 // Whether exceeding the AvailableSize() triggers the presence of a scrollbar |
71 // for the indicated direction. | 76 // for the indicated direction. |
72 // If exceeded the current layout should be aborted and invoked again with a | 77 // If exceeded the current layout should be aborted and invoked again with a |
73 // constraint space modified to reserve space for a scrollbar. | 78 // constraint space modified to reserve space for a scrollbar. |
74 bool IsInlineDirectionTriggersScrollbar() const { | 79 bool IsInlineDirectionTriggersScrollbar() const { |
75 return is_inline_direction_triggers_scrollbar_; | 80 return is_inline_direction_triggers_scrollbar_; |
76 } | 81 } |
77 | 82 |
78 bool IsBlockDirectionTriggersScrollbar() const { | 83 bool IsBlockDirectionTriggersScrollbar() const { |
79 return is_block_direction_triggers_scrollbar_; | 84 return is_block_direction_triggers_scrollbar_; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 NGLogicalSize percentage_resolution_size, | 130 NGLogicalSize percentage_resolution_size, |
126 NGPhysicalSize initial_containing_block_size, | 131 NGPhysicalSize initial_containing_block_size, |
127 LayoutUnit fragmentainer_space_available, | 132 LayoutUnit fragmentainer_space_available, |
128 bool is_fixed_size_inline, | 133 bool is_fixed_size_inline, |
129 bool is_fixed_size_block, | 134 bool is_fixed_size_block, |
130 bool is_shrink_to_fit, | 135 bool is_shrink_to_fit, |
131 bool is_inline_direction_triggers_scrollbar, | 136 bool is_inline_direction_triggers_scrollbar, |
132 bool is_block_direction_triggers_scrollbar, | 137 bool is_block_direction_triggers_scrollbar, |
133 NGFragmentationType block_direction_fragmentation_type, | 138 NGFragmentationType block_direction_fragmentation_type, |
134 bool is_new_fc, | 139 bool is_new_fc, |
140 bool is_anonymous, | |
135 const NGMarginStrut& margin_strut, | 141 const NGMarginStrut& margin_strut, |
136 const NGLogicalOffset& bfc_offset, | 142 const NGLogicalOffset& bfc_offset, |
137 const std::shared_ptr<NGExclusions>& exclusions); | 143 const std::shared_ptr<NGExclusions>& exclusions); |
138 | 144 |
139 NGPhysicalSize InitialContainingBlockSize() const { | 145 NGPhysicalSize InitialContainingBlockSize() const { |
140 return initial_containing_block_size_; | 146 return initial_containing_block_size_; |
141 } | 147 } |
142 | 148 |
143 NGLogicalSize available_size_; | 149 NGLogicalSize available_size_; |
144 NGLogicalSize percentage_resolution_size_; | 150 NGLogicalSize percentage_resolution_size_; |
145 NGPhysicalSize initial_containing_block_size_; | 151 NGPhysicalSize initial_containing_block_size_; |
146 | 152 |
147 LayoutUnit fragmentainer_space_available_; | 153 LayoutUnit fragmentainer_space_available_; |
148 | 154 |
149 unsigned is_fixed_size_inline_ : 1; | 155 unsigned is_fixed_size_inline_ : 1; |
150 unsigned is_fixed_size_block_ : 1; | 156 unsigned is_fixed_size_block_ : 1; |
151 | 157 |
152 unsigned is_shrink_to_fit_ : 1; | 158 unsigned is_shrink_to_fit_ : 1; |
153 | 159 |
154 unsigned is_inline_direction_triggers_scrollbar_ : 1; | 160 unsigned is_inline_direction_triggers_scrollbar_ : 1; |
155 unsigned is_block_direction_triggers_scrollbar_ : 1; | 161 unsigned is_block_direction_triggers_scrollbar_ : 1; |
156 | 162 |
157 unsigned block_direction_fragmentation_type_ : 2; | 163 unsigned block_direction_fragmentation_type_ : 2; |
158 | 164 |
159 // Whether the current constraint space is for the newly established | 165 // Whether the current constraint space is for the newly established |
160 // formatting Context | 166 // formatting Context |
161 unsigned is_new_fc_ : 1; | 167 unsigned is_new_fc_ : 1; |
168 unsigned is_anonymous_ : 1; | |
mstensho (USE GERRIT)
2017/02/27 13:44:36
Should probably add a blank line above this, since
ikilpatrick
2017/02/27 18:50:09
Done.
| |
162 | 169 |
163 unsigned writing_mode_ : 3; | 170 unsigned writing_mode_ : 3; |
164 unsigned direction_ : 1; | 171 unsigned direction_ : 1; |
165 | 172 |
166 NGMarginStrut margin_strut_; | 173 NGMarginStrut margin_strut_; |
167 NGLogicalOffset bfc_offset_; | 174 NGLogicalOffset bfc_offset_; |
168 const std::shared_ptr<NGExclusions> exclusions_; | 175 const std::shared_ptr<NGExclusions> exclusions_; |
169 }; | 176 }; |
170 | 177 |
171 inline std::ostream& operator<<(std::ostream& stream, | 178 inline std::ostream& operator<<(std::ostream& stream, |
172 const NGConstraintSpace& value) { | 179 const NGConstraintSpace& value) { |
173 return stream << value.ToString(); | 180 return stream << value.ToString(); |
174 } | 181 } |
175 | 182 |
176 } // namespace blink | 183 } // namespace blink |
177 | 184 |
178 #endif // NGConstraintSpace_h | 185 #endif // NGConstraintSpace_h |
OLD | NEW |