Skip to main content

Bug Tracker

Side navigation

#10499 closed bug (fixed)

Opened October 14, 2011 09:46PM UTC

Closed July 27, 2012 09:34PM UTC

:nth-child() inside :has() treated as if outside it

Reported by: BoltClock Owned by: timmywil
Priority: low Milestone: 1.8
Component: selector Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:
Description

This selector statement:

$('E:has(F:nth-child(n))')

is treated as:

$('E:nth-child(n):has(F)')

for any

n
.

The equivalent statement using the

.has()
method works correctly, finding
E
with an nth child that is
F
:

$('E').has('F:nth-child(n)')

In-depth test case: http://jsfiddle.net/BoltClock/tbUdq

Tested on latest versions of all major browsers.

Also affects jQuery 1.7b2.

This closed ticket seems related: http://bugs.jquery.com/ticket/4169

Attachments (0)
Change History (6)

Changed October 20, 2011 09:35PM UTC by dmethvin comment:1

component: unfiledselector
priority: undecidedlow
status: newopen

Changed June 19, 2012 06:24AM UTC by timmywil comment:2

milestone: None1.next
owner: → timmywil
status: openassigned

Changed July 03, 2012 02:21AM UTC by timmywil comment:3

milestone: 1.next1.8
resolution: → fixed
status: assignedclosed

Changed July 27, 2012 09:33PM UTC by timmywil comment:4

resolution: fixed
status: closedreopened

This wasn't actually fixed, just changed. Fix incoming.

Changed July 27, 2012 09:33PM UTC by timmywil comment:5

status: reopenedassigned

Changed July 27, 2012 09:34PM UTC by Timmy Willison comment:6

resolution: → fixed
status: assignedclosed

Sizzle: fix a small bug with combinator cache. Fixes #10499.

Changeset: 4039d3668decade6c7098f7f270c45dd54ff6a8c