This repository has been archived by the owner on Jul 30, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1639963 - Fix margin collapsing with aspect-ratio. r=emilio
Basically, we treat aspect-ratio (together with inline size) as a non-auto block size. This means the block is not empty when using aspect-ratio. Also, add 2 tentative wpts for this, based on the current spec issue examples. w3c/csswg-drafts#5328 Differential Revision: https://phabricator.services.mozilla.com/D84452
- Loading branch information
1 parent
765ef7f
commit 658e5ae
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
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
15 changes: 15 additions & 0 deletions
15
.../css/css-sizing/aspect-ratio/block-aspect-ratio-with-margin-collapsing-001.tentative.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,15 @@ | ||
<!DOCTYPE html> | ||
<title>CSS aspect-ratio: margin-collapsing with aspect-ratio on child element</title> | ||
<link rel="author" title="Mozilla" href="https://www.mozilla.org/"> | ||
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio"> | ||
<link rel="help" href="https://drafts.csswg.org/css2/#collapsing-margins"> | ||
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" /> | ||
|
||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
|
||
<div style="background: green; width: 100px; height: 25px; margin-bottom: -50px;"></div> | ||
<div style="background: green; width: 100px; margin: 0px;"> | ||
<div style="margin-top: 50px; margin-bottom: 100px; | ||
width: 100px; aspect-ratio: 2/1"></div> | ||
</div> | ||
<div style="background: green; width: 100px; height: 25px; margin-top: -100px;"></div> |
14 changes: 14 additions & 0 deletions
14
.../css/css-sizing/aspect-ratio/block-aspect-ratio-with-margin-collapsing-002.tentative.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,14 @@ | ||
<!DOCTYPE html> | ||
<title>CSS aspect-ratio: margin-collapsing with aspect-ratio on parent element</title> | ||
<link rel="author" title="Mozilla" href="https://www.mozilla.org/"> | ||
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio"> | ||
<link rel="help" href="https://drafts.csswg.org/css2/#collapsing-margins"> | ||
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" /> | ||
|
||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
|
||
<div style="background: green; width: 100px; height: 25px; margin-bottom: -200px;"></div> | ||
<div style="background: green; width: 100px; margin: 0px; aspect-ratio: 2/1"> | ||
<div style="width: 100px; margin-top: 50px; margin-bottom: 200px;"></div> | ||
</div> | ||
<div style="background: green; width: 100px; height: 25px;"></div> |