| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 NGLogicalSize percentage_resolution_size, | 134 NGLogicalSize percentage_resolution_size, |
| 130 NGPhysicalSize initial_containing_block_size, | 135 NGPhysicalSize initial_containing_block_size, |
| 131 LayoutUnit fragmentainer_space_available, | 136 LayoutUnit fragmentainer_space_available, |
| 132 bool is_fixed_size_inline, | 137 bool is_fixed_size_inline, |
| 133 bool is_fixed_size_block, | 138 bool is_fixed_size_block, |
| 134 bool is_shrink_to_fit, | 139 bool is_shrink_to_fit, |
| 135 bool is_inline_direction_triggers_scrollbar, | 140 bool is_inline_direction_triggers_scrollbar, |
| 136 bool is_block_direction_triggers_scrollbar, | 141 bool is_block_direction_triggers_scrollbar, |
| 137 NGFragmentationType block_direction_fragmentation_type, | 142 NGFragmentationType block_direction_fragmentation_type, |
| 138 bool is_new_fc, | 143 bool is_new_fc, |
| 144 bool is_anonymous, |
| 139 const NGMarginStrut& margin_strut, | 145 const NGMarginStrut& margin_strut, |
| 140 const NGLogicalOffset& bfc_offset, | 146 const NGLogicalOffset& bfc_offset, |
| 141 const std::shared_ptr<NGExclusions>& exclusions, | 147 const std::shared_ptr<NGExclusions>& exclusions, |
| 142 const WTF::Optional<LayoutUnit>& clearance_offset); | 148 const WTF::Optional<LayoutUnit>& clearance_offset); |
| 143 | 149 |
| 144 NGPhysicalSize InitialContainingBlockSize() const { | 150 NGPhysicalSize InitialContainingBlockSize() const { |
| 145 return initial_containing_block_size_; | 151 return initial_containing_block_size_; |
| 146 } | 152 } |
| 147 | 153 |
| 148 NGLogicalSize available_size_; | 154 NGLogicalSize available_size_; |
| 149 NGLogicalSize percentage_resolution_size_; | 155 NGLogicalSize percentage_resolution_size_; |
| 150 NGPhysicalSize initial_containing_block_size_; | 156 NGPhysicalSize initial_containing_block_size_; |
| 151 | 157 |
| 152 LayoutUnit fragmentainer_space_available_; | 158 LayoutUnit fragmentainer_space_available_; |
| 153 | 159 |
| 154 unsigned is_fixed_size_inline_ : 1; | 160 unsigned is_fixed_size_inline_ : 1; |
| 155 unsigned is_fixed_size_block_ : 1; | 161 unsigned is_fixed_size_block_ : 1; |
| 156 | 162 |
| 157 unsigned is_shrink_to_fit_ : 1; | 163 unsigned is_shrink_to_fit_ : 1; |
| 158 | 164 |
| 159 unsigned is_inline_direction_triggers_scrollbar_ : 1; | 165 unsigned is_inline_direction_triggers_scrollbar_ : 1; |
| 160 unsigned is_block_direction_triggers_scrollbar_ : 1; | 166 unsigned is_block_direction_triggers_scrollbar_ : 1; |
| 161 | 167 |
| 162 unsigned block_direction_fragmentation_type_ : 2; | 168 unsigned block_direction_fragmentation_type_ : 2; |
| 163 | 169 |
| 164 // Whether the current constraint space is for the newly established | 170 // Whether the current constraint space is for the newly established |
| 165 // formatting Context | 171 // formatting Context |
| 166 unsigned is_new_fc_ : 1; | 172 unsigned is_new_fc_ : 1; |
| 167 | 173 |
| 174 unsigned is_anonymous_ : 1; |
| 175 |
| 168 unsigned writing_mode_ : 3; | 176 unsigned writing_mode_ : 3; |
| 169 unsigned direction_ : 1; | 177 unsigned direction_ : 1; |
| 170 | 178 |
| 171 NGMarginStrut margin_strut_; | 179 NGMarginStrut margin_strut_; |
| 172 NGLogicalOffset bfc_offset_; | 180 NGLogicalOffset bfc_offset_; |
| 173 const std::shared_ptr<NGExclusions> exclusions_; | 181 const std::shared_ptr<NGExclusions> exclusions_; |
| 174 WTF::Optional<LayoutUnit> clearance_offset_; | 182 WTF::Optional<LayoutUnit> clearance_offset_; |
| 175 }; | 183 }; |
| 176 | 184 |
| 177 inline std::ostream& operator<<(std::ostream& stream, | 185 inline std::ostream& operator<<(std::ostream& stream, |
| 178 const NGConstraintSpace& value) { | 186 const NGConstraintSpace& value) { |
| 179 return stream << value.ToString(); | 187 return stream << value.ToString(); |
| 180 } | 188 } |
| 181 | 189 |
| 182 } // namespace blink | 190 } // namespace blink |
| 183 | 191 |
| 184 #endif // NGConstraintSpace_h | 192 #endif // NGConstraintSpace_h |
| OLD | NEW |