tor-browser

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

serialization.html (949B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4    <title>CSS Shadow Parts - Serialization</title>
      5    <link href="https://drafts.csswg.org/css-shadow-parts/" rel="help">
      6    <script src="/resources/testharness.js"></script>
      7    <script src="/resources/testharnessreport.js"></script>
      8  </head>
      9  <body>
     10    <style id="styleElement">
     11      ::part(\(foo) {}
     12      ::part(   bar\    ) {}
     13      ::part( -foo  bar    ) {}
     14    </style>
     15    <script>
     16      "use strict";
     17      const rules = styleElement.sheet.cssRules;
     18      test(function() {
     19        assert_equals(rules[0].selectorText, "::part(\\(foo)");
     20      }, "Escape start parenthesis in ::part name.");
     21      test(function() {
     22        assert_equals(rules[1].selectorText, "::part(bar\\ )");
     23      }, "Escape start space in ::part name.");
     24      test(function() {
     25        assert_equals(rules[2].selectorText, "::part(-foo bar)");
     26      }, "Collapse spaces in ::part names list.");
     27    </script>
     28  </body>
     29 </html>