wpt / css / css-flexbox / flex-aspect-ratio-resize-001.html

Status: FAIL | Duration: 31ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-flexbox/flex-aspect-ratio-resize-001.html

<!DOCTYPE html>
<title>Flex item with aspect-ratio updates height correctly on container resize</title>
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#algo-stretch">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<link rel="match" href="flex-aspect-ratio-resize-001-ref.html">
<style>
.container {
  display: flex;
  width: 500px;
}

.wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: green;
}

.image {
  display: block;
  width: 100%;
  height: 100%;
}
</style>
<p>Test passes if there is a 200x200 green square with no red.</p>
<div id="container" class="container" style="background: red;">
  <div class="wrapper">
    <img src="../support/1x1-green.png" class="image">
  </div>
</div>
<script>
document.body.offsetHeight;
document.getElementById("container").style.width = "200px";
</script>

/css/css-flexbox/flex-aspect-ratio-resize-001-ref.html

<!DOCTYPE html>
<title>Reference</title>
<style>
.ref {
  width: 200px;
  height: 200px;
  background: green;
}
</style>
<p>Test passes if there is a 200x200 green square with no red.</p>
<div class="ref"></div>