Commit fea62cfd authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[LayoutNG] Remove optimization that practically does nothing.

This was an over-otimization, which realistically probably never gets
hit.

Bug: 635619
Change-Id: Icac53b8605e56242b8455228d0767b2dafb66b5d
Reviewed-on: https://chromium-review.googlesource.com/c/1305133
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604211}
parent f2f7bfe6
...@@ -1323,18 +1323,12 @@ bool NGBlockLayoutAlgorithm::HandleInflow( ...@@ -1323,18 +1323,12 @@ bool NGBlockLayoutAlgorithm::HandleInflow(
// //
// The resulting margin strut in the above example will be {40, -30}. See // The resulting margin strut in the above example will be {40, -30}. See
// ComputeInflowPosition for how this end margin strut is used. // ComputeInflowPosition for how this end margin strut is used.
bool empty_block_affected_by_clearance_needs_relayout = false;
if (empty_block_affected_by_clearance) { if (empty_block_affected_by_clearance) {
NGMarginStrut margin_strut; NGMarginStrut margin_strut;
margin_strut.Append(child_data.margins.block_start, margin_strut.Append(child_data.margins.block_start,
child.Style().HasMarginBeforeQuirk()); child.Style().HasMarginBeforeQuirk());
// We only need to relayout if the new margin strut is different to the child_data.margin_strut = margin_strut;
// previous one.
if (child_data.margin_strut != margin_strut) {
child_data.margin_strut = margin_strut;
empty_block_affected_by_clearance_needs_relayout = true;
}
} }
// We need to layout a child if we know its BFC block offset and: // We need to layout a child if we know its BFC block offset and:
...@@ -1342,8 +1336,7 @@ bool NGBlockLayoutAlgorithm::HandleInflow( ...@@ -1342,8 +1336,7 @@ bool NGBlockLayoutAlgorithm::HandleInflow(
// - It has some unpositioned floats. // - It has some unpositioned floats.
// - It was affected by clearance. // - It was affected by clearance.
if ((layout_result->Status() == NGLayoutResult::kBfcBlockOffsetResolved || if ((layout_result->Status() == NGLayoutResult::kBfcBlockOffsetResolved ||
relayout_child_when_bfc_resolved || relayout_child_when_bfc_resolved || empty_block_affected_by_clearance) &&
empty_block_affected_by_clearance_needs_relayout) &&
child_bfc_block_offset) { child_bfc_block_offset) {
NGConstraintSpace new_child_space = CreateConstraintSpaceForChild( NGConstraintSpace new_child_space = CreateConstraintSpaceForChild(
child, child_data, child_available_size_, child_bfc_block_offset); child, child_data, child_available_size_, child_bfc_block_offset);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment