| Index: third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc
|
| diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc
|
| index f7a8d6c5d2d3f6937aa0577c1accc311610b7829..f95d51d176ef7445381c363cce38b3fa787a9741 100644
|
| --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc
|
| +++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc
|
| @@ -3,6 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "core/layout/ng/ng_layout_opportunity_iterator.h"
|
| +
|
| #include "core/layout/ng/ng_constraint_space.h"
|
| #include "core/layout/ng/ng_exclusion.h"
|
| #include "wtf/NonCopyingSort.h"
|
| @@ -264,23 +265,25 @@
|
|
|
| NGLayoutOpportunityIterator::NGLayoutOpportunityIterator(
|
| const NGConstraintSpace* space,
|
| - const WTF::Optional<NGLogicalOffset>& opt_offset,
|
| + const WTF::Optional<NGLogicalOffset>& opt_origin_point,
|
| const WTF::Optional<NGLogicalOffset>& opt_leader_point)
|
| - : constraint_space_(space),
|
| - offset_(opt_offset ? opt_offset.value() : space->BfcOffset()) {
|
| + : constraint_space_(space) {
|
| // TODO(chrome-layout-team): Combine exclusions that shadow each other.
|
| auto& exclusions = constraint_space_->Exclusions();
|
| DCHECK(std::is_sorted(exclusions->storage.begin(), exclusions->storage.end(),
|
| &CompareNGExclusionsByTopAsc))
|
| << "Exclusions are expected to be sorted by TOP";
|
|
|
| + NGLogicalOffset origin_point =
|
| + opt_origin_point ? opt_origin_point.value() : NGLogicalOffset();
|
| NGLayoutOpportunity initial_opportunity =
|
| - CreateLayoutOpportunityFromConstraintSpace(*constraint_space_, Offset());
|
| + CreateLayoutOpportunityFromConstraintSpace(*constraint_space_,
|
| + origin_point);
|
| opportunity_tree_root_ = new NGLayoutOpportunityTreeNode(initial_opportunity);
|
|
|
| if (opt_leader_point) {
|
| const NGExclusion leader_exclusion =
|
| - ToLeaderExclusion(Offset(), opt_leader_point.value());
|
| + ToLeaderExclusion(origin_point, opt_leader_point.value());
|
| InsertExclusion(MutableOpportunityTreeRoot(), &leader_exclusion,
|
| opportunities_);
|
| }
|
|
|