tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

cross-shadow-boundary-select-root.html (740B)


      1 <!doctype html>
      2 <head>
      3 <link rel=match href="cross-shadow-boundary-select-root-ref.html">
      4 </head>
      5 <div id="outerText1">OuterText1</div>
      6 <div id="host1"></div>
      7 <div id="outerText2">OuterText2</div>
      8 <div id="host2"></div>
      9 <div id="host3"></div>
     10 <script>
     11  const outerText1 = document.getElementById("outerText1");
     12  const outerText2 = document.getElementById("outerText2");
     13 
     14  const host1 = document.getElementById("host1");
     15  const root1 = host1.attachShadow({mode: "open"});
     16  root1.innerHTML = "InnerText1";
     17 
     18  const host2 = document.getElementById("host2");
     19  const root2 = host2.attachShadow({mode: "open"});
     20  root2.innerHTML = "InnerText2";
     21 
     22  getSelection().setBaseAndExtent(outerText1, 0, root2, root2.childNodes.length);
     23 </script>