1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Strict//EN">
4 <title>CSS Test: :nth-child selector with implied step
</title>
5 <style type=
"text/css">
12 if (window
.testRunner
)
13 window
.testRunner
.dumpAsText();
17 <p>The test passes if only the first DIV is green.
</p>
30 <div id=
"testresult" style=
"color: blue">Running
</div>
31 <script type=
"text/javascript">
32 function ArrayContains(array
, value
, ci
)
34 ci
= ci
== true ? true : false;
35 for (var i
= 0; i
< array
.length
; i
++)
37 if (ci
&& array
[i
].toLowerCase() == value
.toLowerCase())
41 else if (array
[i
] == value
)
53 var greenValues
= new Array("green", "#008000", "rgb(0, 128, 0)");
55 var elem
= document
.getElementById("test");
56 var val
= getComputedStyle(elem
.children
[0], null).getPropertyValue("color");
57 if (ArrayContains(greenValues
, val
, false))
59 document
.getElementById("testresult").innerHTML
= "Pass";
64 document
.getElementById("testresult").innerHTML
= "Fail";