Ticket #6884 (closed bug: duplicate)
XML introspection confused when SVG embedded in <script> tag
|Reported by:||cefn||Owned by:|
|Keywords:||xml svg attr setAttribute||Cc:|
Using attr(map) to set attributes on embedded SVG elements triggers an error in JQuery, whilst directly setting the attributes works fine.
I'm following instructions in the SVGWeb tutorial to embed SVG in the page, using a script tag with type="image/svg+xml" http://codinginparadise.org/projects/svgweb/docs/QuickStart.html I understand this is supported by many browsers.
JQuery introspects elements to judge whether or not it should use setAttribute(name,value) for XML documents or elem[name]=value for DOM0 documents, but the logic doesn't detect that this SVG element actually requires the setAttribute(...) style invocation suitable for XML.
The logic in 1.4.2 looks like this...
|!jQuery.isXMLDoc( elem )|
...and attr() falls through to Line 1493 calling...
elem[ name ] = value;
...triggering the error "setting a property that has only a getter"
The example code at http://pastebin.com/U1kyLxVE contains an attr() call which triggers the error, and contains a commented version of equivalent setAttribute calls which do not trigger the error.
The logic of 'notxml' should be modified to capture such cases and make attr() work. For example, the namespaceURI of this element is http://www.w3.org/2000/svg so it is indeed possible to detect the case.
- Priority set to low
- Status changed from new to open
- Component changed from unfiled to attributes
- Milestone changed from 1.4.3 to 1.5
- Status changed from open to closed
- Resolution set to duplicate