script-runs-in-shadow-tree.html (716B)
1 <!doctype html> 2 <link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> 3 <link rel="author" href="https://mozilla.org" title="Mozilla"> 4 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1555949"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <div id="host"></div> 8 <script> 9 let svgScript = document.createElementNS("http://www.w3.org/2000/svg", "script"); 10 svgScript.innerHTML = "window.scriptRan = true"; 11 document.getElementById("host").attachShadow({ mode: "open" }).appendChild(svgScript); 12 test(function() { 13 assert_true(window.scriptRan); 14 }, "svg:script runs correctly in a shadow tree"); 15 </script>