Files
ladybird/Tests/LibWeb/Text/input/regress/microtask-checkpoint-reentrancy-via-responsexml-script.html
Jonathan Gamble d065f6bf00 LibWeb: Perform a microtask checkpoint - VERIFY after reentrancy return
The HTML event loop spec explicitly provides guidance for reentrancy in
the "perform a microtask checkpoint" algorithm, so we cannot VERIFY
for empty execution context before this early exit (as much as we'd
like to).

https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint

See the microtask-checkpoint-reentrancy-via-responsexml-script test for
an example of how this can happen from user scripts.
2026-02-19 08:12:31 +01:00

25 lines
601 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
asyncTest(done => {
const xhr = new XMLHttpRequest();
xhr.responseType = "document";
xhr.open(
"GET",
"data:text/xml,<root xmlns:h='http://www.w3.org/1999/xhtml'><h:script>void 0</h:script></root>",
true
);
xhr.addEventListener("load", () => {
queueMicrotask(() => {
void xhr.responseXML;
println("PASS (didn't crash)");
done();
});
});
xhr.send();
});
</script>