use setAttribute for any namespaced element

pull/1226/head
Rich Harris 7 years ago
parent 9037e93934
commit 6131963551

@ -216,7 +216,7 @@ export default class Element extends Node {
if (this._needsCssAttribute && !this.generator.customElement) {
if (!this.attributes.find(a => a.type === 'Attribute' && a.name === 'class')) {
block.builders.hydrate.addLine(
this.namespace === namespaces.svg
this.namespace
? `@setAttribute(${name}, "class", "${this.generator.stylesheet.id}");`
: `${name}.className = "${this.generator.stylesheet.id}";`
);

Loading…
Cancel
Save