Index: third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc |
index 95a0349a1a5ed1763920ffad5805b716bcb2192d..1b6669bdac36660df90020fb506c8dd8935efa4d 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc |
@@ -135,10 +135,14 @@ NGFragmentationType NGConstraintSpace::BlockFragmentationType() const { |
return static_cast<NGFragmentationType>(block_direction_fragmentation_type_); |
} |
-NGLayoutOpportunityIterator* NGConstraintSpace::LayoutOpportunityIterator() { |
+NGLayoutOpportunityIterator* NGConstraintSpace::LayoutOpportunityIterator( |
+ const NGLogicalOffset& iter_offset) { |
+ if (layout_opp_iter_ && layout_opp_iter_->Offset() != iter_offset) |
+ layout_opp_iter_.reset(); |
+ |
if (!layout_opp_iter_) { |
layout_opp_iter_ = |
- WTF::makeUnique<NGLayoutOpportunityIterator>(this, this->bfc_offset_); |
+ WTF::makeUnique<NGLayoutOpportunityIterator>(this, iter_offset); |
} |
return layout_opp_iter_.get(); |
} |