Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG element is created with duplicate xmlns attribute in IE #1978

Closed
IndrekHaav opened this issue Jun 24, 2013 · 1 comment
Closed

SVG element is created with duplicate xmlns attribute in IE #1978

IndrekHaav opened this issue Jun 24, 2013 · 1 comment

Comments

@IndrekHaav
Copy link

When creating a graph with Highcharts, in Internet Explorer (9+) the SVG element that is created has two identical xmlns attributes. This causes problems when trying to convert the SVG to an image (e.g. with Batik).

Steps to reproduce:

  1. Open any demo at highcharts.com in IE (9+)
  2. Press F12 to open Developer Tools
  3. Go to the HTML tag and hit Alt+E to view the modified HTML source
  4. Scroll down to the SVG element and witness the duplicate attributes

Forked jsFiddle: http://jsfiddle.net/9R7NP

Output in Firefox:

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="597" height="300">

Output in IE:

<svg xmlns="http://www.w3.org/2000/svg" width="597" height="300" xmlns="http://www.w3.org/2000/svg" version="1.1">

I also posted this on Stack Overflow and someone answered suggesting it was a bug with the way the SVG element is created: http://stackoverflow.com/q/17265376/434012

@TorsteinHonsi
Copy link
Collaborator

Thanks! The node is actually created with createElementNS, but where IE9 adds the namespace as an attribute to the XML, other browsers do not expose the attribute. Probably we need to do some conditional logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants