| 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 2c9789afc08cec3ded1ab824f738533f80f753cb..fcd57428d2fa9cad658bf54f561a969cec5de6d8 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
|
| @@ -160,15 +160,18 @@ LayoutUnit NGBlockLayoutAlgorithm::CollapseMargins(
|
| curr_margin_strut.SetMarginBlockEnd(margins.block_end);
|
| }
|
|
|
| - // Update the parent fragment's margin strut
|
| - UpdateMarginStrut(curr_margin_strut);
|
| -
|
| - // Compute the margin block start for adjoining blocks.
|
| + // Compute the margin block start for
|
| + // 1) adjoining blocks
|
| + // 2) 1st block in LayoutNG root element's constraint space.
|
| LayoutUnit margin_block_start;
|
| - if (is_fragment_margin_strut_block_start_updated_) {
|
| + if (is_fragment_margin_strut_block_start_updated_ || space.IsRoot()) {
|
| margin_block_start = ComputeCollapsedMarginBlockStart(
|
| prev_child_margin_strut_, curr_margin_strut);
|
| }
|
| +
|
| + // Update the parent fragment's margin strut
|
| + UpdateMarginStrut(curr_margin_strut);
|
| +
|
| prev_child_margin_strut_ = curr_margin_strut;
|
| return margin_block_start;
|
| }
|
|
|