Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#8220 closed bug (fixed)

is() bug on namespaced tag

Reported by: raid3n Owned by: jitter
Priority: high Milestone: 1.5.1
Component: selector Version: 1.5
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by jitter)

Hi,

var html = "<xsd\:element>";
alert($(html).is("xsd\\:element"));

Outputs: Chrome: true Opera, Firefox: false

Solution: alert($(html).get(0).nodeName.toLowerCase() == "xsd\:element");

Regards, Andrea

Change History (4)

comment:1 Changed 7 years ago by raid3n

this is the example: http://jsfiddle.net/nBRHb/

comment:2 Changed 7 years ago by jitter

Component: unfiledselector
Milestone: 1.next1.5.1
Owner: set to jitter
Priority: undecidedhigh
Status: newassigned

comment:3 Changed 7 years ago by Anton M

Resolution: fixed
Status: assignedclosed

Pull over tests from Sizzle. "Remove backslashes from tag name filter. Fixes #8220."

Changeset: f56b4a22a6cf37b3764939b0338bb545fa6b445f

comment:4 Changed 7 years ago by jitter

Description: modified (diff)

I fixed this for the XMLDocument case. e.g. when loading xml via ajax from server or when using jQuery.parseXML .

The use case as outlined in the report isn't supported at the moment. As you can't pass arbitrary xml string to $( html ). If that works is mainly browser dependent and fails in most versions of IE. Also the differences between the browsers probably derive from the fact that the DOM Level 1 method getElementsByTag handles namespaced tagnames differently across browsers. For further info check #7583 and #6491 or just search the bug tracker for namespace, xml related tickets.

Note: See TracTickets for help on using tickets.