Regression(r188105): Seems to have caused crashes during PLT on some iPads
[WebKit-https.git] / LayoutTests / fast / css / nth-child-unary-prefix.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">\r
2 <html>\r
3 <head>\r
4     <title>CSS Test: :nth-child selector with unary prefix on step</title>\r
5     <style type="text/css">\r
6     div div:nth-child(+2n+1)\r
7     {\r
8         color: green;\r
9     }\r
10 </style>\r
11 <script>\r
12 if (window.testRunner)\r
13   window.testRunner.dumpAsText()\r
14 </script>\r
15 </head>\r
16 <body>\r
17     <p>The test passes if the odd numbered DIVs are green.</p>\r
18       <div id="test">\r
19           <div>DIV1</div>\r
20           <div>DIV2</div>\r
21       </div>\r
22       <div id="testresult" style="color: blue">Running</div>\r
23     <script type="text/javascript">\r
24                 function ArrayContains(array, value, ci)\r
25                 {\r
26                     ci = ci == true ? true : false;\r
27                     for (var i = 0; i < array.length; i++)\r
28                     {\r
29                         if (ci && array[i].toLowerCase() == value.toLowerCase())\r
30                         {\r
31                             return true;\r
32                         }\r
33                         else if (array[i] == value)\r
34                         {\r
35                             return true;\r
36                         }\r
37                     }\r
38                     return false;\r
39                 }\r
40         function TestCase()\r
41         {\r
42             try\r
43             {\r
44                 var greenValues = new Array("green", "#008000", "rgb(0, 128, 0)");\r
45 \r
46                 var elem = document.getElementById("test");\r
47                 var val = getComputedStyle(elem.children[0], null).getPropertyValue("color");\r
48                 if (ArrayContains(greenValues, val, false))\r
49                 {\r
50                     document.getElementById("testresult").innerHTML = "Pass";\r
51                     return;\r
52                 }\r
53             }catch(e){}\r
54             document.getElementById("testresult").innerHTML = "Fail";\r
55         }\r
56         TestCase();\r
57     </script>\r
58 </body>\r
59 </html>\r