Commit 00b73077 authored by David Grogan's avatar David Grogan Committed by Commit Bot

[FlexNG] Remove a DCHECK in SimplifiedLayout

The test includes some variants of the crash repro as evidence that the
crash was harmless.

Bug: 1018439
Fixed: 1091588
Change-Id: I879d4ce879d9fafb86b26a21609141b2fcfc5a9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2265100Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: David Grogan <dgrogan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786031}
parent b1e091ec
...@@ -301,10 +301,6 @@ void NGLayoutResult::CheckSameForSimplifiedLayout( ...@@ -301,10 +301,6 @@ void NGLayoutResult::CheckSameForSimplifiedLayout(
other.bitfields_.initial_break_before); other.bitfields_.initial_break_before);
DCHECK_EQ(bitfields_.final_break_after, other.bitfields_.final_break_after); DCHECK_EQ(bitfields_.final_break_after, other.bitfields_.final_break_after);
if (check_same_block_size) {
DCHECK_EQ(bitfields_.is_initial_block_size_indefinite,
other.bitfields_.is_initial_block_size_indefinite);
}
DCHECK_EQ( DCHECK_EQ(
bitfields_.has_descendant_that_depends_on_percentage_block_size, bitfields_.has_descendant_that_depends_on_percentage_block_size,
other.bitfields_.has_descendant_that_depends_on_percentage_block_size); other.bitfields_.has_descendant_that_depends_on_percentage_block_size);
......
This is a testharness.js-based test.
PASS .relpos 1
PASS .relpos 2
PASS .relpos 3
FAIL .relpos 4 assert_equals:
<div class="relpos flexbox" data-expected-height="20">
<div class="abspos">Test</div>
<div style="height: 20px;"></div>
<div style="height: 50%" data-expected-height="10"></div>
</div>
height expected 10 but got 0
PASS .relpos 5
PASS .relpos 6
PASS .relpos 7
PASS .relpos 8
Harness: the test ran to completion.
<!DOCTYPE html>
<title>grid items and abspos flex children</title>
<link rel="author" title="David Grogan" href="mailto:dgrogan@chromium.org" />
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#abspos-items">
<link rel="help" href="https://drafts.csswg.org/css-grid/#algo-overview" title="Note at bottom of this section: 'the size of a grid item which is stretched is also considered definite.'">
<link rel="bookmark" href="https://crbug.com/1091588" />
<link rel="bookmark" href="https://crbug.com/1018439" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<style>
.grid {
display: grid;
}
.flexbox {
display: flex;
}
.relpos {
position: relative;
}
.abspos {
position: absolute;
border: 1px solid;
}
/* These are just for making the test look better. */
p {
margin: 0px;
}
p + div {
margin-bottom: 40px;
}
</style>
<p>This crashed Chrome 84.</p>
<div class=grid>
<div class="relpos flexbox" data-expected-height=20>
<div class=abspos>Test</div>
<div style="height: 20px;"></div>
</div>
</div>
<p>Outer is a regular div.</p>
<div>
<div class="relpos flexbox" data-expected-height=20>
<div class=abspos>Test</div>
<div style="height: 20px;"></div>
</div>
</div>
<p>relpos element is a regular div, not flexbox.</p>
<div class=grid>
<div class="relpos" data-expected-height=20>
<div class=abspos>Test</div>
<div style="height: 20px;"></div>
</div>
</div>
<p>Relpos flexbox has a % height descendant. The height of the flexbox grid item is supposed to be definite, allowing the %height flex item to resolve.
This fails in chrome because of https://crbug.com/1018439</p>
<div class=grid>
<div class="relpos flexbox" data-expected-height=20>
<div class=abspos>Test</div>
<div style="height: 20px;"></div>
<div style="height: 50%" data-expected-height=10></div>
</div>
</div>
<script>
checkLayout('.relpos');
// Changing the abspos border shouldn't change the size of any inflow element.
for (abspos of document.querySelectorAll(".abspos")) {
abspos.style.borderWidth = "10px";
}
checkLayout('.relpos');
</script>
This is a testharness.js-based test.
PASS .relpos 1
PASS .relpos 2
PASS .relpos 3
FAIL .relpos 4 assert_equals:
<div class="relpos flexbox" data-expected-height="20">
<div class="abspos">Test</div>
<div style="height: 20px;"></div>
<div style="height: 50%" data-expected-height="10"></div>
</div>
height expected 10 but got 0
PASS .relpos 5
PASS .relpos 6
PASS .relpos 7
FAIL .relpos 8 assert_equals:
<div class="relpos flexbox" data-expected-height="20">
<div class="abspos" style="border-width: 10px;">Test</div>
<div style="height: 20px;"></div>
<div style="height: 50%" data-expected-height="10"></div>
</div>
height expected 10 but got 0
Harness: the test ran to completion.
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