wpt / css / css-contain / contain-size-block-001.html

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

/css/css-contain/contain-size-block-001.html

<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>CSS Test: 'contain: size' on block elements should cause them to be sized as if they had no contents</title>
  <link rel="author" title="Morgan Rae Reschenberg" href="mailto:mreschenberg@berkeley.edu">
  <link rel="help" href="https://drafts.csswg.org/css-contain/#containment-size">
  <link rel="match" href="contain-size-block-001-ref.html">
  <style>
  .contain {
    contain: size;
    border: 1em solid green;
    background: red;
  }
  .innerContents {
    color: transparent;
    height: 100px;
    width: 100px;
  }
  .minHeight {
    min-height: 50px;
    background: lightblue;
  }
  .height {
    height: 50px;
    background: lightblue;
  }
  .maxWidth {
    max-width: 50px;
  }
  .width {
    width: 50px;
  }
  .floatLBasic {
    float: left;
  }
  .floatLWidth {
    float: left;
    width: 50px;
  }
  .flexBaselineCheck {
    display: flex;
    align-items: baseline;
  }
  </style>
</head>
<body>
  <!--CSS Test: A size-contained block element with no specified size should render at 0 height regardless of content.-->
  <div class="contain"><div class="innerContents">inner</div></div>
  <br>

  <!--CSS Test: A size-contained block element with specified min-height should render at given min-height regardless of content.-->
  <div class="contain minHeight"><div class="innerContents">inner</div></div>
  <br>

  <!--CSS Test: A size-contained block element with specified height should render at given height regardless of content.-->
  <div class="contain height"><div class="innerContents">inner</div></div>
  <br>

  <!--CSS Test: A size-contained block element with specified max-width should render at given max-width and zero height regardless of content.-->
  <div class="contain maxWidth"><div class="innerContents">inner</div></div>
  <br>

  <!--CSS Test: A size-contained block element with specified width should render at given width and zero height regardless of content.-->
  <div class="contain width"><div class="innerContents">inner</div></div>
  <br>

  <!--CSS Test: A size-contained floated block element with no specified size should render at 0px by 0px regardless of content.-->
  <div class="contain floatLBasic"><div class="innerContents">inner</div></div>
  <br>

  <!--CSS Test: A size-contained floated block element with specified width and no specified height should render at given width and 0 height regardless of content.-->
  <div class="contain floatLWidth"><div class="innerContents">inner</div></div>
  <br>

  <!--CSS Test: A size-contained block element should perform baseline alignment regularly.-->
  <div class="flexBaselineCheck">
  outside before<div class="contain"><div class="innerContents">inner</div></div>outside after
  </div>
</body>
</html>

/css/css-contain/contain-size-block-001-ref.html

<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>CSS Reftest Reference</title>
  <link rel="author" title="Morgan Rae Reschenberg" href="mailto:mreschenberg@berkeley.edu">
  <style>
  .basic {
    border: 1em solid green;
  }
  .height-ref {
    height: 50px;
    background: lightblue;
  }
  .width-ref {
    width: 50px;
  }
  .floatLBasic-ref {
    float: left;
  }
  .floatLWidth-ref {
    float: left;
    width: 50px;
  }
  .flexBaselineCheck {
    display: flex;
    align-items: baseline;
  }
  .innerContents {
    color: transparent;
    width: 0;
    height: 0;
  }
  </style>
</head>
<body>
  <div class="basic"></div>
  <br>

  <div class="basic height-ref"></div>
  <br>

  <div class="basic height-ref"></div>
  <br>

  <div class="basic width-ref"></div>
  <br>

  <div class="basic width-ref"></div>
  <br>

  <div class="basic floatLBasic-ref"></div>
  <br>

  <div class="basic floatLWidth-ref"></div>
  <br>

  <div class="flexBaselineCheck">
  outside before<div class="basic innerContents">i</div>outside after
  </div>
</body>
</html>