ladybird/Tests/LibWeb/Text/input/HTML/document-write-after-close.html
Andreas Kling 54879bc916 LibWeb: Complete Rust HTML tree construction
Finish the Rust implementation of the spec tree-construction algorithms
needed by the LibWeb test suite. Add the remaining table modes, foster
parenting, scope helpers, adoption agency handling, ruby/list/form and
select cases, frameset state, foreign-content edge cases, and parser
host callbacks.

Preserve behavior that depends on the C++ DOM integration, including
parser-created custom element reactions, fragment quirks mode, arbitrary
fragment namespaces, template fragment mode, fragment form ownership,
MathML annotation-xml boundaries, contextual fragment scripts, parser
script source positions, document.close() parser state, void-element
insertion, and duplicate attribute tracking.

Add focused tests for the parser edge cases that are easy to regress at
the boundary between the Rust tree builder and the C++ DOM host.
2026-05-17 15:35:56 +02:00

18 lines
647 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
test(() => {
let iframe = document.createElement("iframe");
document.body.appendChild(iframe);
let frameDocument = iframe.contentDocument;
frameDocument.open();
frameDocument.write("<p id=closed>closed</p>");
frameDocument.close();
frameDocument.write("<span id=after>after</span>");
let reopened = frameDocument.getElementById("closed") === null
&& frameDocument.getElementById("after") !== null;
println(`document.write after document.close reopens document: ${reopened}`);
});
</script>