Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>Anchor name resolution of OOF anchors in multicol</title>
<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>