tor-browser

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

test-print-selection-shadow-crossing-flat-6.html (952B)


      1 <!DOCTYPE html>
      2 <html reftest-print-range="selection">
      3 <head>
      4  <meta charset="utf-8">
      5  <link id="style" href="print.css" rel="stylesheet">
      6  <script>
      7    function selectNodesInShadowTree() {
      8      // Test 6: start is in light DOM and end is a shadow node. There
      9      // is a slot element in between them and the slot element has
     10      // multiple assigned nodes.
     11      window.getSelection()
     12        .setBaseAndExtent(
     13          lightContent1.firstChild,
     14          3,
     15          host.shadowRoot.getElementById("inner").firstChild,
     16          4);
     17    }
     18  </script>
     19 </head>
     20 <body onload="selectNodesInShadowTree()">
     21  <p id="lightContent1">LightContent1</p>
     22  <div id="host">Shouldn't show up (in the shadows)
     23    <template shadowrootmode="open">
     24      <slot name="s1"></slot>
     25      <span id="inner">Inner</span>
     26    </template>
     27    <span id="slotted1" slot="s1">Slotted1</span>
     28    <span id="slotted2" slot="s1">Slotted2</span>
     29  </div>
     30 </body>
     31 </html>