LibWeb: Wait for initial navigation to complete before modifying iframe

If initial src of an iframe is "about:blank", it does synchronous
navigation that is not supposed to be interleaved by other navigation
or usage of Document.open().

Fixes crashing in navigation on https://twinings.co.uk/
This commit is contained in:
Aliaksandr Kalenik 2024-04-08 05:36:02 +02:00 committed by Andreas Kling
commit a3149c1ce9
Notes: sideshowbarker 2024-07-17 03:05:16 +09:00
5 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<body></body>
<script>
const iframe = document.createElement("iframe");
document.body.appendChild(iframe);
const iframeDocument = iframe.contentDocument;
iframeDocument.open();
iframeDocument.write(
"<!DOCTYPE html><html><head><title>Iframe Content</title></head><body>"
);
iframeDocument.write("<h1>Hello</h1>");
iframeDocument.write("<p>from iframe</p>");
iframeDocument.write("</body></html>");
iframeDocument.close();
test(() => {
println("PASS (didn't crash)");
})
</script>