summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/nodes/DocumentFragment-querySelectorAll-after-modification.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/DocumentFragment-querySelectorAll-after-modification.html')
-rw-r--r--testing/web-platform/tests/dom/nodes/DocumentFragment-querySelectorAll-after-modification.html24
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/DocumentFragment-querySelectorAll-after-modification.html b/testing/web-platform/tests/dom/nodes/DocumentFragment-querySelectorAll-after-modification.html
new file mode 100644
index 0000000000..8049363885
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/DocumentFragment-querySelectorAll-after-modification.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>querySelectorAll should still work on DocumentFragments after they are modified</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<!-- Regression test for https://github.com/jsdom/jsdom/issues/2290 -->
+
+<script>
+"use strict";
+
+setup({ single_test: true });
+
+const frag = document.createDocumentFragment();
+frag.appendChild(document.createElement("div"));
+
+assert_array_equals(frag.querySelectorAll("img"), [], "before modification");
+
+frag.appendChild(document.createElement("div"));
+
+// If the bug is present, this will throw.
+assert_array_equals(frag.querySelectorAll("img"), [], "after modification");
+
+done();
+</script>