DocumentFragment-querySelectorAll-after-modification.html (734B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>querySelectorAll should still work on DocumentFragments after they are modified</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <!-- Regression test for https://github.com/jsdom/jsdom/issues/2290 --> 7 8 <script> 9 "use strict"; 10 11 setup({ single_test: true }); 12 13 const frag = document.createDocumentFragment(); 14 frag.appendChild(document.createElement("div")); 15 16 assert_array_equals(frag.querySelectorAll("img"), [], "before modification"); 17 18 frag.appendChild(document.createElement("div")); 19 20 // If the bug is present, this will throw. 21 assert_array_equals(frag.querySelectorAll("img"), [], "after modification"); 22 23 done(); 24 </script>