not-in-shadow-tree.html (1134B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Meta refresh only applies while in the document tree, not in a shadow tree</title> 4 <meta name="timeout" content="long" /> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#pragma-directives"> 8 9 <div id="log"></div> 10 <script> 11 "use strict"; 12 setup({ single_test: true }); 13 14 const iframe = document.createElement("iframe"); 15 iframe.src = "support/ufoo"; 16 17 let loadCount = 0; 18 19 iframe.onload = () => { 20 ++loadCount; 21 const iDocument = iframe.contentDocument; 22 23 if (loadCount === 1) { 24 const div = iDocument.createElement("div"); 25 assert_true('attachShadow' in div, 'attachShadow support'); 26 const shadowRoot = div.attachShadow({ mode: "open" }); 27 shadowRoot.innerHTML = `<meta http-equiv="refresh" content="1; url=foo">`; 28 iDocument.body.appendChild(div); 29 30 // Want to make sure no refreshes happen 31 step_timeout(done, 3000); 32 } else { 33 assert_unreached("Got more than 1 load event"); 34 } 35 }; 36 37 document.body.appendChild(iframe); 38 </script>