Bug Tracker

Ticket #12856 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

Syntax error, unrecognized expression in jquery 1.8+

Reported by: pedro.rainho@… Owned by: timmywil
Priority: low Milestone: 1.9
Component: selector Version: 1.8.0
Keywords: Cc:
Blocking: Blocked by:

Description

This is an error that happen in ipad and when I run this selector

$headers.filter(':not([colspan])[data-column="' + i + '"]:last,[colspan="1"][data-column="' + i + '"]:last')

I have the error

Syntax error, unrecognized expression :not([colspan])[data-column="0"]:last,[colspan="1"][data-column="0"]:last

I've tested with Jquery 1.8.2:  http://jsfiddle.net/W8Mm3/2/ I've tested with Jquery 1.8.1:  http://jsfiddle.net/W8Mm3/ I've tested with Jquery 1.8.0:  http://jsfiddle.net/W8Mm3/3 Both have the same error:

I've tested with Jquery 1.7:  http://jsfiddle.net/W8Mm3/1/ I've tested with Jquery 1.7.1:  http://jsfiddle.net/W8Mm3/4/ I've tested with Jquery 1.7.2:  http://jsfiddle.net/W8Mm3/5/ And I don't have that error

So the error was introduced in jquery 1.8.0

Change History

comment:1 follow-up: ↓ 4 Changed 2 years ago by timmywil

  • Status changed from new to closed
  • Resolution set to worksforme
  • Component changed from unfiled to selector

There's too much going on in the tests. When reduced, I am unable to reproduce:

 http://jsfiddle.net/timmywil/W8Mm3/21/

comment:2 Changed 2 years ago by dmethvin

Looks like it's this bug, not sure if it's been fixed or not:  https://github.com/Mottie/tablesorter/issues/132

Also it's not clear to me why it would only affect Safari?? I don't have an iPad handy but I can't repro on desktop Safari 5.1.

comment:3 Changed 2 years ago by Pedro Rainho <pedro.rainho@…>

I've wrote "This is an error that happen in ipad"

It doesn't happen in pc browsers.

Also I don't know why someone close the bug and didn't bother to test it well.

Mr. timmywil using you demo:  http://jsfiddle.net/timmywil/W8Mm3/21/

The error HAPPEN in IPAD 1 - version IOS 5

Did you even test it?

comment:4 in reply to: ↑ 1 Changed 2 years ago by Pedro Rainho <pedro.rainho@…>

Replying to timmywil:

There's too much going on in the tests. When reduced, I am unable to reproduce:

 http://jsfiddle.net/timmywil/W8Mm3/21/

Did you even test you demo in ipad? I've test it and the error happen. Please re-open the bug.

comment:5 Changed 2 years ago by timmywil

  • Priority changed from undecided to high
  • Status changed from closed to reopened
  • Resolution worksforme deleted
  • Milestone changed from None to 1.8.3

Sorry, I didn't see the "in ipad". It does seem ridiculous that this would only be a problem in Safari.

comment:6 Changed 2 years ago by timmywil

  • Priority changed from high to low
  • Status changed from reopened to open

_mobile_ Safari even. However, I don't see the issue in iOS 6.0 ( http://cl.ly/image/0Z2e3t0i3b3z). My guess is that there was a bug in mobile Safari.

comment:7 Changed 2 years ago by Pedro Rainho <pedro.rainho@…>

This problem doesn't happen on pc safari and I can't see if it happen in ios 6 since I don't have an ipad2+. I do know that happen in ios 5 (ipad1).

Yesterday me and the author of tablesorter we manage to split the selector in parts

from this: h = $headers.filter(':not([colspan])[data-column="' + i + '"]:last,[colspan="1"][data-column="' + i + '"]:last')

to this: h = $headers.filter(':not([colspan])');

h = h

.add( $headers.filter('[colspan="1"]') ) ie8 fix .filter('[data-column="' + i + '"]:last');

And for now it's working. I start doing this because I also had other errors with long selectors and the solution was divide the selector in parts.

comment:8 Changed 2 years ago by Pedro Rainho <pedro.rainho@…>

I've tested with Ipad 2 and this doesn't happen. So it's a bug in ipad 1 IOS 5

comment:9 Changed 2 years ago by dmethvin

  • Milestone changed from 1.8.3 to 1.9

comment:10 Changed 2 years ago by timmywil

  • Owner set to timmywil
  • Status changed from open to assigned

comment:11 Changed 2 years ago by Richard Gibson

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

Fix #12856: keep PSEUDO regex non-greedy

Changeset: 3ab26340dcdf001da4e93df2f187a8343615673c

comment:12 Changed 2 years ago by timmywil

Can we fix it so that the bot gives us a real link to the changeset?

Note: See TracTickets for help on using tickets.