tor-browser

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

cross-shadow-boundary-slot-2.html (601B)


      1 <!doctype html>
      2 <head>
      3 <link rel="match" href="cross-shadow-boundary-slot-1-ref.html"/>
      4 </head>
      5 <span id="outer">Outer</span>
      6 <div>
      7  <span id="slotted">Slotted</span>
      8  <template shadowrootmode="open">
      9    <slot></slot>
     10    <span>Inner</span>
     11  </template>
     12 </div>
     13 <script>
     14  // Selected contents are:
     15  //   er
     16  //   Slot Inner
     17  // In shadow including order, the shadow root is always before
     18  // the light DOM elements, so setting the endpoint to "Slot" causes
     19  // the "Inner" to be selected.
     20  window.getSelection()
     21      .setBaseAndExtent(outer.firstChild, 3, slotted.firstChild, 4);
     22 </script>