add experimental svg support
- supports nested svg elements - supports svg attributes - supports xlink
This commit is contained in:
parent
7e2136ba51
commit
48025dd16a
8 changed files with 87 additions and 18 deletions
|
|
@ -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()}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue