fix svg class updates

This commit is contained in:
Leo Horie 2016-06-07 20:20:30 -04:00
parent 6ff63b224c
commit 693c87f5f1
6 changed files with 82 additions and 40 deletions

View file

@ -151,6 +151,13 @@ module.exports = function() {
}
}
},
get className() {
return this.attributes["class"] ? this.attributes["class"].nodeValue : ""
},
set className(value) {
if (this.namespaceURI === "http://www.w3.org/2000/svg") throw new Error("Cannot set property className of SVGElement")
else this.setAttribute("class", value)
},
focus: function() {activeElement = this},
addEventListener: function(type, callback, useCapture) {
if (events[type] == null) events[type] = [callback]