Bug Tracker

Opened 11 years ago

Closed 11 years ago

#12237 closed bug (fixed)

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

Reported by: r.osenkonstantinov@… Owned by: Timmy Willison
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/

Change History (11)

comment:1 Changed 11 years ago by gibson042

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

comment:2 Changed 11 years ago by gibson042

Status: newopen

comment:3 Changed 11 years ago by gibson042

Component: unfiledselector

comment:4 Changed 11 years ago by Timmy Willison

#12238 is a duplicate of this ticket.

comment:5 Changed 11 years ago by Timmy Willison

Milestone: None1.8.1
Owner: set to Timmy Willison
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.

comment:6 Changed 11 years ago by Timmy Willison

@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.

comment:7 Changed 11 years ago by gibson042

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: `''ERROR!!''`

comment:8 Changed 11 years ago by gibson042

#12268 is a duplicate of this ticket.

comment:9 Changed 11 years ago by gibson042

#12245 is a duplicate of this ticket.

comment:10 Changed 11 years ago by Timmy Willison

#12375 is a duplicate of this ticket.

comment:11 Changed 11 years ago by Timmy Willison

Resolution: fixed
Status: assignedclosed

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

Changeset: b2698928bbdc1b247cb6de28e9b2624ec6b56667

Note: See TracTickets for help on using tickets.