Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 5 years ago

#3924 closed bug (fixed)

(nth/first/last)-child selector bug

Reported by: LosT Owned by:
Priority: major Milestone: 1.3.1
Component: selector Version: 1.3
Keywords: Cc:
Blocked by: Blocking:

Description

Manipulating the dom after *-child selector may break sequent *-child selectors if the number of childs remains the same.

---

I think this is caused by caching in filter.CHILD, here: var doneName = "child" + parent.childNodes.length;

Changing it to var doneName = match[0];

(which i saw is set in preFilter.CHILD) should fix the problem.

Also, parent.childNodes.length is painfully slow on explorer. This change should speed up IE (and slow down the other browsers).

Attachments (1)

test2.html (479 bytes) - added by LosT 9 years ago.
Test case

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by LosT

Attachment: test2.html added

Test case

comment:1 Changed 9 years ago by john

Component: unfilledselector
Resolution: fixed
Status: newclosed

Thanks for the test case, I just fixed this in SVN rev [6147].

Note: See TracTickets for help on using tickets.