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-Script-Type" content=
"text/javascript">
11 <style type=
"text/css">
12 body
{ white-space: nowrap
; }
13 #test, .reset
{ counter-reset: c
; }
14 .increment:before { content: counters
(c
, ".") "-"; }
15 .increment { counter-increment: c
; }
17 <script type=
"text/javascript">
18 if (window
.testRunner
) {
19 testRunner
.dumpAsText();
20 testRunner
.waitUntilDone();
24 document
.getElementById("one").setAttribute("class", "reset");
25 document
.getElementById("two").removeAttribute("class");
26 if (window
.testRunner
) {
27 testElement
= document
.getElementById("test");
28 console
= document
.getElementById("console");
29 spanList
= testElement
.getElementsByTagName("span")
30 for (i
= 0; i
< spanList
.length
; ++i
) {
31 newSpanElement
= document
.createElement("span");
32 newSpanElement
.innerText
=
33 window
.internals
.counterValue(document
.getElementById(spanList
.item(i
).getAttribute("id")));
34 if (newSpanElement
.innerText
.length
)
35 newSpanElement
.innerText
= newSpanElement
.innerText
+ "-";
36 console
.appendChild(newSpanElement
);
38 testRunner
.notifyDone();
42 </head><body onload=
"setTimeout('run()', 0)">
43 <p>The following two lines should be the same:
</p>
44 <div id=
"test"><span id=
"span1" class=
"increment"></span><span id=
"span2"><span class=
"reset" id=
"one"><span id=
"span4" class=
"increment"></span></span></span><span id=
"span5" class=
"increment"></span><span id=
"span6"><span id=
"two"><span id=
"span7" class=
"increment"></span></span></span><span id=
"span8" class=
"increment"></span></div>
45 <div id=
"reference">1-
1.1-
2-
3-
4-
</div>