19 lines
1.1 KiB
Plaintext
19 lines
1.1 KiB
Plaintext
In addition to the testing for previous siblings, ":nth-child(An+B of selectorList)" must also test there is a parent element.
|
|
|
|
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
|
|
|
|
|
|
PASS getComputedStyle(document.querySelector("html")).backgroundColor is "rgb(255, 255, 255)"
|
|
PASS document.querySelector("html:nth-child(n of *), html:nth-child(n of :not(notThere)), html:nth-child(odd of *), html:nth-child(odd of :not(notThere)), html:nth-child(even of *), html:nth-child(even of :not(notThere))") is null
|
|
#test-tree initially match when it is attached to the document
|
|
PASS document.querySelector("#test-tree:nth-child(n of *)") is document.getElementById("test-tree")
|
|
PASS testTree.matches("#test-tree:nth-child(n of *)") is true
|
|
After detaching #test-tree, :nth-child() no longer matches because it does not have a parent element.
|
|
PASS document.querySelector("#test-tree:nth-child(n of *)") is null
|
|
PASS testTree.matches("#test-tree:nth-child(n of *)") is false
|
|
PASS testTree.matches("#test-tree") is true
|
|
PASS successfullyParsed is true
|
|
|
|
TEST COMPLETE
|
|
|