[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: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604211}
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc
index a21710e..241c366 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc
@@ -1323,18 +1323,12 @@
//
// The resulting margin strut in the above example will be {40, -30}. See
// ComputeInflowPosition for how this end margin strut is used.
- bool empty_block_affected_by_clearance_needs_relayout = false;
if (empty_block_affected_by_clearance) {
NGMarginStrut margin_strut;
margin_strut.Append(child_data.margins.block_start,
child.Style().HasMarginBeforeQuirk());
- // We only need to relayout if the new margin strut is different to the
- // previous one.
- if (child_data.margin_strut != margin_strut) {
- child_data.margin_strut = margin_strut;
- empty_block_affected_by_clearance_needs_relayout = true;
- }
+ child_data.margin_strut = margin_strut;
}
// We need to layout a child if we know its BFC block offset and:
@@ -1342,8 +1336,7 @@
// - It has some unpositioned floats.
// - It was affected by clearance.
if ((layout_result->Status() == NGLayoutResult::kBfcBlockOffsetResolved ||
- relayout_child_when_bfc_resolved ||
- empty_block_affected_by_clearance_needs_relayout) &&
+ relayout_child_when_bfc_resolved || empty_block_affected_by_clearance) &&
child_bfc_block_offset) {
NGConstraintSpace new_child_space = CreateConstraintSpaceForChild(
child, child_data, child_available_size_, child_bfc_block_offset);