Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#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:
Blocked by: Blocking:

Description (last modified by john)

:not(:nth-child(1))

See http://dev.jquery.com/ticket/4169 for: :has(:nth-child(1))

Attachments (2)

test2.html (122.2 KB) - added by initjh 11 years ago.
Test Case 1
4156.patch (1.4 KB) - added by dz 11 years ago.

Download all attachments as: .zip

Change History (11)

Changed 11 years ago by initjh

Attachment: test2.html added

Test Case 1

comment:1 Changed 11 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 11 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:3 Changed 11 years ago by dz

comment:4 Changed 11 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 11 years ago by initjh

Simplified test case, thanks for the test case site dz. http://jquery.nodnod.net/cases/124

comment:6 Changed 11 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.

comment:7 Changed 11 years ago by dz

Verified working:

http://jquery.nodnod.net/cases/125

attached a patch.

Changed 11 years ago by dz

Attachment: 4156.patch added

comment:8 Changed 11 years ago by john

Component: coreselector
Resolution: fixed
Status: newclosed

Fixed in SVN rev [6212].

comment:9 Changed 11 years ago by john

Description: modified (diff)
Note: See TracTickets for help on using tickets.