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

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

Issue 2453553002: Resolve ApplyAutoMargins's TODO in NGBlockLayoutAlgorithm. (Closed)
Patch Set: change ApplyAutoMargins to pass margins by pointer + DCHECK Created 4 years, 2 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_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 1f126b242f35a5842d0064cf22eb60e3df9bdf8f..f9d1fa9804d88f916d6569abbfc44f3e9e196369 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
@@ -202,9 +202,8 @@ bool NGBlockLayoutAlgorithm::Layout(const NGConstraintSpace* constraint_space,
if (current_child_->Style()->isFloating()) {
fragment_offset = PositionFloatFragment(*fragment, child_margins);
} else {
- // TODO(layout-ng): move ApplyAutoMargins to PositionFragment
ApplyAutoMargins(*constraint_space_for_children_,
- *current_child_->Style(), *fragment, child_margins);
+ *current_child_->Style(), *fragment, &child_margins);
fragment_offset =
PositionFragment(*fragment, child_margins, *constraint_space);
}
@@ -306,7 +305,7 @@ NGBoxStrut NGBlockLayoutAlgorithm::CollapseMargins(
NGLogicalOffset NGBlockLayoutAlgorithm::PositionFragment(
const NGFragment& fragment,
- NGBoxStrut child_margins,
+ const NGBoxStrut& child_margins,
const NGConstraintSpace& space) {
const NGBoxStrut collapsed_margins =
CollapseMargins(space, child_margins, fragment);
@@ -324,7 +323,7 @@ NGLogicalOffset NGBlockLayoutAlgorithm::PositionFragment(
NGLogicalOffset NGBlockLayoutAlgorithm::PositionFloatFragment(
const NGFragment& fragment,
- NGBoxStrut margins) {
+ const NGBoxStrut& margins) {
// TODO(glebl@chromium.org): Support the top edge alignment rule.
// Find a layout opportunity that will fit our float.
const NGLayoutOpportunity opportunity = FindLayoutOpportunityForFragment(

Powered by Google App Engine
This is Rietveld 408576698