4 .reset { counter-reset: c; }
5 .increment { counter-increment: c; }
6 .increment2 { counter-increment: c
2; }
7 .show-before:before { content: counters(c,
"."); }
8 .show-after:after { content: counters(c,
"."); }
9 .show-twice:before { content: counters(c,
".") counters(c,
"."); }
10 .show-greek:before { content: counters(c,
".", lower-greek); }
11 .show-three-greeks:before { content: counters(c,
".", lower-greek) counters(c,
".", lower-greek); }
12 .show-three-greeks:after { content: counters(c,
".", lower-greek); }
14 <script src=
"../../../resources/js-test.js"></script>
17 <div>This is the test for window.internals.counterValueForElementById
</div>
19 <div class=
"reset"><span id=
"before" class=
"show-before"></span></div>
20 <div class=
"reset"><span id=
"after" class=
"show-after"></span></div>
21 <div class=
"reset"><span id=
"before_after" class=
"show-before show-after"></span></div>
22 <div class=
"reset"><span id=
"twice" class=
"show-twice"></span></div>
24 <span id=
"point" class=
"reset increment show-before">
25 <span id=
"two-points" class=
"reset increment2 show-before">
26 <span id=
"greek" class=
"show-greek"></span>
27 <span id=
"three-greeks" class=
"show-three-greeks"></span>
32 <div id=
"console"></div>
35 if (window
.testRunner
) {
36 testRunner
.dumpAsText();
38 shouldBe("window.internals.counterValue(document.getElementById('before'))", "'0'");
39 shouldBe("window.internals.counterValue(document.getElementById('after'))", "'0'");
40 shouldBe("window.internals.counterValue(document.getElementById('before_after'))", "'0 0'");
41 shouldBe("window.internals.counterValue(document.getElementById('twice'))", "'0 0'");
42 shouldBe("window.internals.counterValue(document.getElementById('point'))", "'0.1'");
43 shouldBe("window.internals.counterValue(document.getElementById('two-points'))", "'0.1.2'");
44 shouldBe("window.internals.counterValue(document.getElementById('greek'))", "'0.\u03b1.\u03b2'");
45 shouldBe("window.internals.counterValue(document.getElementById('three-greeks'))", "'0.\u03b1.\u03b2 0.\u03b1.\u03b2 0.\u03b1.\u03b2'");