Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix margin collapsing with aspect-ratio.
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 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1639963 gecko-commit: a5e9b2bede3a76b9587985a37eed227dcbabd620 gecko-integration-branch: autoland gecko-reviewers: emilio
- Loading branch information
1 parent
4b8d683
commit a56c6a2
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
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> |