DocumentFragment-constructor.html (726B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>DocumentFragment constructor</title> 4 <link rel="help" href="https://dom.spec.whatwg.org/#dom-documentfragment-documentfragment"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 8 <script> 9 "use strict"; 10 11 test(() => { 12 const fragment = new DocumentFragment(); 13 assert_equals(fragment.ownerDocument, document); 14 }, "Sets the owner document to the current global object associated document"); 15 16 test(() => { 17 const fragment = new DocumentFragment(); 18 const text = document.createTextNode(""); 19 fragment.appendChild(text); 20 assert_equals(fragment.firstChild, text); 21 }, "Create a valid document DocumentFragment"); 22 </script>