Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc |
| diff --git a/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc b/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc |
| index 61b987bb7d44fb52fa76f33f1a59422dd9ad1ce9..543000a1f6d39c1aeab44e2d388ef4130d68ae28 100644 |
| --- a/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc |
| +++ b/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc |
| @@ -40,16 +40,19 @@ NGLogicalOffset AdjustToTopEdgeAlignmentRule(const NGConstraintSpace& space, |
| // establishes a new formatting context that we're currently |
| // in and where all our exclusions reside. |
| // @param margins Margins of the fragment. |
| +// @param available_size Available size used by the layout opportunity iterator. |
| // @return Layout opportunity for the fragment. |
| const NGLayoutOpportunity FindLayoutOpportunityForFragment( |
| const NGConstraintSpace* space, |
| const NGFragment& fragment, |
| const NGLogicalOffset& origin_point, |
|
ikilpatrick
2017/03/24 21:17:34
so what i was imagining is that the caller to this
Gleb Lanbin
2017/03/24 21:49:36
Acknowledged.
|
| - const NGBoxStrut& margins) { |
| + const NGBoxStrut& margins, |
| + const NGLogicalSize& available_size) { |
| NGLogicalOffset adjusted_origin_point = |
| AdjustToTopEdgeAlignmentRule(*space, origin_point); |
| - NGLayoutOpportunityIterator opportunity_iter(space, adjusted_origin_point); |
| + NGLayoutOpportunityIterator opportunity_iter(space, available_size, |
| + adjusted_origin_point); |
| NGLayoutOpportunity opportunity; |
| NGLayoutOpportunity opportunity_candidate = opportunity_iter.Next(); |
| @@ -140,7 +143,8 @@ NGLogicalOffset PositionFloat(const NGLogicalOffset& origin_point, |
| // Find a layout opportunity that will fit our float. |
| const NGLayoutOpportunity opportunity = FindLayoutOpportunityForFragment( |
| - float_space, float_fragment, origin_point, floating_object->margins); |
| + new_parent_space, float_fragment, origin_point, floating_object->margins, |
|
ikilpatrick
2017/03/24 21:17:34
from above: e.g.
NGLogicalOffset adjusted_point({
Gleb Lanbin
2017/03/24 21:49:36
I find this additional adjustment a bit confusing.
|
| + floating_object->available_size); |
| DCHECK(!opportunity.IsEmpty()) << "Opportunity is empty but it shouldn't be"; |
| // Calculate the float offset if needed. |