New issue
Advanced search Search tips

Issue 924319 link

Starred by 1 user

Issue metadata

Status: Unconfirmed
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Svg element created with createElementNS swallows applied classes

Reported by emil.fih...@gmail.com, Today (7 hours ago)

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

Steps to reproduce the problem:
1. let svg=document.createElementNS("https://www.w3.org/2000/svg", "svg");
2. svg.classList.add("someClass");
3. document.body.appendChild(svg);

What is the expected behavior?
Expected to see someClass applied to the element and editable and visible in the developers tools.

What went wrong?
someClass is not applied to the element, nor is it editable in the developer tools. The class, however, is still visible in the dom when inspected or looked at through .classList and some styles are still applied to it, for example * and class > *

Did this work before? N/A 

Chrome version: 71.0.3578.98  Channel: stable
OS Version: 10.0
Flash Version: 

Works in Firefox.

In the pictures the only difference is that in the working version the svg element is created with createElement instead of createElementNS.
 
cewithns.png
178 KB View Download
cewithoutns.png
180 KB View Download

Comment 1 by swarnasree.mukkala@chromium.org, Today (2 hours ago)

Labels: Needs-Triage-M71

Comment 2 by woxxom@gmail.com, Today (37 minutes ago)

Reporter, your code incorrectly uses https instead of http in the namespace URL:
https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS
https://infra.spec.whatwg.org/#svg-namespace

Sign in to add a comment