wpt / css / css-anchor-position / anchor-position-multicol-003.html

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

/css/css-anchor-position/anchor-position-multicol-003.html

<!DOCTYPE html>
<title>Tests anchors on out-of-flow boxes</title>
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/#determining">
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/#propdef-anchor-name">
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/#anchor-size">
<link rel="author" href="mailto:kojii@chromium.org">
<link rel="author" href="mailto:mstensho@chromium.org">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<style>
.relpos {
  position: relative;
}
.columns {
  columns: 2;
  column-fill: auto;
  column-gap: 10px;
  width: 170px;
  height: 50px;
}
.anchor1 {
  anchor-name: --a1;
  position: absolute;
  width: 10px;
  height: 30px;
  background: red;
}
.target {
  position: absolute;
  left: anchor(--a1 left);
  top: anchor(--a1 top);
  width: anchor-size(--a1 width);
  height: anchor-size(--a1 height);
}
.target::before {
  position: absolute;
  content: "";
  background: green;
}
.first {
  .target.inside::before {
    width: 100%;
    height: 100%;
  }
}
.second {
  .target.inside::before {
    width: 100%;
    height: 50%;
  }
  .target.inside.part2::before {
    top: 50%;
  }
}
.target.outside::before {
  width: calc(50% - 10px);
  height: 100%;
}
.target.outside.part1::before {
  left: 10px;
}
.target.outside.part2::before {
  right: 10px;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="width:100px; height:100px; background:red;">
  <div class="relpos first">
    <div class="columns">
      <div class="relpos">
        <div style="width:10px; height:30px; background:green;"></div>
        <div class="anchor1"></div>
        <div style="height:30px;"></div>
        <div style="width:10px; height:40px; background:green;"></div>
        <div class="target inside"></div>
      </div>
      <div class="target outside part1"></div>
    </div>
    <div class="target outside part2"></div>
  </div>
  <div class="relpos second">
    <div class="columns">
      <div style="width:10px; height:10px; background:green;"></div>
      <div class="relpos">
        <div style="width:10px; height:10px; background:green;"></div>
        <div class="relpos">
          <div style="width:10px; height:10px; background:green;"></div>
          <div class="anchor1"></div>
          <div style="height:30px;"></div>
          <div style="width:10px; height:40px; background:green;"></div>
          <div class="target inside part1"></div>
        </div>
        <div class="target inside part2"></div>
      </div>
      <div class="target outside part1"></div>
    </div>
    <div class="target outside part2"></div>
  </div>
</div>

/css/reference/ref-filled-green-100px-square.xht

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>CSS Reftest Reference</title>
  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
  <style type="text/css"><![CDATA[
  div
  {
  background-color: green;
  height: 100px;
  width: 100px;
  }
  ]]></style>
 </head>
 <body>
  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
  <div></div>
 </body>
</html>