summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-in-script.tentative.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-in-script.tentative.html')
-rw-r--r--testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-in-script.tentative.html24
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-in-script.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-in-script.tentative.html
new file mode 100644
index 0000000000..4d6543695c
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-in-script.tentative.html
@@ -0,0 +1,24 @@
+<!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>