1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Strict//EN">
4 <title>CSS Test: :nth-child selector with unary prefix on step
</title>
5 <style type=
"text/css">
6 div
div:nth-child
(+2n+1)
12 if (window
.testRunner
)
13 window
.testRunner
.dumpAsText()
17 <p>The test passes if the odd numbered DIVs are green.
</p>
22 <div id=
"testresult" style=
"color: blue">Running
</div>
23 <script type=
"text/javascript">
24 function ArrayContains(array
, value
, ci
)
26 ci
= ci
== true ? true : false;
27 for (var i
= 0; i
< array
.length
; i
++)
29 if (ci
&& array
[i
].toLowerCase() == value
.toLowerCase())
33 else if (array
[i
] == value
)
44 var greenValues
= new Array("green", "#008000", "rgb(0, 128, 0)");
46 var elem
= document
.getElementById("test");
47 var val
= getComputedStyle(elem
.children
[0], null).getPropertyValue("color");
48 if (ArrayContains(greenValues
, val
, false))
50 document
.getElementById("testresult").innerHTML
= "Pass";
54 document
.getElementById("testresult").innerHTML
= "Fail";