Skip to content

Commit aab738e

Browse files
committed
Fix for :nth-child(-n+B) to select first B elements
1 parent 4e2895f commit aab738e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ QueryPath Changelog
44
# 4.0.2
55

66
- Fix for :nth-child(n+B) to select B-th and all following elements
7+
- Fix for :nth-child(-n+B) to select first B elements
78
- Update PHPUnit Test Suite to use @dataProvider in testPseudoClassNthChild() to reduce code repetition
89

910
# 4.0.1

tests/QueryPath/CSS/QueryPathEventHandlerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,12 @@ public function nthChildProvider(): array
628628
//['i:nth-child(-2n)', 2, 'four' ], // Not totally sure what should be returned here
629629
['i:nth-child(4n)', 1, 'four', 0], // every fourth row
630630
['i:nth-child(4n+1)', 2, 'five' ], // first of every four rows
631-
['i:nth-child(1)', 1, 'one', 0 ], // first row
631+
['i:nth-child(1)', 1, 'one', 0], // first row
632632
['i:nth-child(0n-0)', 0, null ], // empty list
633633
['i:nth-child(n+3)', 3, 'four' ], // third+ lines
634-
//['i:nth-child(0n+3)', 1, 'three' ], // third element in a group of siblings
635-
//['i:nth-child(-n+3)', 3, 'three' ], // first three lines
634+
['i:nth-child(-n+3)', 3, 'two' ], // first three elements
635+
['i:nth-child(-n+4)', 4, 'two' ], // first four lines
636+
['i:nth-child(0n+2)', 1, 'two', 0], // second element in a group of siblings
636637
];
637638
}
638639

0 commit comments

Comments
 (0)