darin | 83dae6e | 2007-01-06 01:36:24 | [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-Script-Type" content="text/javascript"></meta> |
| 9 | <style type="text/css"> |
| 10 | |
| 11 | body { white-space: nowrap; } |
| 12 | |
| 13 | |
| 14 | #test, .reset { counter-reset: c; } |
| 15 | .increment:before { content: counters(c, ".") "-"; } |
| 16 | .increment { counter-increment: c; } |
| 17 | |
| 18 | </style> |
| 19 | <script type="text/javascript"> |
| 20 | |
| 21 | function run() { |
| 22 | var t = document.getElementById("test"); |
| 23 | var s = document.createElement("span"); |
| 24 | s.setAttribute("class", "increment"); |
| 25 | s.appendChild(document.createTextNode("new-")); |
| 26 | t.insertBefore(s, t.childNodes.item(1)); |
| 27 | } |
| 28 | |
| 29 | </script> |
| 30 | </head> |
| 31 | <body onload="setTimeout('run()', 0)"> |
| 32 | |
| 33 | <p>The following two lines should be the same:</p> |
| 34 | |
| 35 | <div id="test"><span class="increment"></span><span class="increment"></span><span class="increment"></span></div> |
| 36 | |
| 37 | <div id="reference">1-2-new-3-4-</div> |
| 38 | |
| 39 | </body> |
| 40 | </html> |