Bug Tracker

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#3023 closed enhancement (fixed)

[@attribute] selector breaks on attributes with namespaces

Reported by: wagich Owned by: flesler
Priority: major Milestone: 1.3
Component: selector Version: 1.2.6
Keywords: namespace attribute Cc:
Blocked by: Blocking:

Description

The first regex in jquery.parse matches a selector like [@ns:foo] or [@ns:foo='bar'] incorrectly.

Instead of having

^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]

the regex should allow for the namespace-delimiter ":" in the attribute name

^(\[) *@?([\w:-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]

This fixes the namespace-bug, but I didn't check for any side-effects concerning any css-style selectors.

Change History (3)

comment:1 Changed 12 years ago by flesler

Owner: set to flesler
Status: newassigned
Type: bugenhancement

Ok seems useful and an easy change. There're some known issues with ':' attributes on tables, but that's another problem.

Could you provide a small example with this situation and both jQuerys (original and modified) included ? Use noConflict() and use both versions.

So we can test this right away :)

Thanks a bunch

comment:2 Changed 11 years ago by flesler

Resolution: fixed
Status: assignedclosed

Fixed at [5796].

comment:3 Changed 11 years ago by jan.vanderve

I've implemented this fix in my local version of the minified jQuery 1.2.6 file, and the fix works perfectly on Firefox. When I run the following code on IE 7, however, I get an error message:

$('[greetz:validation]')

The error is in Dutch, so I'm not sure if the translation is accurate:

Line 25: Invalid procedure call or invalid argument

Note: See TracTickets for help on using tickets.