1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN">
4 <title>CSS
2.1 Test Suite: dynamic changes to 'counter-increment'
</title>
5 <style type=
"text/css">
7 #test, .reset
{ counter-reset: c
; }
8 .increment:before { content: counters
(c
, ".") "-"; }
9 .increment { counter-increment: c
; }
12 <script src=
"../../../resources/js-test.js"></script>
13 <script type=
"text/javascript">
15 if (window
.testRunner
)
16 testRunner
.dumpAsText();
18 function checkCounterValuesBeforeChange()
20 debug('Before the dynamic change:');
21 shouldBe("window.internals.counterValue(document.getElementById('one'))", "'1'");
22 shouldBe("window.internals.counterValue(document.getElementById('two'))", "'3'");
23 shouldBe("window.internals.counterValue(document.getElementById('three'))", "'4'");
26 function checkCounterValuesAfterChange()
28 debug('After the dynamic change:');
29 shouldBe("window.internals.counterValue(document.getElementById('one'))", "'1'");
30 shouldBe("window.internals.counterValue(document.getElementById('two'))", "'2'");
31 shouldBe("window.internals.counterValue(document.getElementById('three'))", "'3'");
34 debug('TEST COMPLETE');
35 // Eliminate confusing messages (counter values won't be dumped by dumpAsText).
36 var viewElement
= document
.getElementById("view");
37 viewElement
.parentNode
.removeChild(viewElement
);
42 if (window
.testRunner
)
43 checkCounterValuesBeforeChange();
45 var t
= document
.getElementById("test");
46 t
.removeChild(t
.childNodes
.item(1));
48 if (window
.testRunner
)
49 checkCounterValuesAfterChange();
54 <body onload=
"run();">
56 <p>This is the WebKit version of
<a href=
"http://www.w3.org/Style/CSS/Test/CSS2.1/20061011/html4/t1204-increment-01-c-o.htm">CSS
2.1 Test Suite: dynamic changes to 'counter-increment'
</a>.
</p>
59 <p>The following two lines should be the same:
</p>
60 <div id=
"test"><span id=
"one" class=
"increment"></span><span class=
"increment">FAIL-
</span><span id=
"two" class=
"increment"></span><span id=
"three" class=
"increment"></span></div>
61 <div id=
"reference">1-
2-
3-
</div>
64 <div id=
"console"></div>