Skip to main content

Bug Tracker

Side navigation

#4158 closed bug (fixed)

Opened February 15, 2009 10:42PM UTC

Closed February 16, 2009 05:58PM UTC

Last modified February 20, 2009 01:26PM UTC

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:


See for:


Attachments (2)
  • 4156.patch (1.4 KB) - added by dz February 16, 2009 04:38PM UTC.
  • test2.html (122.2 KB) - added by initjh February 15, 2009 10:46PM UTC.

    Test Case 1

Change History (9)

Changed February 15, 2009 11:09PM UTC by initjh comment:1

Seems I made a slight mistake, it only fails on :not(nth-child(1)). Sorry.

Changed February 15, 2009 11:13PM UTC by initjh comment:2

Replying to [comment:1 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)).

Changed February 16, 2009 07:58AM UTC by dz comment:3

Simplified test case:

Changed February 16, 2009 02:02PM UTC by initjh comment:4

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))).

Changed February 16, 2009 02:07PM UTC by initjh comment:5

Simplified test case, thanks for the test case site dz.

Changed February 16, 2009 04:24PM UTC by initjh comment:6

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.

Changed February 16, 2009 04:37PM UTC by dz comment:7

Verified working:

attached a patch.

Changed February 16, 2009 05:58PM UTC by john comment:8

component: coreselector
resolution: → fixed
status: newclosed

Fixed in SVN rev [6212].

Changed February 20, 2009 01:26PM UTC by john comment:9

description: :not(:nth-child(1)) \ :has(:nth-child(1)) \ :not(:nth-child(1)) \ \ See for: \ :has(:nth-child(1)) \