Skip to content

Truly independent web browser

1.1 KB
Raw Blame
<!DOCTYPE html>
<head>
     <link rel="match" href="../expected/ol-render-node-insert-first-group-ref.html" />
</head>
<html class="reftest-wait">
<body>
<ol id="ol1">
    <li id="three">Three</li>
    <li>Four</li>
</ol>
<ol reversed id="ol2">
    <li id="two">Two</li>
    <li>One</li>
</ol>
<script>
    // Two nested requestAnimationFrame() calls to force code execution _after_ initial paint
    requestAnimationFrame(() => {
      requestAnimationFrame(() => {
        const ol1 = document.getElementById("ol1");
        const three = document.getElementById("three");

        const ol2 = document.getElementById("ol2");
        const two = document.getElementById("two");

        const div1 = document.createElement("div");
        div1.innerHTML = "<li>One</li><li>Two</li>";

        const div2 = document.createElement("div");
        div2.innerHTML = "<li>Four</li><li>Three</li>";

        ol1.insertBefore( div1, three );
        ol2.insertBefore( div2, two );

        document.documentElement.classList.remove("reftest-wait");
      });
    });
</script>
</body>
</html>