Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc

Issue 2812983002: Change NGLayoutOpportunityIterator API to work with list of exclusions (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_ = WTF::MakeUnique<NGLayoutOpportunityIterator>( 144 layout_opp_iter_ = WTF::MakeUnique<NGLayoutOpportunityIterator>(
145 this, AvailableSize(), iter_offset); 145 this->Exclusions().get(), AvailableSize(), iter_offset);
cbiesinger 2017/04/11 20:09:38 why the this->?
Gleb Lanbin 2017/04/11 20:21:38 Done.
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698