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 1a584184b9bc5aaa389770efe39dd54ac84525d2..7b170a84ac515b065d6af18d6928a454f45b4d8e 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 |
@@ -277,9 +277,10 @@ void NGBlockLayoutAlgorithm::PrepareChildLayout(NGLayoutInputNode* child) { |
DCHECK(child); |
// Calculate margins in parent's writing mode. |
- curr_child_margins_ = CalculateMargins( |
- child, *space_builder_.ToConstraintSpace( |
- FromPlatformWritingMode(Style().getWritingMode()))); |
+ curr_child_margins_ = ComputeMarginsForChild( |
+ *space_builder_.ToConstraintSpace( |
+ FromPlatformWritingMode(Style().getWritingMode())), |
+ child); |
// Set estimated BFC offset to the next child's constraint space. |
curr_bfc_offset_ = builder_.BfcOffset() ? builder_.BfcOffset().value() |
@@ -463,26 +464,6 @@ void NGBlockLayoutAlgorithm::FinalizeForFragmentation() { |
builder_.SetBlockOverflow(content_size_); |
} |
-NGBoxStrut NGBlockLayoutAlgorithm::CalculateMargins( |
- NGLayoutInputNode* child, |
- const NGConstraintSpace& space) { |
- DCHECK(child); |
- const ComputedStyle& child_style = child->Style(); |
- |
- WTF::Optional<MinMaxContentSize> sizes; |
- if (NeedMinMaxContentSize(space, child_style)) |
- sizes = child->ComputeMinMaxContentSize(); |
- |
- LayoutUnit child_inline_size = |
- ComputeInlineSizeForFragment(space, child_style, sizes); |
- NGBoxStrut margins = ComputeMargins(space, child_style, space.WritingMode(), |
- space.Direction()); |
- if (!child_style.isFloating()) { |
- ApplyAutoMargins(space, child_style, child_inline_size, &margins); |
- } |
- return margins; |
-} |
- |
RefPtr<NGConstraintSpace> NGBlockLayoutAlgorithm::CreateConstraintSpaceForChild( |
NGLayoutInputNode* child) { |
DCHECK(child); |