Skip to main content

Bug Tracker

Side navigation

#12337 closed bug (fixed)

Opened August 17, 2012 09:20PM UTC

Closed September 19, 2012 04:04PM UTC

:nth-child selector not accurate after new child element added

Reported by: bobbymwalters@gmail.com Owned by: gibson042
Priority: high Milestone: 1.8.2
Component: selector Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:
Description

Using the :nth-child selector after a new child element has been added to a parent isn't working correctly in 1.8.0. However, with 1.7.2 the same scenario works as expected.

A test for using .find vs .children was added as well because in 1.7.2 using .children('.class:nth-child(NUMBER)') was significantly faster in Internet Explorer.

It seems the .find vs .children is also being handled differently. Using 1.8.0 the .find variant works in Chrome 21.0.1180.79 but .children remains incorrect.

I've only ran this against Internet Explorer 8 and Chrome 21.0.1180.79. Thanks for your time!

jsFiddle:

http://jsfiddle.net/yVe4H/1/

Attachments (0)
Change History (6)

Changed August 21, 2012 12:24AM UTC by dmethvin comment:1

component: unfiledtraversing
milestone: None1.8.1
priority: undecidedblocker
status: newopen

Confirmed. Here's an updated fiddle: http://jsfiddle.net/dmethvin/yVe4H/2/

Changed August 27, 2012 04:07PM UTC by timmywil comment:2

component: traversingselector
resolution: → duplicate
status: openclosed

Duplicate of #12205.

Changed September 14, 2012 04:41AM UTC by gibson042 comment:3

milestone: 1.8.11.8.2
priority: blockerhigh
resolution: duplicate
status: closedreopened

Changed September 14, 2012 04:42AM UTC by gibson042 comment:4

owner: → gibson042
status: reopenedassigned

Changed September 17, 2012 04:44PM UTC by dmethvin comment:5

#12474 is a duplicate of this ticket.

Changed September 19, 2012 04:04PM UTC by Timmy Willison comment:6

resolution: → fixed
status: assignedclosed

Update Sizzle: fix position caching with child selectors. Fixes #12337.

Changeset: 99f4825707e2bf6f19598a00f53d58ef3878190c