darin | ec37548 | 2007-01-06 01:36:24 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>CSS 2.1 Test Suite: dynamic changes to 'counter-increment'</title> |
| 5 | <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#counters"> |
| 6 | <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#propdef-content"> |
| 7 | <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#counter"> |
| 8 | <meta http-equiv="Content-Style-Type" content="text/css"></meta> |
| 9 | <meta http-equiv="Content-Script-Type" content="text/javascript"></meta> |
| 10 | <style type="text/css"> |
| 11 | |
| 12 | body { white-space: nowrap; } |
| 13 | |
| 14 | |
| 15 | #test, .reset { counter-reset: c; } |
| 16 | .increment:before, .use:before { content: counters(c, ".") "-"; } |
| 17 | .increment { counter-increment: c; } |
| 18 | |
| 19 | </style> |
| 20 | <script type="text/javascript"> |
| 21 | |
| 22 | function run() { |
| 23 | document.getElementById("one").removeAttribute("class"); |
| 24 | document.getElementById("two").setAttribute("class", "increment"); |
| 25 | document.getElementById("three").setAttribute("style", "counter-increment: c"); |
| 26 | } |
| 27 | |
| 28 | </script> |
| 29 | </head> |
| 30 | <body onload="setTimeout('run()', 0)"> |
| 31 | |
| 32 | <p>The following two lines should be the same:</p> |
| 33 | |
| 34 | <div id="test"><span class="increment" id="one"></span><span><span class="reset"><span class="increment"></span><span class="increment" id="two"></span></span></span><span class="use" id="three"></span><span class="increment"></span></div> |
| 35 | |
| 36 | <div id="reference">0.1-0.2-1-2-</div> |
| 37 | |
| 38 | </body> |
| 39 | </html> |