Side navigation
#10791 closed bug (wontfix)
Opened November 15, 2011 12:36PM UTC
Closed July 11, 2012 09:51PM UTC
Last modified January 22, 2013 05:56PM UTC
Delegated Events fail on SVG elements
Reported by: | rodneyrehm | Owned by: | gibson042 |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | event | Version: | 1.7 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Using delegated events on embedded SVG has an error regarding class selectors (possibly other selectors, too). This used to work with jQuery 1.6.4.
http://jsfiddle.net/rodneyrehm/ydmXA/ - working jQuery 1.6.4
http://jsfiddle.net/rodneyrehm/cm9Gv/ - failing jQuery 1.7
Attachments (0)
Change History (9)
Changed November 15, 2011 03:15PM UTC by comment:1
component: | unfiled → event |
---|---|
milestone: | None → 1.7.1 |
owner: | → dmethvin |
priority: | undecided → low |
status: | new → assigned |
Changed November 16, 2011 03:57AM UTC by comment:2
To continue timmywil's line of thought:
http://jsfiddle.net/dmethvin/mzjEY/
el.attributes['class'].value
seems to work all the way back to IE6; you'll need to comment out a few lines for it to run in IE6/7.
Unfortunately we probably need to check el.attributes && el.attributes['class'] && el.attributes['class'].value
to be safe.
Did I mention I hate SVG?
Changed November 16, 2011 03:36PM UTC by comment:3
resolution: | → fixed |
---|---|
status: | assigned → closed |
Fix #10791. SVG clamors for special treatment of its class names.
Changeset: 780c59b89d3b7fb9bcc480aa3173693a9d633853
Changed July 11, 2012 07:57PM UTC by comment:4
milestone: | 1.7.1 |
---|---|
resolution: | fixed |
status: | closed → reopened |
Changed July 11, 2012 08:28PM UTC by comment:5
_comment0: | https://github.com/jquery/jquery/pull/857 \ \ Please use "[class=foo]" with SVG elements → 1342040675126321 |
---|---|
_comment1: | https://github.com/jquery/jquery/pull/857 \ \ Please use "[class='foo']" with SVG elements → 1354889705530708 |
owner: | dmethvin → gibson042 |
status: | reopened → assigned |
https://github.com/jquery/jquery/pull/857
Please use "[class~='foo']" with SVG elements
Edit: corrected selector
Changed July 11, 2012 09:51PM UTC by comment:6
_comment0: | For the browsers where `.foo` wouldn't work, `[class=foo]` should work. → 1360353797245153 |
---|---|
resolution: | → wontfix |
status: | assigned → closed |
For the browsers where .foo
wouldn't work, [class~=foo]
should work.
Changed January 22, 2013 04:20PM UTC by comment:8
just for those wondering like I did,
jQuery don't plan on fixing any issue related to SVG/XML/VML:
http://docs.jquery.com/Won%27t_Fix#SVG.2FXML.2FVML_Bugs
and the workaround ~= might be problematic is some cases ([class~='selected'] also matches class="unselected")
Changed January 22, 2013 05:56PM UTC by comment:9
Replying to [comment:8 BiAiB]:
the workaround ~= might be problematic is some cases ([class~='selected'] also matches class="unselected")
No, ~=
treats attribute values as space-separated lists and checks for an exact match.
http://www.w3.org/TR/CSS21/selector.html#pattern-matching
Possible solution for quickIs:
We'll look into it.