tor-browser

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

at-position-try-parse.html (1477B)


      1 <!DOCTYPE html>
      2 <title>CSS Anchor Positioning Test: parsing of @position-try rules</title>
      3 <link rel="help" href="https://drafts.csswg.org/css-anchor-1/#fallback-rule">
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/css/support/parsing-testcommon.js"></script>
      7 <script>
      8 test_valid_rule('@position-try --foo { }');
      9 test_valid_rule(`@position-try --foo { top: 1px; }`);
     10 
     11 // @position-try needs exactly one <dashed-ident> as its name
     12 test_invalid_rule('@position-try { }');
     13 test_invalid_rule('@position-try foo { }');
     14 test_invalid_rule('@position-try --foo --bar { }');
     15 test_invalid_rule('@position-try --foo, --bar { }');
     16 
     17 // @position-try only accepts a limited set of properties.
     18 test_valid_rule('@position-try --foo { backround-color: green; }',
     19                '@position-try --foo { }');
     20 
     21 // @position-try accepts only regular style declarations. Other
     22 // contents should be ignored.
     23 test_valid_rule('@position-try --foo { @keyframes bar {} }',
     24                '@position-try --foo { }');
     25 test_valid_rule('@position-try --foo { @font-face {} }',
     26                '@position-try --foo { }');
     27 test_valid_rule('@position-try --foo { @media print {} }',
     28                '@position-try --foo { }');
     29 test_valid_rule('@position-try --foo { & {} }',
     30                '@position-try --foo { }');
     31 test_valid_rule('@position-try --foo { arbitrary garbage }',
     32                '@position-try --foo { }');
     33 
     34 </script>