Merge pull request #1395 from ornicar/update-node-ns
Add failing test and proposed fix for SVG update with tag change.
This commit is contained in:
commit
0308140156
2 changed files with 14 additions and 1 deletions
|
|
@ -213,7 +213,7 @@ module.exports = function($window) {
|
|||
}
|
||||
else {
|
||||
removeNode(old, null)
|
||||
insertNode(parent, createNode(vnode, hooks, undefined), nextSibling)
|
||||
insertNode(parent, createNode(vnode, hooks, ns), nextSibling)
|
||||
}
|
||||
}
|
||||
function updateText(old, vnode) {
|
||||
|
|
|
|||
|
|
@ -211,6 +211,19 @@ o.spec("updateElement", function() {
|
|||
|
||||
o(updated.dom.attributes["class"].nodeValue).equals("b")
|
||||
})
|
||||
o("updates svg child", function() {
|
||||
var vnode = {tag: "svg", children: [{
|
||||
tag: 'circle'
|
||||
}]}
|
||||
var updated = {tag: "svg", children: [{
|
||||
tag: 'line'
|
||||
}]}
|
||||
|
||||
render(root, [vnode])
|
||||
render(root, [updated])
|
||||
|
||||
o(updated.dom.firstChild.namespaceURI).equals("http://www.w3.org/2000/svg")
|
||||
})
|
||||
o("restores correctly when recycling", function() {
|
||||
var vnode = {tag: "div", key: 1}
|
||||
var updated = {tag: "div", key: 2}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue