diff options
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-form-and-script-from-fragment.tentative.html')
-rw-r--r-- | testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-form-and-script-from-fragment.tentative.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-form-and-script-from-fragment.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-form-and-script-from-fragment.tentative.html new file mode 100644 index 0000000000..10351d1645 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-form-and-script-from-fragment.tentative.html @@ -0,0 +1,22 @@ +<!doctype html> +<meta charset=utf-8> +<title>Node.appendChild: inserting script and associated form</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<button id="someButton" form="someForm"></button> +<script> +test(() => { + const script = document.createElement("script"); + const form = document.createElement("form"); + form.id = "someForm"; + const fragment = new DocumentFragment(); + script.textContent = ` + window.buttonAssociatedForm = document.querySelector("#someButton").form; + `; + fragment.append(script, form); + document.body.append(fragment); + assert_equals(window.buttonAssociatedForm, form); +}, "When adding a script+form in a fragment and the form matches an associated element, " + + "the script that checks whether the button is associated to the form should run after " + + "inserting the form"); +</script> |