counter-reset-000

dynamic changes to 'counter-increment'

WeasyPrint

This browser

Flags
dom

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: dynamic changes to 'counter-increment'</title>
 5   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
 6   <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#counters">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#propdef-content">
 8   <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#counter">
 9   <meta name="flags" content="dom">
10   <meta http-equiv="Content-Script-Type" content="text/javascript">
11   <style type="text/css">
12 
13   body { white-space: nowrap; }
14 
15 
16   #test, .reset { counter-reset: c; }
17   .increment:before { content: counters(c, ".") "-"; }
18   .increment { counter-increment: c; }
19 
20   </style>
21   <script type="text/javascript">
22 
23   function run() {
24 	var t = document.getElementById("test");
25 	var s = document.createElement("span");
26 	s.setAttribute("class", "reset");
27 	t.insertBefore(s, t.childNodes.item(1));
28   }
29 
30   </script>
31  </head>
32  <body onload="setTimeout('run()', 0)">
33 
34  <p>The following two lines should be the same:</p>
35 
36  <div id="test"><span class="increment"></span><span class="increment"></span><span class="increment"></span></div>
37 
38  <div id="reference">1-1.1-1.2-</div>
39 
40  </body>
41 </html>