Tests: Import a bunch of WPT tests from /css/css-flexbox

This commit is contained in:
Andreas Kling
2024-10-28 21:03:26 +01:00
committed by Andreas Kling
parent 0ebdac0b35
commit abd24d001d
Notes: github-actions[bot] 2024-10-30 09:18:21 +00:00
688 changed files with 27834 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
<!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>