-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1950354 [wpt PR 50926] - layout: Support
stretch
cross size for…
… automatic min size in flexbox, a=testonly Automatic update from web-platform-tests layout: Support `stretch` cross size for automatic min size in flexbox The computation of the automatic minimum size may involve transferring a definite cross size into the main axis through the aspect ratio. We were only considering numeric sizes as definite, but `stretch` can also be definite. Signed-off-by: Oriol Brufau <[email protected]> -- wpt-commits: 1171011d28302ebc41ee5240fa3a88b98d4ad730 wpt-pr: 50926
- Loading branch information
1 parent
d034783
commit b622c5d
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
testing/web-platform/tests/css/css-sizing/stretch/flexbox-auto-minimum-001.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Automatic minimum size of flex item with stretch cross size</title> | ||
<link rel="author" title="Oriol Brufau" href="mailto:[email protected]"> | ||
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#stretch-fit-sizing"> | ||
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#min-size-auto"> | ||
<link rel="match" href="../../reference/ref-filled-green-200px-square.html"> | ||
<meta assert="A definite `stretch` cross size can be transferred through the | ||
aspect ratio when computing the automatic minimum size of a flex item."> | ||
|
||
<style> | ||
div { | ||
display: flex; | ||
flex-direction: column; | ||
height: 200px; | ||
width: 200px; | ||
background: red; | ||
} | ||
canvas { | ||
width: stretch; | ||
align-self: start; | ||
flex-basis: 0; | ||
background: green; | ||
} | ||
</style> | ||
|
||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div class="flex"> | ||
<canvas width="100" height="100"></canvas> | ||
</div> |
30 changes: 30 additions & 0 deletions
30
testing/web-platform/tests/css/css-sizing/stretch/flexbox-auto-minimum-002.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Automatic minimum size of flex item with stretch cross size</title> | ||
<link rel="author" title="Oriol Brufau" href="mailto:[email protected]"> | ||
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#stretch-fit-sizing"> | ||
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#min-size-auto"> | ||
<link rel="match" href="../../reference/ref-filled-green-200px-square.html"> | ||
<meta assert="A definite `stretch` cross size can be transferred through the | ||
aspect ratio when computing the automatic minimum size of a flex item."> | ||
|
||
<style> | ||
div { | ||
display: flex; | ||
flex-direction: row; | ||
height: 200px; | ||
width: 200px; | ||
background: red; | ||
} | ||
canvas { | ||
height: stretch; | ||
align-self: start; | ||
flex-basis: 0; | ||
background: green; | ||
} | ||
</style> | ||
|
||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div class="flex"> | ||
<canvas width="100" height="100"></canvas> | ||
</div> |