Bug Tracker

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#13420 closed bug (fixed)

jQuery 1.9.1 fails to filter SVG parent nodes by class name when using .parent() and .closest()

Reported by: brad@… Owned by:
Priority: low Milestone: 1.10/2.0
Component: selector Version: git
Keywords: Cc:
Blocked by: Blocking:

Description

When using the parent and closest methods to walk up an SVG DOM tree in jQuery 1.9.1, filtering by selector does not work.

http://jsfiddle.net/DruHG/

It looks *possible* Sizzle changed their XML element detection...

Change History (6)

comment:1 Changed 4 years ago by gibson042

  • Component changed from unfiled to selector
  • Priority changed from undecided to low
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #12626.
SVG is not HTML; use [class~="name"]: http://jsfiddle.net/DruHG/3/

comment:2 Changed 4 years ago by anonymous

Thank you, I do understand this.

It is strange that maintaining a predictable API is taking a back seat here.

I went through the duplicates, this issue is re-occurring and this XML feature seems to appear and disappear in various jQuery versions. It works one day and not the next with "wont fix" as the resolution. Why not just fix it?

My bad for the duped report though. Appreciate you guys.

comment:3 Changed 4 years ago by gibson042

  • Milestone changed from None to 1.9.2
  • Resolution duplicate deleted
  • Status changed from closed to reopened

I understand and appreciate that viewpoint, but SVG support is peripheral to our primary purpose with jQuery core and thus not guaranteed, though we do incorporate fixes on a case-by-case basis when their size/performance impact is sufficiently small.

The jQuery SVG plugin attempts to provide better support, and you'll be happy to note that your particular application is in fact functional with the latest Sizzle update via jquery-git: http://jsfiddle.net/DruHG/4/

comment:4 Changed 4 years ago by gibson042

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

comment:5 Changed 4 years ago by brad@…

This is excellent. I appreciate your time.

comment:6 Changed 3 years ago by dmethvin

  • Milestone changed from 1.9.2 to 1.10/2.0

Bulk update to milestone 1.10/2.0

Note: See TracTickets for help on using tickets.