Ticket #10499 (closed bug: fixed)
: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: | ||
| Blocking: | Blocked by: |
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
Change History
comment:1 Changed 20 months ago by dmethvin
- Priority changed from undecided to low
- Status changed from new to open
- Component changed from unfiled to selector
comment:2 Changed 12 months ago by timmywil
- Owner set to timmywil
- Status changed from open to assigned
- Milestone changed from None to 1.next
comment:3 Changed 12 months ago by timmywil
- Status changed from assigned to closed
- Resolution set to fixed
- Milestone changed from 1.next to 1.8
comment:4 Changed 11 months ago by timmywil
- Status changed from closed to reopened
- Resolution fixed deleted
This wasn't actually fixed, just changed. Fix incoming.
comment:6 Changed 11 months ago by Timmy Willison
- Status changed from assigned to closed
- Resolution set to fixed
Sizzle: fix a small bug with combinator cache. Fixes #10499.
Changeset: 4039d3668decade6c7098f7f270c45dd54ff6a8c
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
