Skip to content

Commit 39d7256

Browse files
cbiesingerchromium-wpt-export-bot
authored andcommitted
[css-grid] Correctly stretch a replaced element in both axes
As discussed in w3c/csswg-drafts#5713 Change-Id: I90c8bd9c5516d11cae6798d7d7cb6c679e166994
1 parent a1f5466 commit 39d7256

8 files changed

+60
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
>
2+
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
3+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5713">
4+
<meta name="assert" content="If stretch alignment is applied to both axis the aspect-ratio of a replaced element is ignored.">
5+
6+
<p>Test passes if there is a filled green square and <strong>no redstrong>.p>
7+
8+
<div style="display: grid; grid-template: 100px / 100px; width: 100px; height: 100px; background: red;">
9+
<img src="support/25x50-green.png" width=25 height=50 style="background: green; align-self: stretch; justify-self: stretch; width: auto; height: auto;">img>
10+
div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
>
2+
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
3+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5713">
4+
<meta name="assert" content="If stretch alignment is applied to both axis the aspect-ratio of a replaced element is ignored.">
5+
6+
<p>Test passes if there is a filled green square and <strong>no redstrong>.p>
7+
8+
<div style="display: grid; grid-template: 100px / 100px; width: 100px; height: 100px; background: red;">
9+
<img src="support/25x50-green.png" width=25 height=50 style="background: green; align-self: stretch; justify-self: stretch; width: auto; height: auto; writing-mode: vertical-lr;">img>
10+
div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
>
2+
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
3+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5713">
4+
<meta name="assert" content="If stretch alignment is applied to both axis the aspect-ratio of a replaced element is ignored, but not when margins are present.">
5+
6+
<p>Test passes if there is a filled green square and <strong>no redstrong>.p>
7+
8+
<div style="display: grid; grid-template: 100px / 500px; width: 100px; height: 100px; background: red;">
9+
<img src="support/50x50-green.png" width=50 height=50 style="background: green; align-self: stretch; justify-self: stretch; width: auto; height: auto; margin-right: auto;">img>
10+
div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
>
2+
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
3+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5713">
4+
<meta name="assert" content="If stretch alignment is applied to both axis the aspect-ratio of a replaced element is ignored, but not when margins are present.">
5+
6+
<p>Test passes if there is a filled green square and <strong>no redstrong>.p>
7+
8+
<div style="display: grid; grid-template: 500px / 100px; width: 100px; height: 100px; background: red;">
9+
<img src="support/50x50-green.png" width=50 height=50 style="background: green; align-self: stretch; justify-self: stretch; width: auto; height: auto; margin-bottom: auto;">img>
10+
div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
>
2+
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
3+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5713">
4+
<meta name="assert" content="Stretch alignment in one axis should apply aspect-ratio in the other">
5+
6+
<p>Test passes if there is a filled green square and <strong>no redstrong>.p>
7+
8+
<div style="display: grid; grid-template: 100px / 100px; width: 100px; height: 100px; background: red;">
9+
<img src="support/50x50-green.png" width=50 height=50 style="background: green; justify-self: stretch; width: auto; height: auto;">img>
10+
div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
>
2+
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
3+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5713">
4+
<meta name="assert" content="Stretch alignment in one axis should apply aspect-ratio in the other">
5+
6+
<p>Test passes if there is a filled green square and <strong>no redstrong>.p>
7+
8+
<div style="display: grid; grid-template: 100px / 100px; width: 100px; height: 100px; background: red;">
9+
<img src="support/50x50-green.png" width=50 height=50 style="background: green; align-self: stretch; width: auto; height: auto;">img>
10+
div>
99 Bytes
Loading
205 Bytes
Loading

0 commit comments

Comments
 (0)