Skip to content

Commit 42c8629

Browse files
committed
Fix patch marker node type assertion and global cleanup in stream-html-reentrancy.html
1 parent a85ae24 commit 42c8629

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

‎domparsing/stream-html-reentrancy.html‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,18 @@
3838
// Globals set by streamed scripts, deleted after each test so a later test
3939
// can't pass on values left by an earlier one.
4040
function delete_script_globals() {
41-
for (const name of ["ids_at_script", "ids_at_rest", "abort_promise", "write_promise", "close_promise"]) {
41+
for (const name of [
42+
"ids_at_script",
43+
"ids_at_rest",
44+
"abort_promise",
45+
"write_promise",
46+
"close_promise",
47+
"resolve_abort",
48+
"reaction_log",
49+
"rest_parsed",
50+
"close_settled",
51+
"close_settled_at_rest",
52+
]) {
4253
delete window[name];
4354
}
4455
}
@@ -385,11 +396,12 @@
385396
await after_task(t);
386397
assert_array_equals(window.events, ["slow"]);
387398
assert_equals(connections, 2, "foster-parented formatting element connectedCallback ran");
388-
const comments = Array.from(target.querySelector("#patched").childNodes)
389-
.filter((n) => n.nodeType === Node.COMMENT_NODE)
390-
.map((n) => n.data);
391-
assert_array_equals(comments, ['?start name="m"', "?end"],
399+
const markers = Array.from(target.querySelector("#patched").childNodes)
400+
.filter((n) => n.nodeType === Node.PROCESSING_INSTRUCTION_NODE)
401+
.map((n) => `${n.target}:${n.data}`);
402+
assert_array_equals(markers, ['start:name="m"', "end:"],
392403
"</template> must not remove patch markers after abort in table text");
404+
assert_equals(target.querySelector("#patched").textContent, "Old");
393405
await failOnTimeout(abortPromise);
394406
await promise_rejects_exactly(t, "aborted-in-table-text", writer.closed);
395407
}, `${method}: abort() from a foster-parented custom element reaction in table text prevents reprocessing </template>`);

0 commit comments

Comments
 (0)