| 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 #include "core/layout/ng/ng_constraint_space.h" | 5 #include "core/layout/ng/ng_constraint_space.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutBlock.h" | 7 #include "core/layout/LayoutBlock.h" |
| 8 #include "core/layout/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
| 9 #include "core/layout/ng/ng_constraint_space_builder.h" | 9 #include "core/layout/ng/ng_constraint_space_builder.h" |
| 10 #include "core/layout/ng/ng_layout_opportunity_iterator.h" | 10 #include "core/layout/ng/ng_layout_opportunity_iterator.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 NGFragmentationType NGConstraintSpace::BlockFragmentationType() const { | 134 NGFragmentationType NGConstraintSpace::BlockFragmentationType() const { |
| 135 return static_cast<NGFragmentationType>(block_direction_fragmentation_type_); | 135 return static_cast<NGFragmentationType>(block_direction_fragmentation_type_); |
| 136 } | 136 } |
| 137 | 137 |
| 138 NGLayoutOpportunityIterator* NGConstraintSpace::LayoutOpportunityIterator( | 138 NGLayoutOpportunityIterator* NGConstraintSpace::LayoutOpportunityIterator( |
| 139 const NGLogicalOffset& iter_offset) { | 139 const NGLogicalOffset& iter_offset) { |
| 140 if (layout_opp_iter_ && layout_opp_iter_->Offset() != iter_offset) | 140 if (layout_opp_iter_ && layout_opp_iter_->Offset() != iter_offset) |
| 141 layout_opp_iter_.reset(); | 141 layout_opp_iter_.reset(); |
| 142 | 142 |
| 143 if (!layout_opp_iter_) { | 143 if (!layout_opp_iter_) { |
| 144 layout_opp_iter_ = | 144 layout_opp_iter_ = WTF::makeUnique<NGLayoutOpportunityIterator>( |
| 145 WTF::makeUnique<NGLayoutOpportunityIterator>(this, iter_offset); | 145 this, AvailableSize(), iter_offset); |
| 146 } | 146 } |
| 147 return layout_opp_iter_.get(); | 147 return layout_opp_iter_.get(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 String NGConstraintSpace::ToString() const { | 150 String NGConstraintSpace::ToString() const { |
| 151 return String::format( | 151 return String::format( |
| 152 "Offset: %s,%s Size: %sx%s MarginStrut: %s" | 152 "Offset: %s,%s Size: %sx%s MarginStrut: %s" |
| 153 " Clearance: %s", | 153 " Clearance: %s", |
| 154 bfc_offset_.inline_offset.toString().ascii().data(), | 154 bfc_offset_.inline_offset.toString().ascii().data(), |
| 155 bfc_offset_.block_offset.toString().ascii().data(), | 155 bfc_offset_.block_offset.toString().ascii().data(), |
| 156 AvailableSize().inline_size.toString().ascii().data(), | 156 AvailableSize().inline_size.toString().ascii().data(), |
| 157 AvailableSize().block_size.toString().ascii().data(), | 157 AvailableSize().block_size.toString().ascii().data(), |
| 158 margin_strut_.ToString().ascii().data(), | 158 margin_strut_.ToString().ascii().data(), |
| 159 clearance_offset_.has_value() | 159 clearance_offset_.has_value() |
| 160 ? clearance_offset_.value().toString().ascii().data() | 160 ? clearance_offset_.value().toString().ascii().data() |
| 161 : "none"); | 161 : "none"); |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace blink | 164 } // namespace blink |
| OLD | NEW |