wpt / css / css-sizing / image-max-width-and-height-behaves-as-auto.html

Status: PASS | Duration: 8ms | Subtests: 1/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-sizing/image-max-width-and-height-behaves-as-auto.html

<!DOCTYPE html>
<html>
<head>
<link rel="help" href="https://www.w3.org/TR/CSS22/visudet.html#min-max-widths">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio-size-transfers">
<meta name="assert" content="When computed logical width is auto, computed logical height behaves as auto,
the used logical height should be determined with respect to any max logical width constraint.">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<style>
.container {
  width: 100px;
}
img {
  max-width: 100%;
  height: 100%;
}
</style>
</head>
<body>
  <p>Test passes if there is a filled green square.</p>
  <div class="container">
    <img src="aspect-ratio/support/200x200-green.png"/>
  </div>
</body>
</html>

/css/reference/ref-filled-green-100px-square-only.html

<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<p>Test passes if there is a filled green square.</p>
<div style="width:100px; height:100px; background:green;"></div>