ladybird/Tests/LibWeb/Text/input/DOM/ChildNode-before-previous-sibling.html
Andreas Kling 35f359c51c LibWeb: Fix infinite loop in ChildNode's before() and after()
The loop that was supposed to check the chain of previous or next
siblings had a logic mistake where it would never traverse the chain,
so we would get stuck looking at the immediate sibling forever.
2024-03-11 18:29:10 +01:00

13 lines
423 B
HTML

<script src="../include.js"></script>
<div id="one"></div><div id="two"></div><script>
test(() => {
let one = document.getElementById("one");
let two = document.getElementById("two");
two.before(one);
printElement(one);
printElement(one.nextSibling);
printElement(two);
printElement(two.previousSibling);
println("PASS (didn't crash)");
});
</script>