Bug Tracker

Ticket #13331 (closed bug: fixed)

Opened 18 months ago

Last modified 14 months ago

jQuery.fn.add returns incorrect order in Chrome and Safari

Reported by: riscarrott@… Owned by: gibson042
Priority: blocker Milestone: 1.10/2.0
Component: selector Version: 1.9.0
Keywords: Cc:
Blocking: Blocked by:

Description

When using jQuery.fn.add with items outside of the document the ordering is incorrect in Chrome and Safari.

 http://jsfiddle.net/M9EYX/3/

Chrome returns in random order and Safari returns in reverse order.

I'm not actually sure if 'add' promises to maintain any logical order when elements aren't in the document but this didn't happen in jQuery 1.8.3 or below.

Discovered in Chrome 24.0.1312.56 m and Safari 5.1.7 on Windows 7.

Firefox 18.0.1 and IE 9 on Win 7 do not present this behavior.

Change History

comment:1 Changed 18 months ago by anonymous

I should have noted it only happens when the one of the jQuery objects contains more than 10 elements.

And to rule out jQuery.fn.clone being the culprit:  http://jsfiddle.net/M9EYX/4/

comment:2 Changed 18 months ago by riscarrott@…

Taking a closer look at this and it appears the bug is with Sizzle.uniqueSort

comment:3 Changed 18 months ago by gibson042

  • Owner set to gibson042
  • Priority changed from undecided to blocker
  • Status changed from new to assigned
  • Component changed from unfiled to selector
  • Milestone changed from None to 1.9.1

comment:4 Changed 18 months ago by Timmy Willison

  • Status changed from assigned to closed
  • Resolution set to fixed

Update Sizzle: detached node sorting in Webkit. Fixes #13331.

Changeset: 21c7a056e23cd30716db75a62fc7ad7dd23a334b

comment:5 Changed 18 months ago by Timmy Willison

Update Sizzle: detached node sorting in Webkit. Fixes #13331.

Changeset: a8518c3bc4e1a8755c2d3a7be624b0e86be1070b

comment:6 Changed 18 months ago by dmethvin

  • Milestone changed from 1.9.1 to 1.9.2

comment:7 Changed 18 months ago by mkwst@…

comment:8 Changed 17 months ago by gibson042

#13505 is a duplicate of this ticket.

comment:9 Changed 14 months ago by dmethvin

  • Milestone changed from 1.9.2 to 1.10/2.0

Bulk update to milestone 1.10/2.0

Note: See TracTickets for help on using tickets.