Skip to content

Commit ac28854

Browse files
Loirooriolservo-wpt-sync
authored andcommitted
layout: Floor content-box size by zero when stretching flex item
Signed-off-by: Oriol Brufau <[email protected]>
1 parent b748e59 commit ac28854

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>Non-negative content-box size of stretched flex item with `stretch` min cross size</title>
4+
<link rel="author" title="Oriol Brufau" href="mailto:[email protected]">
5+
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#stretch-fit-sizing">
6+
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#stretched">
7+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/11076">
8+
<link rel="help" href="https://github.com/servo/servo/issues/38517">
9+
<link rel="match" href="../../reference/ref-filled-green-200px-square.html">
10+
<meta assert="Stretching the cross size of a flex item to the flex line should never result
11+
in a negative content-box size.">
12+
13+
<style>
14+
#red {
15+
position: absolute;
16+
z-index: -1;
17+
width: 200px;
18+
height: 200px;
19+
background: red;
20+
}
21+
#flex-container {
22+
display: flex;
23+
flex-direction: row;
24+
height: 0;
25+
}
26+
#flex-item {
27+
min-height: stretch;
28+
border: 100px solid green;
29+
}
30+
</style>
31+
32+
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
33+
<div id="red"></div>
34+
<div id="flex-container">
35+
<div id="flex-item"></div>
36+
</div>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>Non-negative content-box size of stretched flex item with `stretch` min cross size</title>
4+
<link rel="author" title="Oriol Brufau" href="mailto:[email protected]">
5+
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#stretch-fit-sizing">
6+
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#stretched">
7+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/11076">
8+
<link rel="help" href="https://github.com/servo/servo/issues/38517">
9+
<link rel="match" href="../../reference/ref-filled-green-200px-square.html">
10+
<meta assert="Stretching the cross size of a flex item to the flex line should never result
11+
in a negative content-box size.">
12+
13+
<style>
14+
#red {
15+
position: absolute;
16+
z-index: -1;
17+
width: 200px;
18+
height: 200px;
19+
background: red;
20+
}
21+
#flex-container {
22+
display: flex;
23+
flex-direction: column;
24+
width: 0;
25+
}
26+
#flex-item {
27+
min-width: stretch;
28+
border: 100px solid green;
29+
}
30+
</style>
31+
32+
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
33+
<div id="red"></div>
34+
<div id="flex-container">
35+
<div id="flex-item"></div>
36+
</div>

0 commit comments

Comments
 (0)