Ticket #4158 (closed bug: fixed)
multiple pseudo selector issues
| Reported by: | initjh | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3.2 |
| Component: | selector | Version: | 1.3.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description (last modified by john) (diff)
:not(:nth-child(1))
See http://dev.jquery.com/ticket/4169 for: :has(:nth-child(1))
Attachments
Change History
Changed 4 years ago by initjh
-
attachment
test2.html
added
comment:1 follow-up: ↓ 2 Changed 4 years ago by initjh
Seems I made a slight mistake, it only fails on :not(nth-child(1)). Sorry.
comment:2 in reply to: ↑ 1 Changed 4 years ago by initjh
Replying to initjh:
Seems I made a slight mistake, it only fails on :not(:nth-child(1)). Sorry.
Sorry, misread debugger. It does fail on :has(:nth-child(1)).
comment:4 Changed 4 years ago by initjh
Actually, that's a different problem. You should make a new ticket for that. I noticed that while testing on Chrome. The selector is processed in Chrome, but it selects the parent like you have shown.
This one is (I think) related to some RegEx problems in Sizzle, when you put :nth-child in :not or :has. Another example, :not(:not(:not(div))).
comment:5 Changed 4 years ago by initjh
Simplified test case, thanks for the test case site dz. http://jquery.nodnod.net/cases/124
comment:6 Changed 4 years ago by initjh
I found a way to make it behave properly: On the first iteration in Sizzle.filter, have it process PSEUDO type first instead of CHILD. It will then properly parse the :nth-child selector, and apply :not to it as expected.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Test Case 1