add experimental svg support

- supports nested svg elements
- supports svg attributes
- supports xlink
This commit is contained in:
Leo Horie 2014-03-26 23:05:14 -04:00
parent 7e2136ba51
commit 48025dd16a
8 changed files with 87 additions and 18 deletions

View file

@ -13,11 +13,17 @@ mock.window = new function() {
setAttribute: function(name, value) {
this[name] = value.toString()
},
setAttributeNS: function(namespace, name, value) {
this[name] = value.toString()
},
getAttribute: function(name, value) {
return this[name]
},
}
}
window.document.createElementNS = function(namespace, tag) {
return window.document.createElement(tag)
}
window.document.createTextNode = function(text) {
return {nodeValue: text.toString()}
}