Skip to main content

Bug Tracker

Side navigation

#14142 closed bug (fixed)

Opened July 17, 2013 09:44AM UTC

Closed July 19, 2013 01:55PM UTC

Last modified October 08, 2013 01:12PM UTC

Wrong number of elements returned in XML document with numeric IDs in Safari

Reported by: vibes@nothing.ch Owned by: gibson042
Priority: low Milestone: 1.11/2.1
Component: selector Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:
Description

In a very special case ''find'' returns the wrong number of elements when used on an XML document with elements that have numeric ids. The exact conditions for this bug to occur are:

  • Safari only
  • The selector used is of the form "''parent children''"
  • One of the children has an id attribute with the value corresponding to the number of children

For a detailed example see: http://jsfiddle.net/fHs96/10/

The same bug probably also occurs on HTML documents (HTML5 allows numeric ids).

Attachments (0)
Change History (8)

Changed July 17, 2013 03:25PM UTC by gibson042 comment:1

owner: → gibson042
status: newassigned

You've certainly hit an interesting corner case... we use an unusual iteration pattern because <NodeList>.length is unreliable on Internet Explorer (allowing elements with id "length" to mask the numeric property), but this shows that <NodeList>[<index>] is similarly unreliable on Safari.

Changed July 17, 2013 05:34PM UTC by gibson042 comment:2

Changed July 18, 2013 08:56AM UTC by vibes@nothing.ch comment:3

Nice, thanks for the quick fix!

Changed July 19, 2013 01:55PM UTC by Timmy Willison comment:4

resolution: → fixed
status: assignedclosed

Update Sizzle to 1.10.5. Fixes #14142.

Changeset: 0600a29256be76bd87adb547545bf7219fafb6ee

Changed August 26, 2013 04:50PM UTC by gibson042 comment:5

#14141 is a duplicate of this ticket.

Changed September 20, 2013 12:10AM UTC by dmethvin comment:6

milestone: None1.11/2.1

Changed September 20, 2013 12:20AM UTC by dmethvin comment:7

component: unfiledselector
priority: undecidedlow

Changed October 08, 2013 01:12PM UTC by gibson042 comment:8

#13058 is a duplicate of this ticket.