diff options
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-and-script-in-style.tentative.html')
-rw-r--r-- | testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-and-script-in-style.tentative.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-and-script-in-style.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-and-script-in-style.tentative.html new file mode 100644 index 0000000000..850af680a0 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-and-script-in-style.tentative.html @@ -0,0 +1,30 @@ +<!doctype html> +<meta charset=utf-8> +<title>Node.appendChild: inserting text and script nodes in a style element</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<style id="style"></style> +<body> +<script> +const happened = [] +const style = document.getElementById("style"); +test(() => { + const r1 = new Text("body {}"); + const r2 = new Text("body {}"); + const script = document.createElement("script"); + script.textContent = ` + happened.push(style.sheet.cssRules.length); + `; + + const df = document.createDocumentFragment(); + df.appendChild(r1); + df.appendChild(script); + df.appendChild(r2); + + assert_array_equals(happened, []); + style.appendChild(df); + assert_array_equals(happened, [2]); +}, "All style rules appended to a <style> element are inserted and " + + "script-observable to scripts inserted in the `<style>` element, by the " + + "time scripts execute after DOM insertions."); +</script> |