New issue
Advanced search Search tips

Issue 810881 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Feb 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

setAttributeNS not rendering SVG element properly when using setAttributeNS

Reported by s...@ffctn.com, Feb 9 2018

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36

Steps to reproduce the problem:
1. create an SVG element using document.createElementNS("http://www.w3.org/2000/svg", "text")
2. set the attribute using setAttributeNS("http://www.w3.org/2000/svg", "x", 50)
3. Add the element to an svg element
4. Notice that the element isn't rendered as expected

What is the expected behavior?
The element is rendered in the same way that it would be if using setAttribute or setAttributeNS(null,"x",50)

What went wrong?
The element isn't rendered as expected, the attributes set using this manner seem to be completely ignored, although they are present when inspecting the DOM with the dev tools.

test case: https://codepen.io/duprasa/pen/rJyzWM

Did this work before? N/A 

Does this work in other browsers? No
 Same behavior across all the other browsers tested (safari 11, edge, Firefox 58)

Chrome version: 64.0.3282.140  Channel: stable
OS Version: ubuntu 16.04 LTS
Flash Version:
 

Comment 1 by f...@opera.com, Feb 9 2018

Status: WontFix (was: Unconfirmed)
This is working as expected: the attribute in no namespace (the "null namespace") is the one used, the one in the SVG namespace isn't used. The DevTools rendition of this is definitely confusing (even more so if there are multiple attributes in different namespaces - without a prefix - or in no namespace.) Using for example XMLSerializer.prototype.serializeToString will produce a prefix for the attributes in the SVG namespace.

Comment 2 by s...@ffctn.com, Feb 9 2018

Cool, thanks! Just wanted to clear that up :)

Sign in to add a comment