Skip to main content

Bug Tracker

Side navigation

#3137 closed bug (fixed)

Opened July 07, 2008 01:28PM UTC

Closed February 07, 2009 03:26AM UTC

Complex selectors breaking .parents() method

Reported by: eduardo Owned by: flesler
Priority: major Milestone: 1.3
Component: selector Version: 1.2.6
Keywords: Cc:
Blocked by: Blocking:
Description

If you try to do:

$('body').parents('#fakeId div'); 

this query should returns 0 elements, but this returns the <html> node.

I found probably a bug on multiFilter method on core, the regex is breaking some selectors.

old regex:

expr = f.t.replace(/^\\s*,\\s*/, "" );

fix for this bug:

expr = f.t.replace(/^\\s*,?\\s*/, "" );

I write a selector test case, and after this change all selectors has passed.

Anyone can confirm is it okay?

Attachments (3)
Change History (6)

Changed July 07, 2008 11:46PM UTC by flesler comment:1

owner: → flesler
status: newassigned

Changed July 28, 2008 04:51PM UTC by flesler comment:2

/\\s*,?\\s*/ will match ANYTHING...

Changed July 28, 2008 04:51PM UTC by flesler comment:3

component: coreselector
need: ReviewPatch

Changed July 29, 2008 05:19PM UTC by joern comment:4

Related to #2851

Changed July 29, 2008 05:20PM UTC by joern comment:5

description: If you try to do: \ \ $('body').parents('#fakeId div'); \ \ this query should returns 0 elements, but this returns the <html> node. \ \ I found probably a bug on multiFilter method on core, the regex is breaking some selectors. \ \ old regex: \ expr = f.t.replace(/^\\s*,\\s*/, "" ); \ \ fix for this bug: \ expr = f.t.replace(/^\\s*,?\\s*/, "" ); \ \ I write a selector test case, and after this change all selectors has passed. \ \ Anyone can confirm is it okay? \ \ \ If you try to do: \ \ {{{$('body').parents('#fakeId div'); }}} \ \ this query should returns 0 elements, but this returns the <html> node. \ \ I found probably a bug on multiFilter method on core, the regex is breaking some selectors. \ \ old regex: \ {{{expr = f.t.replace(/^\\s*,\\s*/, "" );}}} \ \ fix for this bug: \ {{{expr = f.t.replace(/^\\s*,?\\s*/, "" );}}} \ \ I write a selector test case, and after this change all selectors has passed. \ \ Anyone can confirm is it okay? \ \ \

Changed February 07, 2009 03:26AM UTC by dmethvin comment:6

resolution: → fixed
status: assignedclosed

This is fixed in 1.3