tor-browser

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

nth-child-of-in-shadow-root.html (713B)


      1 <!DOCTYPE html>
      2 <title>CSS Selectors Invalidation: :nth-child(... of class) within shadow root</title>
      3 <link rel="author" title="Steinar H. Gunderson" href="sesse@chromium.org">
      4 <link rel="match" href="nth-child-of-in-shadow-root-ref.html">
      5 <link rel="help" href="https://drafts.csswg.org/selectors-4/#child-index">
      6 <div id="host">
      7  <template shadowrootmode="open">
      8    <style>
      9      div:nth-child(even of .foo) {
     10        color: green;
     11      }
     12    </style>
     13    <div class="foo" id="toggler">No green</div>
     14    <div class="foo">No green</div>
     15    <div class="foo">Should be green</div>
     16  </template>
     17 </div>
     18 <script>
     19  host.offsetTop;
     20  host.shadowRoot.getElementById('toggler').classList.toggle('foo');
     21 </script>