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

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

Issue 2807113002: [LayoutNG] Use NGLogical[Offset|Size] for NGFragment
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 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 d1519fd17eed9bf2e2e8a29397d55b479cd937fe..6c4bb884619cbe238524314d64db2891f0541a6a 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
@@ -56,7 +56,8 @@ const NGLayoutOpportunity FindLayoutOpportunityForFragment(
opportunity = opportunity_candidate;
// Checking opportunity's block size is not necessary as a float cannot be
// positioned on top of another float inside of the same constraint space.
- auto fragment_inline_size = fragment.InlineSize() + margins.InlineSum();
+ auto fragment_inline_size =
+ fragment.Size().inline_size + margins.InlineSum();
if (opportunity.size.inline_size >= fragment_inline_size)
break;
@@ -97,9 +98,7 @@ NGExclusion CreateExclusion(const NGFragment& fragment,
NGLogicalRect& rect = exclusion.rect;
rect.offset = opportunity.offset;
rect.offset.inline_offset += float_offset;
-
- rect.size.inline_size = fragment.InlineSize() + margins.InlineSum();
- rect.size.block_size = fragment.BlockSize() + margins.BlockSum();
+ rect.size = fragment.Size() + margins;
return exclusion;
}
@@ -136,16 +135,15 @@ NGLogicalOffset PositionFloat(NGFloatingObject* floating_object,
// an empty opportunity can mean 2 things:
// - search for layout opportunities is exhausted.
// - opportunity has an infinite size. That's because CS is infinite.
- opportunity = NGLayoutOpportunity(
- NGLogicalOffset(),
- NGLogicalSize(float_fragment.InlineSize(), float_fragment.BlockSize()));
+ opportunity = NGLayoutOpportunity(NGLogicalOffset(), float_fragment.Size());
}
// Calculate the float offset if needed.
LayoutUnit float_offset;
if (floating_object->exclusion_type == NGExclusion::kFloatRight) {
LayoutUnit float_margin_box_inline_size =
- float_fragment.InlineSize() + floating_object->margins.InlineSum();
+ float_fragment.Size().inline_size +
+ floating_object->margins.InlineSum();
float_offset = opportunity.size.inline_size - float_margin_box_inline_size;
}

Powered by Google App Engine
This is Rietveld 408576698