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

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

Issue 2462413002: Reland of Use NGLogicalRect instead of NGExclusion for exclusions. (Closed)
Patch Set: Created 4 years, 1 month 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_block_layout_algorithm.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
index 6552cb503e67df931c874ecd860a54444340b3fe..1e8134b53c02fa04529233ff350743f56f25a8b9 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -28,24 +28,22 @@
// Creates an exclusion from the fragment that will be placed in the provided
// layout opportunity.
-NGExclusion* CreateExclusion(const NGFragment& fragment,
- const NGLayoutOpportunity& opportunity,
- LayoutUnit float_offset,
- NGBoxStrut margins) {
- LayoutUnit exclusion_top = opportunity.offset.block_offset;
-
- LayoutUnit exclusion_left = opportunity.offset.inline_offset;
- exclusion_left += float_offset;
-
- LayoutUnit exclusion_bottom = exclusion_top + fragment.BlockSize();
- LayoutUnit exclusion_right = exclusion_left + fragment.InlineSize();
+NGLogicalRect CreateExclusion(const NGFragment& fragment,
+ const NGLayoutOpportunity& opportunity,
+ LayoutUnit float_offset,
+ NGBoxStrut margins) {
+ NGLogicalRect exclusion;
+ exclusion.offset = opportunity.offset;
+ exclusion.offset.inline_offset += float_offset;
+
+ exclusion.size.inline_size = fragment.InlineSize();
+ exclusion.size.block_size = fragment.BlockSize();
// Adjust to child's margin.
- exclusion_bottom += margins.BlockSum();
- exclusion_right += margins.InlineSum();
-
- return new NGExclusion(exclusion_top, exclusion_right, exclusion_bottom,
- exclusion_left);
+ exclusion.size.block_size += margins.BlockSum();
+ exclusion.size.inline_size += margins.InlineSum();
+
+ return exclusion;
}
// Finds a layout opportunity for the fragment.
@@ -361,7 +359,7 @@
}
// Add the float as an exclusion.
- const NGExclusion* exclusion =
+ const NGLogicalRect exclusion =
CreateExclusion(fragment, opportunity, float_offset, margins);
constraint_space_->AddExclusion(exclusion);
« no previous file with comments | « third_party/WebKit/Source/core/layout/BUILD.gn ('k') | third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698