module.html (734B)
1 <!doctype html> 2 <meta charset=utf-8> 3 <title>document.write in a module</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <div id="log"></div> 7 <script> 8 async_test(t => { 9 const iframe = document.createElement("iframe"); 10 11 iframe.onerror = t.unreached_func("Error loading iframe"); 12 document.addEventListener("documentWriteDone", t.step_func(() => { 13 assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n"); 14 })); 15 iframe.onload = t.step_func_done(() => { 16 assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n"); 17 }); 18 19 iframe.src = "module-iframe.html"; 20 document.body.appendChild(iframe); 21 }); 22 </script>