Opened 12 years ago
Closed 12 years ago
#8879 closed bug (wontfix)
attributeHas selector for SVG elements doesn't work in Opera 11+
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | selector | Version: | 1.5.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
attributeHas selector like this: $("[data-property]") doesn't work for SVG elements in Opera. Selector returns empty list. If it is Chrome or FF the selector works. If it is a HTML element the selector works even in Opera.
Here is the test page about this: http://grozdeva.com/test/
About Opera Version information Version 11.10
Build 2092
Platform Linux
System i686, 2.6.35-28-generic
Change History (4)
comment:1 follow-up: 2 Changed 12 years ago by
Component: | unfiled → selector |
---|---|
Owner: | set to [email protected]… |
Status: | new → pending |
comment:2 Changed 12 years ago by
Status: | pending → new |
---|
I managed to reproduce it. It seems that Opera threads different SVG when is in HTML flow or it is dynamically defined with Raphael of jQuery.svg . When SVG is defined inside HTML opera creates HTMLUnknownElement for every SVG element. When SVG is dynamically created OPERA creates SVGCircleElement or whatever you draw. Also I found something I didn't meet at documents. @ selector. For example $("@[data-property]") works fine for both HTMLUnknownElement and SVGCircleElement. What kind of selector is this?
http://jsfiddle.net/efta/FgAuj/5/ http://grozdeva.com/test/
Replying to timmywil:
Thanks for taking the time to contribute to the jQuery project!
I am unable to reproduce this. http://jsfiddle.net/timmywil/uCejg/ works fine and it seems your svg is broken in Opera.
Please provide a reduced test case on http://jsFiddle.net that reproduces the issue experienced to help us assess your ticket. Additionally, test against the
jQuery (edge)
version to ensure the issue still exists.
comment:3 Changed 12 years ago by
I'm not sure what that selector does, but it is not officially supported in jQuery. Also, the big green circle doesn't show up in Opera. Looks like Raphael produces different html. Notice the lack of closing tag on the one not generated.
comment:4 Changed 12 years ago by
Priority: | undecided → low |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
The selector mentioned isn't as such something documented as working, but I've devised a test that (would appear) to work in Firefox with any number of arbitrary characters placed before the attribute selector. http://jsfiddle.net/addyosmani/MPreb/ - it's likely the regex in this case is just capable of ignoring such characters. Regardless, in this particular case I can't see anything that jQuery is doing incorrectly. This very much appears to be an Opera SVG implementation issue that would need to be fixed on their end.
Thanks for taking the time to contribute to the jQuery project!
I am unable to reproduce this. http://jsfiddle.net/timmywil/uCejg/ works fine and it seems your svg is broken in Opera.
Please provide a reduced test case on http://jsFiddle.net that reproduces the issue experienced to help us assess your ticket. Additionally, test against the
jQuery (edge)
version to ensure the issue still exists.