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.
25 lines
938 B
HTML
25 lines
938 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
let events = [];
|
|
customElements.define("reentrant-writer", class extends HTMLElement {
|
|
connectedCallback() {
|
|
events.push("connected");
|
|
document.write("<span id='written'>written</span>");
|
|
}
|
|
});
|
|
document.write("<reentrant-writer id='host'></reentrant-writer>");
|
|
</script>
|
|
<script>
|
|
test(() => {
|
|
let host = document.getElementById("host");
|
|
let written = document.getElementById("written");
|
|
println(events.join(","));
|
|
println(`written parent: ${written.parentElement.localName}`);
|
|
println(`host child count: ${host.childNodes.length}`);
|
|
let bodyChildren = Array.from(document.body.children)
|
|
.filter(element => element.id !== "out")
|
|
.map(element => element.localName);
|
|
println(`body children: ${bodyChildren.join(",")}`);
|
|
});
|
|
</script>
|