Truly independent web browser
<!doctype html>
<html class="reftest-wait">
<link rel="match" href="../expected/wrapped-inline-paint-order-ref.html">
<link rel="stylesheet" href="../data/fonts/ahem.css">
<style>
body { margin: 40px; font: 20px/20px Ahem; }
div { width: 100px; margin-bottom: 60px; }
span { border: 2px solid black; background: lightgray; padding: 10px; }
.atomic { display: inline-block; width: 60px; height: 20px; background: blue; }
</style>
<div><span>XXX XXX</span></div>
<div><span style="position: relative">XXX XXX</span></div>
<div><span style="opacity: .5">XXX XXX</span></div>
<div><i class="atomic"></i><br><span>XXX</span></div>
<div><span>XXX</span><br><i class="atomic"></i></div>
<script>
const nextPaint = () => new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));
(async () => {
await document.fonts.ready;
await nextPaint();
// Rebuild the line pieces, then change an atomic inline's stacking context.
document.querySelectorAll("div").forEach(div => div.style.width = "200px");
await nextPaint();
document.querySelectorAll("div").forEach(div => div.style.width = "100px");
document.querySelector(".atomic").style.opacity = ".5";
await nextPaint();
document.querySelector(".atomic").style.opacity = "1";
await nextPaint();
document.documentElement.classList.remove("reftest-wait");
})();
</script>