Skip to main content

Bug Tracker

Side navigation

#3023 closed enhancement (fixed)

Opened June 11, 2008 12:03PM UTC

Closed July 28, 2008 04:35PM UTC

Last modified October 16, 2008 11:48PM UTC

[@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.

Attachments (0)
Change History (3)

Changed June 11, 2008 10:17PM UTC by flesler comment:1

owner: → 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

Changed July 28, 2008 04:35PM UTC by flesler comment:2

resolution: → fixed
status: assignedclosed

Fixed at [5796].

Changed October 16, 2008 11:48PM UTC by jan.vanderve comment:3

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