Bug Tracker

Ticket #8220 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

is() bug on namespaced tag

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

Description (last modified by jitter) (diff)

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

comment:1 Changed 4 years ago by raid3n

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

comment:2 Changed 4 years ago by jitter

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

comment:3 Changed 4 years ago by Anton M

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

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

Changeset: f56b4a22a6cf37b3764939b0338bb545fa6b445f

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