blob: f727d4fe7f8b49cfaeafa4e7d2bfb79f911bfd61 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Test: Counter-increment tests</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
<link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#counters">
<script src="../../../resources/js-test.js"></script>
<script>
jsTestIsAsync = true;
function run()
{
/* These are text versions of the counter-increment-* tests in the CSS 2.1 test suite.
So 'test3' here is equivalent to counter-increment-003.htm, and so on.
WebKit dumpAsText versions of counter-increment-001 and 002 already exist in fast/css/counters */
shouldBe("window.internals.counterValue(document.getElementById('test3'))", "'-2147483648'");
shouldBe("window.internals.counterValue(document.getElementById('test4'))", "'-2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test5'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('test6'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('test7'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('test8'))", "'10'");
shouldBe("window.internals.counterValue(document.getElementById('test9'))", "'10'");
shouldBe("window.internals.counterValue(document.getElementById('test10'))", "'2147483646'");
shouldBe("window.internals.counterValue(document.getElementById('test11'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test12'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test13'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test14'))", "'2'");
shouldBe("window.internals.counterValue(document.getElementById('test15'))", "'-2147483648'");
shouldBe("window.internals.counterValue(document.getElementById('test16'))", "'-2147483648'");
shouldBe("window.internals.counterValue(document.getElementById('test17'))", "'-2147483648'");
shouldBe("window.internals.counterValue(document.getElementById('test18'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('test19'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('test20'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('test21'))", "'20'");
shouldBe("window.internals.counterValue(document.getElementById('test22'))", "'20'");
shouldBe("window.internals.counterValue(document.getElementById('test23'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test24'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test25'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test26'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test27'))", "'3'");
shouldBe("window.internals.counterValue(document.getElementById('test28'))", "'-2147483648'");
shouldBe("window.internals.counterValue(document.getElementById('test29'))", "'-2147483648'");
shouldBe("window.internals.counterValue(document.getElementById('test30'))", "'-2147483648'");
shouldBe("window.internals.counterValue(document.getElementById('test31'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('test32'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('test33'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('test34'))", "'30'");
shouldBe("window.internals.counterValue(document.getElementById('test35'))", "'30'");
shouldBe("window.internals.counterValue(document.getElementById('test36'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test37'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test38'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test39'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test40'))", "'32'");
shouldBe("window.internals.counterValue(document.getElementById('test41'))", "'-2147483648'");
shouldBe("window.internals.counterValue(document.getElementById('test42'))", "'-2147483648'");
shouldBe("window.internals.counterValue(document.getElementById('test43'))", "'-2147483648'");
shouldBe("window.internals.counterValue(document.getElementById('test44'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('test45'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('test46'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('test47'))", "'320'");
shouldBe("window.internals.counterValue(document.getElementById('test48'))", "'320'");
shouldBe("window.internals.counterValue(document.getElementById('test49'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test50'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test51'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test52'))", "'2147483647'");
shouldBe("window.internals.counterValue(document.getElementById('test53'))", "'5'");
shouldBe("window.internals.counterValue(document.getElementById('none53'))", "'5'");
shouldBe("window.internals.counterValue(document.getElementById('test53a'))", "'10'");
shouldBe("window.internals.counterValue(document.getElementById('wrapper54'))", "'5'");
shouldBe("window.internals.counterValue(document.getElementById('test54'))", "'10'");
shouldBe("window.internals.counterValue(document.getElementById('test55'))", "'1'");
shouldBe("window.internals.counterValue(document.getElementById('test56'))", "'-2147483648'");
shouldBe("window.internals.counterValue(document.getElementById('test57'))", "'5'");
shouldBe("window.internals.counterValue(document.getElementById('none57'))", "'5'");
shouldBe("window.internals.counterValue(document.getElementById('wrapper58'))", "'5'");
shouldBe("window.internals.counterValue(document.getElementById('test58a'))", "'5.2'");
shouldBe("window.internals.counterValue(document.getElementById('none58'))", "'5.2'");
shouldBe("window.internals.counterValue(document.getElementById('none58a'))", "'5.7'");
shouldBe("window.internals.counterValue(document.getElementById('test58b'))", "'5.12'");
finishJSTest();
}
</script>
<style type="text/css">
#test3
{
counter-increment: ident3 -2147483648;
}
#test3:before
{
content: counter(ident3);
}
#test4
{
counter-increment: ident4 -2147483647;
}
#test4:before
{
content: counter(ident4);
}
#test5
{
counter-increment: ident5 -0;
}
#test5:before
{
content: counter(ident5);
}
#test6
{
counter-increment: ident6 0;
}
#test6:before
{
content: counter(ident6);
}
#test7
{
counter-increment: ident7 +0;
}
#test7:before
{
content: counter(ident7);
}
#test8
{
counter-increment: ident8 10;
}
#test8:before
{
content: counter(ident8);
}
#test9
{
counter-increment: ident9 +10;
}
#test9:before
{
content: counter(ident9);
}
#test10
{
counter-increment: ident10 2147483646;
}
#test10:before
{
content: counter(ident10);
}
#test11
{
counter-increment: ident11 2147483647;
}
#test11:before
{
content: counter(ident11);
}
#test12
{
counter-increment: ident12 +2147483647;
}
#test12:before
{
content: counter(ident12);
}
#test13
{
counter-increment: ident13 2147483648;
}
#test13:before
{
content: counter(ident13);
}
#test14
{
counter-increment: ident14 ident14;
}
#test14:before
{
content: counter(ident14);
}
#test15
{
counter-increment: ident15 -2147483649 ident15 -2147483649;
}
#test15:before
{
content: counter(ident15);
}
#test16
{
counter-increment: ident16 -2147483648 ident16 -2147483648;
}
#test16:before
{
content: counter(ident16);
}
#test17
{
counter-increment: ident17 -2147483647 ident17 -2147483647;
}
#test17:before
{
content: counter(ident17);
}
#test18
{
counter-increment: ident18 -0 ident18 -0;
}
#test18:before
{
content: counter(ident18);
}
#test19
{
counter-increment: ident19 0 ident19 0;
}
#test19:before
{
content: counter(ident19);
}
#test20
{
counter-increment: ident20 +0 ident20 +0;
}
#test20:before
{
content: counter(ident20);
}
#test21
{
counter-increment: ident21 10 ident21 10;
}
#test21:before
{
content: counter(ident21);
}
#test22
{
counter-increment: ident22 +10 ident22 +10;
}
#test22:before
{
content: counter(ident22);
}
#test23
{
counter-increment: ident23 2147483646 ident23 2147483646;
}
#test23:before
{
content: counter(ident23);
}
#test24
{
counter-increment: ident24 2147483647 ident24 2147483647;
}
#test24:before
{
content: counter(ident24);
}
#test25
{
counter-increment: ident25 +2147483647 ident25 +2147483647;
}
#test25:before
{
content: counter(ident25);
}
#test26
{
counter-increment: ident26 2147483648 ident26 2147483648;
}
#test26:before
{
content: counter(ident26);
}
#test27
{
counter-increment: ident27 ident27 ident27;
}
#test27:before
{
content: counter(ident27);
}
#test28
{
counter-increment: ident28 -2147483649 ident28 -2147483649 ident28 -2147483649;
}
#test28:before
{
content: counter(ident28);
}
#test29
{
counter-increment: ident29 -2147483648 ident29 -2147483648 ident29 -2147483648;
}
#test29:before
{
content: counter(ident29);
}
#test30
{
counter-increment: ident30 -2147483647 ident30 -2147483647 ident30 -2147483647;
}
#test30:before
{
content: counter(ident30);
}
#test31
{
counter-increment: ident31 -0 ident31 -0 ident31 -0;
}
#test31:before
{
content: counter(ident31);
}
#test32
{
counter-increment: ident32 0 ident32 0 ident32 0;
}
#test32:before
{
content: counter(ident32);
}
#test33
{
counter-increment: ident33 +0 ident33 +0 ident33 +0;
}
#test33:before
{
content: counter(ident33);
}
#test34
{
counter-increment: ident34 10 ident34 10 ident34 10;
}
#test34:before
{
content: counter(ident34);
}
#test35
{
counter-increment: ident35 +10 ident35 +10 ident35 +10;
}
#test35:before
{
content: counter(ident35);
}
#test36
{
counter-increment: ident36 2147483646 ident36 2147483646 ident36 2147483646;
}
#test36:before
{
content: counter(ident36);
}
#test37
{
counter-increment: ident37 2147483647 ident37 2147483647 ident37 2147483647;
}
#test37:before
{
content: counter(ident37);
}
#test38
{
counter-increment: ident38 +2147483647 ident38 +2147483647 ident38 +2147483647;
}
#test38:before
{
content: counter(ident38);
}
#test39
{
counter-increment: ident39 2147483648 ident39 2147483648 ident39 2147483648;
}
#test39:before
{
content: counter(ident39);
}
#test40
{
counter-increment: ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40;
}
#test40:before
{
content: counter(ident40);
}
#test41
{
counter-increment: ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649;
}
#test41:before
{
content: counter(ident41);
}
#test42
{
counter-increment: ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648;
}
#test42:before
{
content: counter(ident42);
}
#test43
{
counter-increment: ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647;
}
#test43:before
{
content: counter(ident43);
}
#test44
{
counter-increment: ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0;
}
#test44:before
{
content: counter(ident44);
}
#test45
{
counter-increment: ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0;
}
#test45:before
{
content: counter(ident45);
}
#test46
{
counter-increment: ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0;
}
#test46:before
{
content: counter(ident46);
}
#test47
{
counter-increment: ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10;
}
#test47:before
{
content: counter(ident47);
}
#test48
{
counter-increment: ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10;
}
#test48:before
{
content: counter(ident48);
}
#test49
{
counter-increment: ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646;
}
#test49:before
{
content: counter(ident49);
}
#test50
{
counter-increment: ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647;
}
#test50:before
{
content: counter(ident50);
}
#test51
{
counter-increment: ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647;
}
#test51:before
{
content: counter(ident51);
}
#test52
{
counter-increment: ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648;
}
#test52:before
{
content: counter(ident52);
}
#test53
{
counter-increment: ident53 5;
}
#test53a
{
counter-increment: ident53 5;
}
#none53
{
counter-increment: none;
}
#none53:before
{
content: counter(ident53);
}
#test53:before
{
content: counter(ident53);
}
#test53a:before
{
content: counter(ident53);
}
#wrapper54 /*test 54*/
{
counter-increment: ident54 5;
}
#test54
{
counter-increment: inherit;
}
#test54:before
{
content: counter(ident54);
}
#wrapper54:before
{
content: counter(ident54);
}
#test55
{
counter-increment: ident55;
}
#test55:before
{
content: counter(ident55);
}
#test56
{
counter-increment: ident56 -2147483649;
}
#test56:before
{
content: counter(ident56);
}
div.class57
{
counter-increment: ident57 5;
}
#test57:before
{
content: counter(ident57);
}
#none57
{
counter-increment: none;
}
#none57:before
{
content: counter(ident57);
}
div.class58
{
counter-increment: ident58 5;
}
#wrapper58:before
{
content: counter(ident58);
}
#test58a
{
counter-reset: ident58 2;
}
#test58a:before
{
content: counters(ident58, ".");
}
#none58
{
counter-increment: none;
}
#none58:before
{
content: counters(ident58, ".");
}
#none58a
{
counter-increment: ident58 5;
}
#none58a:before
{
content: counters(ident58, ".");
}
#test58b
{
counter-increment: ident58 5;
}
#test58b:before
{
content: counters(ident58, ".");
}
</style>
</head>
<body onload="setTimeout('run()', 0);">
<div id="test3"></div>
<div id="test4"></div>
<div id="test5"></div>
<div id="test6"></div>
<div id="test7"></div>
<div id="test8"></div>
<div id="test9"></div>
<div id="test10"></div>
<div id="test11"></div>
<div id="test12"></div>
<div id="test13"></div>
<div id="test14"></div>
<div id="test15"></div>
<div id="test16"></div>
<div id="test17"></div>
<div id="test18"></div>
<div id="test19"></div>
<div id="test20"></div>
<div id="test21"></div>
<div id="test22"></div>
<div id="test23"></div>
<div id="test24"></div>
<div id="test25"></div>
<div id="test26"></div>
<div id="test27"></div>
<div id="test28"></div>
<div id="test29"></div>
<div id="test30"></div>
<div id="test31"></div>
<div id="test32"></div>
<div id="test33"></div>
<div id="test34"></div>
<div id="test35"></div>
<div id="test36"></div>
<div id="test37"></div>
<div id="test38"></div>
<div id="test39"></div>
<div id="test40"></div>
<div id="test41"></div>
<div id="test42"></div>
<div id="test43"></div>
<div id="test44"></div>
<div id="test45"></div>
<div id="test46"></div>
<div id="test47"></div>
<div id="test48"></div>
<div id="test49"></div>
<div id="test50"></div>
<div id="test51"></div>
<div id="test52"></div>
<div id="test53"></div>
<div id="none53"></div>
<div id="test53a"></div>
<div id="wrapper54">
<div id="test54"></div>
</div>
<div id="test55"></div>
<div id="test56"></div>
<div id="test57" class="class57"></div>
<div id="none57" class="class57"></div>
<div id="wrapper58" class="class58">
<span id="test58a"></span>
<span id="none58">
<span id="none58a"></span>
</span>
<span id="test58b"></span>
</div>
</body>
</html>