Skip to content

Commit

Permalink
Bug 1638189 [wpt PR 23625] - [AspectRatio] aspect-ratio should apply …
Browse files Browse the repository at this point in the history
…even with width:auto;height:auto;, a=testonly

Automatic update from web-platform-tests
[AspectRatio] aspect-ratio should apply even with width:auto;height:auto;

See discussion in w3c/csswg-drafts#5060

R=ikilpatrick@chromium.org

Fixed: 1082479
Change-Id: Ic1f47a5ba92cdbff96ce0b1d60e9741c1051c291
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2202691
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#769360}

--

wpt-commits: bbf1f57cc2539e68e1a8d56685d2cae2eda9cc81
wpt-pr: 23625
  • Loading branch information
cbiesinger authored and moz-wptsync-bot committed May 25, 2020
1 parent 550a685 commit 99b1404
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>
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 99b1404

Please sign in to comment.