prefix-suffix-syntax.html (1553B)
1 <!DOCTYPE html> 2 <link rel="help" href="https://drafts.csswg.org/css-counter-styles-3/#counter-style-prefix"> 3 <link rel="help" href="https://drafts.csswg.org/css-counter-styles-3/#counter-style-suffix"> 4 <link rel="author" href="mailto:xiaochengh@chromium.org"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="support/counter-style-testcommon.js"></script> 8 <script> 9 function test_valid_prefix_suffix(value, expected) { 10 test_valid_counter_style_descriptor('prefix', value, expected); 11 test_valid_counter_style_descriptor('suffix', value, expected); 12 } 13 14 function test_invalid_prefix_suffix(value) { 15 test_invalid_counter_style_descriptor('prefix', value); 16 test_invalid_counter_style_descriptor('suffix', value); 17 } 18 19 // <symbol> 20 // <symbol> = <string> | <image> | <custom-ident> 21 22 // string values 23 test_valid_prefix_suffix('"string"'); 24 test_valid_prefix_suffix('"initial"'); 25 test_valid_prefix_suffix('"inherit"'); 26 test_valid_prefix_suffix('"unset"'); 27 28 // custom-ident values 29 test_valid_prefix_suffix('custom-ident') 30 test_invalid_prefix_suffix('initial'); 31 test_invalid_prefix_suffix('inherit'); 32 test_invalid_prefix_suffix('unset'); 33 34 // image values 35 test_valid_prefix_suffix('url("https://example.com/foo.png")'); 36 test_valid_prefix_suffix('url(https://example.com/foo.png)', 'url("https://example.com/foo.png")'); 37 test_valid_prefix_suffix('linear-gradient(yellow, blue)'); 38 39 // Must be exactly one symbol 40 test_invalid_prefix_suffix(''); 41 test_invalid_prefix_suffix('foo bar'); 42 43 </script>