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

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

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

<!DOCTYPE html>
<title>Anchor name resolution of OOF anchors in multicol</title>
<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="anchor-name-multicol-003-ref.html">
<style>
.relpos {
  position: relative;
}
.abspos {
  position: absolute;
}
.columns {
  columns: 6;
  column-fill: auto;
  column-gap: 10px;
  width: 170px;
  height: 50px;
}
.spacer {
  height: 10px;
}
.anchor {
  anchor-name: --a1;
  margin-left: 10px;
  width: 10px;
}
.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;
  background: green;
  content: "";
}
.target.inside::before {
  width: 100%;
  height: 50%;
}
.target.outside::before {
  width: 20px;
  height: 100%;
}
.target.inside.part2::before {
  top: 50%;
}
.target.outside.part1::before {
  left: 10px;
}
.target.outside.part2::before {
  right: 10px;
}
.filler > .background {
  background: green;
}
</style>
<!-- All targets should find the abspos anchor -->
<p>There should be a green rectangle below, no red.</p>
<div class="relpos">
  <div class="columns relpos">
    <div class="relpos">
      <div class="relpos">
        <div class="spacer"></div>
        <div class="anchor" style="height:60px;"></div>
        <div style="height:30px;"></div>
        <div class="filler" style="width:30px; height:150px; background:red;">
          <div style="width:20px; height:20px;" class="background"></div>
          <div style="width:10px; height:30px;" class="background"></div>
          <div style="height:50px;"></div>
          <div style="margin-left:auto; width:10px; height:20px;" class="background"></div>
          <div style="margin-left:auto; width:20px; height:30px;" class="background"></div>
        </div>
        <div class="anchor abspos" style="top:120px; height:100px;"></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>

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

<!DOCTYPE html>
<title>Anchor name resolution of OOF anchors in multicol</title>
<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">
<p>There should be a green rectangle below, no red.</p>
<div style="margin-left:60px; width:90px; height:50px; background:green;"></div>