Skip to content

Commit

Permalink
[AspectRatio] aspect-ratio should apply even with width:auto;height:a…
Browse files Browse the repository at this point in the history
…uto;

See discussion in w3c/csswg-drafts#5060

R=ikilpatrick@chromium.org

Fixed: 1082479
Change-Id: Ic1f47a5ba92cdbff96ce0b1d60e9741c1051c291
  • Loading branch information
cbiesinger authored and chromium-wpt-export-bot committed May 15, 2020
1 parent 9497c1d commit 9e3f14a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<title>CSS aspect-ratio: div block size</title>
<link rel="author" title="Google LLC" href="https://www.google.com/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5060">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<meta name="assert" content="Aspect ratio should only be used if a width was specified.">
<meta name="assert" content="Aspect ratio should be used even if width and height are auto.">

<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>

<div style="background: red; aspect-ratio: 1/1;"></div>
<div style="background: green; width: 100px; height: 100px;"></div>
<div style="width: 100px;">
<div style="background: green; aspect-ratio: 1/1;"></div>
</div>
4 changes: 2 additions & 2 deletions css/css-sizing/aspect-ratio/quirks-mode-002.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<script>
onload = function() {
test(function() {
assert_not_equals(document.body.offsetHeight, document.body.offsetWidth);
}, "body height is different from width");
assert_equals(document.body.offsetHeight, document.body.offsetWidth);
}, "body height equals width");
};
</script>
<body style="aspect-ratio: 1/1;">

0 comments on commit 9e3f14a

Please sign in to comment.