Bug Tracker

Ticket #11814 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Sizzle's element-rooted QSA strategy (i.e. attaching a temporary id) does not account for comma and other other selector divisions

Reported by: timmywil Owned by: timmywil
Priority: high Milestone: 1.8
Component: selector Version: 1.7.2
Keywords: Cc:
Blocking: Blocked by:


This has been a known issue for a while, but I don't see a ticket specifically for this. We recently received this pull:  https://github.com/jquery/sizzle/pull/104. Unfortunately, the issue is more complicated than just accounting for commas for a couple reasons.

  • There are several other ways a selector can have multiple divisions. Comma is the most common, but several pseudo selectors and perhaps others can also have this effect.
  • escaped commas are valid in selectors.

I'm going to take a crack at this as well for 1.8.

Change History

comment:1 Changed 3 years ago by timmywil

  • Owner set to timmywil
  • Priority changed from undecided to high
  • Status changed from new to assigned
  • Component changed from unfiled to selector
  • Milestone changed from None to 1.8

comment:2 Changed 3 years ago by Igin

This issue exists from 1.4.3 to 1.7.2

comment:3 Changed 3 years ago by timmywil

Woops, looks like I was the one who created a ticket on this matter and didn't see it. This ticket has a better description, but here is the test case from that ticket.  http://jsfiddle.net/timmywil/tDgXy/

comment:4 Changed 3 years ago by timmywil

#10525 is a duplicate of this ticket.

comment:5 Changed 3 years ago by timmywil

#11842 is a duplicate of this ticket.

comment:6 Changed 3 years ago by timmywil

I had the :not selector in mind when I was thinking of pseudos that create selector divisions, but it turns out :not only accepts simple selectors by spec (meaning no other divisions allowed). Having gone through this list( http://www.w3.org/TR/selectors/#selectors), comma seems to be the only acceptable division. Landing a fix now.

comment:7 Changed 3 years ago by timmywil

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

Update Sizzle: adds selector divisions for element-rooted QSA in the Dupont strategy. Fixes #11814.

Changeset: ccffddd89b5fd6ce9388d1db52361c59649b132a

Note: See TracTickets for help on using tickets.