wpt / css / css-sizing / abspos-auto-sizing-fit-content-percentage-006.html

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

/css/css-sizing/abspos-auto-sizing-fit-content-percentage-006.html

<!DOCTYPE html>
<link rel="author" title="Brandon Stewart" href="mailto:brandonstewart@apple.com">
<link rel="help" href="https://drafts.csswg.org/css-position-3/#abspos-auto-size">
<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#valdef-width-fit-content">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<meta name="assert" content="Absolutely positioned flex container with height: fit-content should treat percentage height flex items as indefinite, sizing to content rather than containing block height.">
<style>
.container {
  position: relative;
  width: 100px;
  height: 50px;
}

.background {
  width: 100px;
  height: 100px;
  background: red;
}

.abs {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  height: fit-content;
  width: 100px;
  background: green;
}

.child {
  height: 100%;
}

.content {
  height: 100px;
  width: 100px;
}
</style>
<p>Test passes if there is a filled green square.</p>
<div class="background">
  <div class="container">
    <div class="abs">
      <div class="child">
        <div class="content"></div>
      </div>
    </div>
  </div>
</div>

/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>