mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
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.
25 lines
601 B
HTML
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>
|