diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-source-from-fragment.tentative.html | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-source-from-fragment.tentative.html')
-rw-r--r-- | testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-source-from-fragment.tentative.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-source-from-fragment.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-source-from-fragment.tentative.html new file mode 100644 index 0000000000..7f93ac43bd --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-source-from-fragment.tentative.html @@ -0,0 +1,33 @@ +<!doctype html> +<meta charset=utf-8> +<title>Node.appendChild: inserting script and source from a fragment</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<video id="media"></video> +<script> +const happened = []; +const media = document.getElementById("media"); +test(() => { + const source = document.createElement("source"); + const script = document.createElement("script"); + script.textContent = ` + happened.push(media.networkState); + `; + + const df = document.createDocumentFragment(); + df.appendChild(script); + df.appendChild(source); + + assert_array_equals(happened, []); + media.appendChild(df); + // This is because immediately during DOM insertion, before the + // post-insertion steps invoke script, `<source>` insertion invokes the + // resource selection algorithm [1] which does this assignment. This + // assignment takes place before earlier-inserted script elements run + // post-insertion. + // + // [1]: https://html.spec.whatwg.org/#concept-media-load-algorithm + assert_array_equals(happened, [HTMLMediaElement.NETWORK_NO_SOURCE]); +}, "Empty <source> immediately sets media.networkState during DOM insertion, " + + "so that an earlier-running script can observe networkState"); +</script> |