Side navigation
#5482 closed bug (duplicate)
Opened November 10, 2009 05:40PM UTC
Closed July 11, 2011 08:12PM UTC
Last modified March 10, 2012 10:10AM UTC
Sizzle pseudo-selectors blow up with nested brackets
Reported by: | jakkob | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.next |
Component: | selector | Version: | 1.4.4 |
Keywords: | find crash bracket parenthesis has contains | Cc: | |
Blocked by: | Blocking: |
Description
Using a bracket ')' in the contains filter crashes firefox.
Escaping the bracket by '\\\\' or by '\\' does not work, either. Neither the bracing or omitting of "" around the contains expression helps.
To test this, I copied the souce from http://en.wikipedia.org/wiki/Banana
to my server and addded following to the header.
<script>
$(document).ready(function(){
var exp = ':contains("fleshy edible inner portion \\\\)")';
var pos = $('body').find(exp);
console.log(pos);
})
</script>
It will always reproduce the error, which according to my browser in in line 1585 of jquery-1.3.2
The current nightly crashes exactly the same.
A solution would be greatly appreciated!
thx
Attachments (1)
Change History (15)
Changed November 13, 2009 07:03PM UTC by comment:1
Changed November 13, 2009 07:03PM UTC by comment:2
It seems to me the error only occurs if the bracket is at the very end of the expression.
Changed June 13, 2010 06:30PM UTC by comment:3
component: | unfiled → selector |
---|
Changed October 06, 2010 12:54AM UTC by comment:4
resolution: | → worksforme |
---|---|
status: | new → closed |
Current versions of Firefox 3.6 do not crash.
Changed November 16, 2010 04:35PM UTC by comment:5
i have example when it dont work. On IE8, chrome7, mozila3.6, opera 10.6
<html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("p:contains('is')").css("background-color","red"); $("p:contains('(is)')").css("background-color","yellow"); $("p:contains('(is')").css("background-color","green"); }); </script> </head> <body> <p class="intro">1) My name is Donald</p> <p>2) I live in Duckburg</p> <p>3) My best friend (is) Mickey</p> </body> </html>
when there is two brackets all works, but with one no.
No matter i add one slashes or two
Changed November 16, 2010 04:38PM UTC by comment:6
example - http://jsfiddle.net/MC2e7/
Changed November 19, 2010 09:48AM UTC by comment:7
keywords: | find crash bracket → find crash bracket parenthesis has contains |
---|---|
priority: | major → high |
resolution: | worksforme |
status: | closed → reopened |
summary: | -find(':contains("something with bracket )" ')- crashes firefox 3.5.3 → pseudo-selector matching for close brackets is wrong |
version: | 1.3.2 → 1.4.4 |
Changed November 19, 2010 09:48AM UTC by comment:8
status: | reopened → open |
---|---|
summary: | pseudo-selector matching for close brackets is wrong → Sizzle pseudo-selectors blow up with nested brackets |
Changed November 19, 2010 10:05AM UTC by comment:10
Changed November 19, 2010 10:06AM UTC by comment:11
#5607 is a duplicate of this ticket.
Changed November 19, 2010 10:59AM UTC by comment:12
#6322 is a duplicate of this ticket.
Changed March 31, 2011 04:53AM UTC by comment:13
milestone: | → 1.next |
---|
Changed July 11, 2011 08:12PM UTC by comment:14
resolution: | → duplicate |
---|---|
status: | open → closed |
Changed July 11, 2011 08:12PM UTC by comment:15
Duplicate of #3778.
I also added a complete testcase now in which I did only what I wrote at the top: Copied the source from http://en.wikipedia.org/wiki/Banana, added the script (in line 80ff).