Truly independent web browser
<!doctype html>
<html class="reftest-wait">
<link rel="match" href="../expected/inline-level-capture-phase-transitions-ref.html">
<style>
body { margin: 0; }
#box { position: relative; display: inline-block; vertical-align: top; width: 80px; height: 60px; background: lime; }
#float { float: left; width: 20px; height: 20px; background: blue; }
#positioned { position: absolute; left: 30px; top: 10px; width: 10px; height: 10px; background: red; }
#after { display: inline-block; vertical-align: top; width: 20px; height: 20px; background: orange; }
svg { display: inline-block; vertical-align: top; background: navy; }
</style>
<div id="box"><div id="float"></div><div id="positioned"></div></div><div id="after"></div><svg width="40" height="40"><rect x="10" y="10" width="20" height="20" fill="lime" /></svg>
<script>
const nextPaint = () => new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));
(async () => {
await nextPaint();
// Populate captures in different phases, then return to the inline-level phase.
for (const display of ["block", "inline-table", "inline-block"]) {
document.getElementById("box").style.display = display;
await nextPaint();
}
// Invalidate an enclosing capture after the final layout has been recorded.
document.body.style.outline = "1px solid transparent";
document.documentElement.classList.remove("reftest-wait");
})();
</script>