tor-browser

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

content-invalid.html (2342B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <title>CSS Content Module Level 3: Invalid parsing</title>
      6 <link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
      7 <link rel="help" href="https://drafts.csswg.org/css-content-3/#content-property">
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 <script src="/css/support/parsing-testcommon.js"></script>
     11 </head>
     12 <body>
     13 <div id="target"></div>
     14 <script>
     15 function test_invalid_value_combinations(property, value) {
     16    test_invalid_value(property, value);
     17    test_invalid_value(property, `${value} / "alt text"`);
     18 }
     19 
     20 function test_invalid_value_alt_text(property, value) {
     21    test_invalid_value(property, `${value} / url("https://www.example.com/picture.svg")`);
     22    test_invalid_value(property, `${value} / no-open-quote`);
     23    test_invalid_value(property, `${value} / no-close-quote`);
     24    test_invalid_value(property, `${value} / "hi" no-close-quote`);
     25 }
     26 
     27 test_invalid_value_combinations("content", `attr()`);
     28 test_invalid_value_combinations("content", `counters(counter-name)`);
     29 test_invalid_value_combinations("content", `counter()`);
     30 
     31 test_invalid_value_alt_text("content", "open-quote");
     32 test_invalid_value_alt_text("content", "close-quote");
     33 test_invalid_value_alt_text("content", "no-open-quote");
     34 test_invalid_value_alt_text("content", "no-close-quote");
     35 
     36 test_invalid_value_alt_text("content", "counter(counter-name)");
     37 test_invalid_value_alt_text("content", "counter(counter-name, counter-style)");
     38 
     39 test_invalid_value_alt_text("content", `counters(counter-name, ".")`);
     40 test_invalid_value_alt_text("content", `counters(counter-name, ".", counter-style)`);
     41 
     42 test_invalid_value_alt_text("content", `url("https://www.example.com/picture.svg")`);
     43 
     44 test_invalid_value_alt_text("content", `"hello"`);
     45 
     46 test_invalid_value_alt_text("content", `"hello" "world"`);
     47 test_invalid_value_alt_text("content", `counter(counter-name) "potato"`);
     48 test_invalid_value_alt_text("content", `counters(counter-name, ".") "potato"`);
     49 test_invalid_value_alt_text("content", `"(" counters(counter-name, ".", counter-style) ")"`);
     50 test_invalid_value_alt_text("content", `open-quote "hello" "world" close-quote`);
     51 test_invalid_value_alt_text("content", `url("https://www.example.com/picture.svg") "hello"`);
     52 </script>
     53 </body>
     54 </html>