4 <title>Test for Bug
31267 - :nth-child(-
2n) should match no element
</title>
17 if (window
.testRunner
)
18 testRunner
.dumpAsText();
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) {
28 for (var i
= 0; i
< elements
.length
; i
++)
29 elements
[i
].innerHTML
= "FAIL: " + nth_child
+ " must not match any elements.";
39 var result
= document
.getElementById("result");
40 result
.innerHTML
= message
;
41 result
.style
.color
= color
;
44 <body onload=
"test()">
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>