Skip to content

Commit e0308c7

Browse files
Loirooriolservo-wpt-sync
authored andcommitted
layout: Restrict stretch alignment to flex items with computed auto size
We were allowing `align-self: stretch` to stretch flex items whose cross size behaves as `auto`, including cyclic percentages. However, w3c/csswg-drafts#4525 resolved that stretching should only happen when the cross size computes to `auto`. So this patch exposes this information in `ContentBoxSizesAndPBM`, and refactors the flexbox stretching logic. Signed-off-by: Oriol Brufau <[email protected]>
1 parent f18dd62 commit e0308c7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<title>Stretch alignment with percentage that behaves as auto</title>
3+
<link rel="author" title="Oriol Brufau" href="mailto:[email protected]">
4+
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#valdef-align-items-stretch">
5+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/4525">
6+
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
7+
<meta name="assert" content="
8+
Stretch alignment requires a computed cross size of `auto`.
9+
So a cyclic percentage that only behaves as `auto` doesn't stretch.
10+
">
11+
12+
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
13+
14+
<div style="display: flex">
15+
<div style="width: 100px; height: 100px; background: green"></div>
16+
<div style="width: 100px; height: 50%; background: red"></div>
17+
</div>

0 commit comments

Comments
 (0)