1
0
Fork 0
firefox/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-in-script.tentative.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

24 lines
892 B
HTML

<!doctype html>
<meta charset=utf-8>
<title>Node.appendChild: inserting two text nodes in an empty script</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<body>
<script id="script"></script>
<script>
const happened = [];
test(() => {
const script = document.getElementById("script");
const df = document.createDocumentFragment();
df.appendChild(new Text("happened.push('t1');"));
df.appendChild(new Text("happened.push('t2');"));
assert_array_equals(happened, []);
script.appendChild(df);
assert_array_equals(happened, ["t1", "t2"]);
// At this point it's already executed so further motifications are a no-op
script.appendChild(new Text("happened.push('t3');"));
script.textContent = "happened.push('t4');"
script.text = "happened.push('t5');"
assert_array_equals(happened, ["t1", "t2"]);
});
</script>