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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc

Issue 2770483002: CS of out-of-flow positioned objects should have is_new_fc == true (Closed)
Patch Set: update TestExpectations Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
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,
- 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,
+ floating_object->available_size);
DCHECK(!opportunity.IsEmpty()) << "Opportunity is empty but it shouldn't be";
// Calculate the float offset if needed.

Powered by Google App Engine
This is Rietveld 408576698