Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / nth-child-negative-a-param.html
blob752b03136466bb964b257b1b8e33f7f95082313d
1 <!doctype html>
2 <html>
3 <head>
4 <title>Test for Bug 31267 - :nth-child(-2n) should match no element</title>
5 <style>
6 li {
7 color:green;
9 li:nth-child(-1n) {
10 color:red;
12 li:nth-child(-2n) {
13 color:red;
15 </style>
16 <script>
17 if (window.testRunner)
18 testRunner.dumpAsText();
20 function test()
22 var success = true;
23 for (var a_param = -1; a_param >= -2; a_param--) {
24 var nth_child = "li:nth-child(" + a_param + "n)";
25 var elements = document.querySelectorAll(nth_child);
26 if (elements.length != 0) {
27 success = false;
28 for (var i = 0; i < elements.length; i++)
29 elements[i].innerHTML = "FAIL: " + nth_child + " must not match any elements.";
33 var message = "FAIL";
34 var color = "red";
35 if (success) {
36 message = "PASS";
37 color = "green";
39 var result = document.getElementById("result");
40 result.innerHTML = message;
41 result.style.color = color;
43 </script>
44 <body onload="test()">
45 <ol>
46 <li>This must be green because li:nth-child(-an) must not match any elements.</li>
47 <li>This must be green because li:nth-child(-an) must not match any elements.</li>
48 <li>This must be green because li:nth-child(-an) must not match any elements.</li>
49 <li>This must be green because li:nth-child(-an) must not match any elements.</li>
50 </ol>
51 <div id="result">
52 Test didn't run
53 </div>
54 </body>
55 </html>