Bug Tracker

Ticket #12237 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

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

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

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

comment:1 Changed 2 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 2 years ago by gibson042

  • Status changed from new to open

comment:3 Changed 2 years ago by gibson042

  • Component changed from unfiled to selector

comment:4 Changed 2 years ago by timmywil

#12238 is a duplicate of this ticket.

comment:5 Changed 2 years ago by timmywil

  • Owner set to timmywil
  • Priority changed from undecided to low
  • Status changed from open to assigned
  • Milestone changed from None to 1.8.1

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 2 years ago by timmywil

@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 2 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 2 years ago by gibson042

#12268 is a duplicate of this ticket.

comment:9 Changed 2 years ago by gibson042

#12245 is a duplicate of this ticket.

comment:10 Changed 2 years ago by timmywil

#12375 is a duplicate of this ticket.

comment:11 Changed 2 years ago by Timmy Willison

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

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

Changeset: b2698928bbdc1b247cb6de28e9b2624ec6b56667

Note: See TracTickets for help on using tickets.