Skip to main content

Bug Tracker

Side navigation

#12237 closed bug (fixed)

Opened August 10, 2012 07:59AM UTC

Closed August 24, 2012 09:44PM UTC

Having child selector and multiple :not with :visible does not work any more

Reported by: r.osenkonstantinov@gmail.com Owned by: timmywil
Priority: low Milestone: 1.8.1
Component: selector Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:
Description

Having selector similar to the following does not work after update to 1.8.0:

"tr:not(.foo):visible > td:not(.bar)"

Here you can find a simple repro of the issue:

http://jsbin.com/itexol/1/

Attachments (0)
Change History (11)

Changed August 10, 2012 12:55PM UTC by gibson042 comment:1

Confirmed. I suspect this is a duplicate of #12205, and at any rate it would be fixed by that pull: https://github.com/jquery/sizzle/pull/139

Changed August 10, 2012 01:01PM UTC by gibson042 comment:2

status: newopen

Changed August 10, 2012 01:01PM UTC by gibson042 comment:3

component: unfiledselector

Changed August 10, 2012 03:16PM UTC by timmywil comment:4

#12238 is a duplicate of this ticket.

Changed August 10, 2012 03:18PM UTC by timmywil comment:5

milestone: None1.8.1
owner: → timmywil
priority: undecidedlow
status: openassigned

We can address both of these selectors with one ticket.

Test from the other ticket: http://jsbin.com/orohus/1

I don't think this is a duplicate of #12205. It looks like an issue with :not's argument with respect to parens.

Changed August 10, 2012 03:29PM UTC by timmywil comment:6

@gibson042:

I have a clearer understanding of what you were trying to say about the regex vs. context-free grammar issue (got a whole bunch of flashbacks from CS classes ;)), but there are several ways that Sizzle should treat pseudo arguments that we are not doing. They are all minor, but I think we can do it (including support for this selector). I'm going to take a pass and see if I come up with something similar to what you've already done, just to attempt tackling from another direction. One of my goals is to make sure that tokenize is only called at most once in any given codepath.

Changed August 10, 2012 04:58PM UTC by gibson042 comment:7

I'm firmly with the noble goal of one tokenize per selector (well, probably at minimum one tokenize per selector plus one per :not—if not one per pseudo), but hate the idea of supporting something as ambiguous as :contains((unquoted) parentheses), in large part because it makes parsing so brittle (e.g., is :contains(1)) equivalent to :contains("1)") or (''ERROR!!'') :contains("1"))?).

Either way, https://github.com/jquery/sizzle/pull/139 is probably a good start and I think rselector is doomed. Please keep me updated so we can hash it out before it gets committed to master.

''WikiFormatting error deliberately left in for ironic effect:

''

Changed August 12, 2012 01:09PM UTC by gibson042 comment:8

#12268 is a duplicate of this ticket.

Changed August 12, 2012 01:11PM UTC by gibson042 comment:9

#12245 is a duplicate of this ticket.

Changed August 22, 2012 06:06PM UTC by timmywil comment:10

#12375 is a duplicate of this ticket.

Changed August 24, 2012 09:44PM UTC by Timmy Willison comment:11

resolution: → fixed
status: assignedclosed

Update Sizzle: Use tokenization rather than regex for grouping. Fixes #12237, #12205, #12285.

Changeset: b2698928bbdc1b247cb6de28e9b2624ec6b56667