tor-browser

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

host-stylesheet.html (1238B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4    <title>CSS Shadow Parts - Host Stylesheet</title>
      5    <meta href="mailto:fergal@chromium.org" rel="author" title="Fergal Daly">
      6    <link href="http://www.google.com/" rel="author" title="Google">
      7    <link href="https://drafts.csswg.org/css-shadow-parts/" rel="help">
      8    <script src="/resources/testharness.js"></script>
      9    <script src="/resources/testharnessreport.js"></script>
     10    <script src="support/shadow-helper.js"></script>
     11  </head>
     12  <body>
     13    <script>installCustomElement("custom-element", "custom-element-template");</script>
     14    <template id="custom-element-template">
     15      <style>
     16        ::part(partp) { color: red; }
     17        span { color: green; }
     18      </style>
     19      <span id="part" part="partp">This text</span>
     20    </template>
     21    The following text should be green:
     22    <custom-element id="c-e"></custom-element>
     23    <script>
     24      "use strict";
     25      const colorGreen = "rgb(0, 128, 0)";
     26      test(function() {
     27        const el = getElementByShadowIds(document, ["c-e", "part"]);
     28        assert_equals(window.getComputedStyle(el).color, colorGreen);
     29      }, "Part in selected host is not styled by ::part in a stylesheet inside the host");
     30    </script>
     31  </body>
     32 </html>