Skip to main content

Bug Tracker

Side navigation

#8879 closed bug (wontfix)

Opened April 14, 2011 08:29PM UTC

Closed April 16, 2011 06:12AM UTC

attributeHas selector for SVG elements doesn't work in Opera 11+

Reported by: evtimpetrov@gmail.com Owned by: evtimpetrov@gmail.com
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

Attachments (0)
Change History (4)

Changed April 14, 2011 09:43PM UTC by timmywil comment:1

component: unfiledselector
owner: → evtimpetrov@gmail.com
status: newpending

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.

Changed April 15, 2011 07:49PM UTC by evtimpetrov@gmail.com comment:2

status: pendingnew

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 [comment:1 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.

Changed April 15, 2011 09:19PM UTC by timmywil comment:3

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.

Changed April 16, 2011 06:12AM UTC by addyosmani comment:4

priority: undecidedlow
resolution: → wontfix
status: newclosed

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.