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 comment:1
owner: | → flesler |
---|---|
status: | new → assigned |
Changed July 28, 2008 04:51PM UTC by comment:2
/\\s*,?\\s*/ will match ANYTHING...
Changed July 28, 2008 04:51PM UTC by comment:3
component: | core → selector |
---|---|
need: | Review → Patch |
Changed July 29, 2008 05:20PM UTC by 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 comment:6
resolution: | → fixed |
---|---|
status: | assigned → closed |
This is fixed in 1.3