Side navigation
#10270 closed bug (fixed)
Opened September 13, 2011 10:47PM UTC
Closed June 19, 2012 03:00PM UTC
(any) attribute selector does not match if value contains '\\'
Reported by: | mamille2@cisco.com | Owned by: | timmywil |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | selector | Version: | 1.6.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If an attribute selector value contains '\\', it will never match. For instance, given the following input DOM:
#!xml <message xmlns='jabber:client' type='groupchat' from='some\\20room@conference.example.com/juliet' to='romeo@montegue.net/garden'> <body></body> </message>
The following selector fails with 1.6.3 (but works with 1.4.4):
#!java $(dom.ownerDocument).find("message[from^='some\\20room@conference.example.com']")
- jQuery-1.6.3: returns []
- jQuery-1.4.4: returns [dom]
Also tried "=", "*=", "~=", "$=", and "|=" with the same results ("!=" with jQuery-1.6.3 returning [dom] and 1.4.4 returning []).
Attachments (0)
Change History (7)
Changed September 14, 2011 01:10PM UTC by comment:1
Changed September 15, 2011 01:37PM UTC by comment:2
Sorry, forgot to add platforms affected:
- Chrome 13
- Safari 5.1
- Firefox 6
- IE 8
- IE 9
Changed September 17, 2011 12:29PM UTC by comment:3
component: | unfiled → selector |
---|---|
owner: | → mamille2@cisco.com |
priority: | undecided → low |
status: | new → pending |
Thanks for submitting a ticket to the jQuery bug tracker. Could you kindly also submit a complete test case on jsFiddle.net that reproduces all of the behaviour you've described? If you can ensure that it covers any of the cases you've mentioned this will make it easier for us to evaluate and confirm the issue across multiple browsers before we discuss how to correct it.
Changed September 19, 2011 03:06PM UTC by comment:4
status: | pending → new |
---|
jsFiddle test case at <http://jsfiddle.net/HFx3e/1/>.
Also, a potential patch to Sizzle available at <https://github.com/jquery/sizzle/pull/72>.
Changed September 20, 2011 04:55PM UTC by comment:5
milestone: | None → 1.next |
---|---|
status: | new → open |
Changed June 19, 2012 06:49AM UTC by comment:6
owner: | mamille2@cisco.com → timmywil |
---|---|
status: | open → assigned |
It appears that the various preFilter functions unconditionally remove '\\' from all parts of the expression, regardless of what follows or in what part of the expression it is.