1
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN">
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">
11 body
{ white-space: nowrap
; }
14 #test, .reset
{ counter-reset: c
; }
15 .increment:before { content: counters
(c
, ".") "-"; }
16 .increment { counter-increment: c
; }
19 <script type=
"text/javascript">
22 if (window
.testRunner
) {
23 testRunner
.dumpAsText();
24 // This call ensures the layout happened before we modify the DOM tree.
25 window
.internals
.counterValue(document
.getElementById("span1"));
28 var t
= document
.getElementById("test");
29 t
.removeChild(t
.childNodes
.item(1));
31 if (window
.testRunner
) {
32 testElement
= document
.getElementById("test");
33 console
= document
.getElementById("console");
34 spanList
= testElement
.getElementsByTagName("span");
35 for (i
= 0; i
< spanList
.length
; ++i
) {
36 newSpanElement
= document
.createElement("span");
37 newSpanElement
.innerText
= window
.internals
.counterValue(document
.getElementById(spanList
.item(i
).getAttribute("id")));
38 if (newSpanElement
.innerText
.length
)
39 newSpanElement
.innerText
= newSpanElement
.innerText
+ "-";
40 console
.appendChild(newSpanElement
);
47 <body onload=
"run();">
49 <p>The following two lines should be the same:
</p>
51 <div id=
"test"><span id=
"span1" class=
"increment"></span><span id=
"span2" class=
"reset"></span><span id=
"span3" class=
"increment"></span><span id=
"span4" class=
"increment"></span></div>
53 <div id=
"reference">1-
2-
3-
</div>