| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <style> | |
| 4 body { | |
| 5 counter-reset: section; | |
| 6 } | |
| 7 h1 { | |
| 8 counter-increment: section; | |
| 9 } | |
| 10 h2:before { | |
| 11 content: counter(section); | |
| 12 } | |
| 13 h2:after { | |
| 14 content: counters(section, ":", decimal); | |
| 15 } | |
| 16 h3:before { | |
| 17 content: counter(section, lower-roman); | |
| 18 } | |
| 19 h3:after { | |
| 20 content: counters(section, ",", upper-roman); | |
| 21 } | |
| 22 h3:before { | |
| 23 content: counter(section, none); | |
| 24 } | |
| 25 </style> | |
| 26 <script src="../../../resources/js-test.js"></script> | |
| 27 </head> | |
| 28 <body> | |
| 29 <script> | |
| 30 description("Test the Counter object returned by the getCounterValue method of C
SSPrimitiveValues"); | |
| 31 | |
| 32 function getCounter(cssRule) { | |
| 33 return cssRule.style.getPropertyCSSValue('content')[0].getCounterValue(); | |
| 34 } | |
| 35 | |
| 36 var rules = document.styleSheets[0].cssRules; | |
| 37 var counters = []; | |
| 38 for (var i = 2; i < rules.length; i++) { | |
| 39 counters.push(getCounter(rules[i])); | |
| 40 } | |
| 41 shouldBeEqualToString("counters[0].identifier", "section"); | |
| 42 shouldBeEqualToString("counters[0].listStyle", "decimal"); | |
| 43 shouldBeEqualToString("counters[0].separator", ""); | |
| 44 | |
| 45 shouldBeEqualToString("counters[1].identifier", "section"); | |
| 46 shouldBeEqualToString("counters[1].listStyle", "decimal"); | |
| 47 shouldBeEqualToString("counters[1].separator", ":"); | |
| 48 | |
| 49 shouldBeEqualToString("counters[2].identifier", "section"); | |
| 50 shouldBeEqualToString("counters[2].listStyle", "lower-roman"); | |
| 51 shouldBeEqualToString("counters[2].separator", ""); | |
| 52 | |
| 53 shouldBeEqualToString("counters[3].identifier", "section"); | |
| 54 shouldBeEqualToString("counters[3].listStyle", "upper-roman"); | |
| 55 shouldBeEqualToString("counters[3].separator", ","); | |
| 56 | |
| 57 shouldBeEqualToString("counters[4].identifier", "section"); | |
| 58 shouldBeEqualToString("counters[4].listStyle", "none"); | |
| 59 shouldBeEqualToString("counters[4].separator", ""); | |
| 60 </script> | |
| 61 </body> | |
| 62 </html> | |
| OLD | NEW |