Bug Tracker

Ticket #4158 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

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

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

Change History

Changed 6 years ago by initjh

Test Case 1

comment:1 follow-up: ↓ 2 Changed 6 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 6 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 6 years ago by dz

Simplified test case:

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

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

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

comment:6 Changed 6 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 6 years ago by dz

Verified working:

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

attached a patch.

Changed 6 years ago by dz

comment:8 Changed 6 years ago by john

  • Status changed from new to closed
  • Resolution set to fixed
  • Component changed from core to selector

Fixed in SVN rev [6212].

comment:9 Changed 6 years ago by john

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