1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN">
3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
4 <title>CSS Test: dynamic changes to 'counter-increment'
</title>
5 <link rel=
"author" href=
"http://dbaron.org/" title=
"L. David Baron">
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 content=
"dom" name=
"flags">
10 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
11 <meta http-equiv=
"Content-Script-Type" content=
"text/javascript">
12 <style type=
"text/css">
13 body
{ white-space: nowrap
; }
14 .reset { counter-reset: c
; }
15 .increment:before, .use:before { content: counters
(c
, ".") "-"; }
16 .increment { counter-increment: c
; }
18 <script type=
"text/javascript">
19 if (window
.testRunner
) {
20 testRunner
.dumpAsText();
21 testRunner
.waitUntilDone();
25 if (window
.testRunner
) {
26 testElement
= document
.getElementById("test");
27 console
= document
.getElementById("console");
28 spanList
= testElement
.getElementsByTagName("span")
29 for (i
= 0; i
< spanList
.length
; ++i
) {
30 newSpanElement
= document
.createElement("span");
31 newSpanElement
.innerText
=
32 window
.internals
.counterValue(document
.getElementById(spanList
.item(i
).getAttribute("id")));
33 if (newSpanElement
.innerText
.length
)
34 newSpanElement
.innerText
= newSpanElement
.innerText
+ "- ";
35 console
.appendChild(newSpanElement
);
37 testRunner
.notifyDone();
41 </head><body onload=
"setTimeout('run()', 0)">
42 <p>The following two lines should have the same content:
</p>
44 <span id=
"root" class=
"reset">
46 <span id=
"reset1" style=
"counter-reset: c 1"></span>
47 <span id=
"inc" class=
"increment"></span>
48 <span id=
"user" class=
"use"></span>
49 <span id=
"reset4" style=
"counter-reset: c 4"></span>
50 <span id=
"inc2" class=
"increment"></span>
52 <span id=
"interesting" class=
"increment"></span>
55 <div id=
"reference">0.2-
0.2-
0.5-
1-
</div>
57 <div id=
"console"></div>