Bug Tracker

Opened 10 years ago

Closed 8 years ago

Last modified 7 years ago

#3729 closed bug (fixed)

Attribute selector with an class seperator(':') in it, fails.

Reported by: Dykam Owned by: jitter
Priority: high Milestone: 1.5
Component: selector Version: 1.5rc1
Keywords: attribute selector class Cc:
Blocked by: Blocking:

Description

This code fails: $('[xml:lang="nl"]'); While this works: $('[id="someID"]');

I needed this because when validating the html attribute lang="", the validator tells me I need xml:lang="".

Change History (12)

comment:2 Changed 10 years ago by balazs.endresz

In 1.3.0 when escaping the colon the backslash isn't removed from match[1]. Looks like the same as #3803.

comment:3 Changed 10 years ago by john

Milestone: 1.31.3.1
Owner: set to john
Version: 1.2.61.3

Ok, I'll check in to it.

comment:4 Changed 10 years ago by john

Resolution: fixed
Status: newclosed

Ok, should be fixed now. http://github.com/jeresig/sizzle/commit/380f65bfa72febab01effc0414b0c052f63a2a25

Will be merging into jQuery shortly.

comment:5 Changed 10 years ago by larholm

Resolution: fixed
Status: closedreopened

jQuery 1.3.1 - I am still unable to use a selector for attributes with : in their name, such as in namespaced attributes.

Here is a simple testcase:

<a href="somewhere.html" test:ajax="json">test</a>

$('a[test
:ajax]')

No elements matched.

comment:6 Changed 10 years ago by michaelmaw

I am using jQuery 1.3.2 and this works fine in Firefox, but fails in IE (tested using IE 7).

Example: <div my:tooltip="Show this"></div>

jQuery: $('div[my
:tooltip]')

IE error: "Object doesn't support this property or method"

comment:7 Changed 10 years ago by balazs.endresz

I've had a quick look at it and it seems like the ATTR prefilter removes the backslash but it appears again in filter.ATTR! Moreover, if you call $('div[my\\:tooltip]') instead of $('div[my\\:tooltip="Show this"]') then filter.ATTR isn't even called, is that OK?

comment:8 Changed 9 years ago by snover

Status: reopenedpending

This ticket has been marked as missing a test case. In an effort to reduce the number of outstanding tickets in the bug tracker, it will be closed automatically in 30 days. In order to prevent this from happening, please provide a working test case. If a test case has already been provided and our records are wrong, please respond to the ticket so that it can be fixed. Thank you!

comment:9 Changed 8 years ago by trac-o-bot

Status: pendingclosed

Automatically closed due to 14 days of inactivity.

comment:10 Changed 8 years ago by jitter

Milestone: 1.3.11.5
Priority: majorhigh
Status: closedreopened
Version: 1.31.5rc1

The orignal fix for this seems to be a no-op.

test case

comment:11 Changed 8 years ago by jitter

Owner: changed from john to jitter
Status: reopenedassigned

comment:12 Changed 8 years ago by Anton M

Resolution: fixed
Status: assignedclosed

Pull over tests from Sizzle. Fixes #3729. Fixes #6428.

Changeset: 1e4f3c07c70861fc334a0e61080f8bbde0d7d442

Note: See TracTickets for help on using tickets.