cssom-prefix-suffix-setter-invalid.html (918B)
1 <!DOCTYPE html> 2 <title>CSSCounterStyleRule prefix and suffix setters with invalid values</title> 3 <link rel="help" href="https://www.w3.org/TR/css-counter-styles-3/#the-csscounterstylerule-interface"> 4 <link rel="author" href="mailto:xiaochengh@chromium.org"> 5 <link rel="match" href="cssom-prefix-suffix-setter-ref.html"> 6 <style id="sheet"> 7 @counter-style foo { 8 system: cyclic; 9 symbols: A B C; 10 prefix: '('; 11 suffix: ')'; 12 } 13 </style> 14 15 <ol style="list-style-type: foo; list-style-position: inside"> 16 <li></li> 17 <li></li> 18 <li></li> 19 </ol> 20 21 <script> 22 // Force layout update before changing the rule 23 document.body.offsetWidth; 24 25 const sheet = document.getElementById('sheet'); 26 const foo_rule = sheet.sheet.rules[0]; 27 28 // Invalid values should be ignored 29 foo_rule.prefix = '"(" "("'; 30 foo_rule.prefix = ')'; 31 foo_rule.prefix = '123'; 32 33 foo_rule.suffix = '")" ")"'; 34 foo_rule.suffix = '('; 35 foo_rule.suffix = '456'; 36 </script>