--TEST-- CSS Selectors - Pseudo classes: nth-child --EXTENSIONS-- dom --FILE--

1

2

3

4

5

XML); test_helper($dom, 'h2:nth-of-type(n+2):nth-last-of-type(n+2)'); test_helper($dom, 'h2:not(:first-of-type):not(:last-of-type)'); // Equivalent to the above test_helper($dom, 'h2:nth-child(2)'); test_helper($dom, 'h2:nth-last-child(2)'); test_helper($dom, 'h2:nth-child(2n + 1)'); test_helper($dom, 'h2:nth-last-child(2n + 1)'); test_helper($dom, 'h2:nth-child(3n - 2)'); test_helper($dom, 'h2:nth-last-child(3n - 2)'); ?> --EXPECT-- --- Selector: h2:nth-of-type(n+2):nth-last-of-type(n+2) ---

2

3

4

--- Selector: h2:not(:first-of-type):not(:last-of-type) ---

2

3

4

--- Selector: h2:nth-child(2) ---

2

--- Selector: h2:nth-last-child(2) ---

4

--- Selector: h2:nth-child(2n + 1) ---

1

3

5

--- Selector: h2:nth-last-child(2n + 1) ---

1

3

5

--- Selector: h2:nth-child(3n - 2) ---

1

4

--- Selector: h2:nth-last-child(3n - 2) ---

2

5