-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-grid] Correctly stretch a replaced element in both axes
As discussed in w3c/csswg-drafts#5713 Change-Id: I90c8bd9c5516d11cae6798d7d7cb6c679e166994
- Loading branch information
1 parent
a1f5466
commit 39d7256
Showing
8 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
css/css-grid/alignment/replaced-alignment-with-aspect-ratio-004.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,10 @@ | ||
<!DOCTYPE html> | ||
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> | ||
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5713"> | ||
<meta name="assert" content="If stretch alignment is applied to both axis the aspect-ratio of a replaced element is ignored."> | ||
|
||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
|
||
<div style="display: grid; grid-template: 100px / 100px; width: 100px; height: 100px; background: red;"> | ||
<img src="support/25x50-green.png" width=25 height=50 style="background: green; align-self: stretch; justify-self: stretch; width: auto; height: auto;"></img> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
css/css-grid/alignment/replaced-alignment-with-aspect-ratio-005.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,10 @@ | ||
<!DOCTYPE html> | ||
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> | ||
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5713"> | ||
<meta name="assert" content="If stretch alignment is applied to both axis the aspect-ratio of a replaced element is ignored."> | ||
|
||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
|
||
<div style="display: grid; grid-template: 100px / 100px; width: 100px; height: 100px; background: red;"> | ||
<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> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
css/css-grid/alignment/replaced-alignment-with-aspect-ratio-006.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,10 @@ | ||
<!DOCTYPE html> | ||
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> | ||
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5713"> | ||
<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."> | ||
|
||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
|
||
<div style="display: grid; grid-template: 100px / 500px; width: 100px; height: 100px; background: red;"> | ||
<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> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
css/css-grid/alignment/replaced-alignment-with-aspect-ratio-007.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,10 @@ | ||
<!DOCTYPE html> | ||
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> | ||
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5713"> | ||
<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."> | ||
|
||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
|
||
<div style="display: grid; grid-template: 500px / 100px; width: 100px; height: 100px; background: red;"> | ||
<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> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
css/css-grid/alignment/replaced-alignment-with-aspect-ratio-008.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,10 @@ | ||
<!DOCTYPE html> | ||
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> | ||
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5713"> | ||
<meta name="assert" content="Stretch alignment in one axis should apply aspect-ratio in the other"> | ||
|
||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
|
||
<div style="display: grid; grid-template: 100px / 100px; width: 100px; height: 100px; background: red;"> | ||
<img src="support/50x50-green.png" width=50 height=50 style="background: green; justify-self: stretch; width: auto; height: auto;"></img> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
css/css-grid/alignment/replaced-alignment-with-aspect-ratio-009.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,10 @@ | ||
<!DOCTYPE html> | ||
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> | ||
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5713"> | ||
<meta name="assert" content="Stretch alignment in one axis should apply aspect-ratio in the other"> | ||
|
||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
|
||
<div style="display: grid; grid-template: 100px / 100px; width: 100px; height: 100px; background: red;"> | ||
<img src="support/50x50-green.png" width=50 height=50 style="background: green; align-self: stretch; width: auto; height: auto;"></img> | ||
</div> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.