Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 6 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 6 years ago by raid3n

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

comment:2 Changed 6 years ago by jitter

  • Component changed from unfiled to selector
  • Milestone changed from 1.next to 1.5.1
  • Owner set to jitter
  • Priority changed from undecided to high
  • Status changed from new to assigned

comment:3 Changed 6 years ago by Anton M

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Changeset: f56b4a22a6cf37b3764939b0338bb545fa6b445f

comment:4 Changed 6 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.