Unbreak m.trust (#2516)

* Actually return the check from `maybeSetContentEditable`

Lots of code paths relied on it being a boolean. When I created the
abstraction, I apparently forgot to make sure it returned the result.

* Don't forget to copy instance state over

* Update changelog [skip ci]

* Fix changelog issue [skip ci]
This commit is contained in:
Isiah Meadows 2019-08-17 14:38:10 -04:00 committed by GitHub
parent bcf427a3be
commit 30ad45caa1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 84 additions and 3 deletions

View file

@ -434,7 +434,11 @@ module.exports = function($window) {
removeHTML(parent, old)
createHTML(parent, vnode, ns, nextSibling)
}
else vnode.dom = old.dom, vnode.domSize = old.domSize
else {
vnode.dom = old.dom
vnode.domSize = old.domSize
vnode.instance = old.instance
}
}
function updateFragment(parent, old, vnode, hooks, nextSibling, ns) {
updateNodes(parent, old.children, vnode.children, hooks, nextSibling, ns)
@ -608,13 +612,14 @@ module.exports = function($window) {
if (vnode.attrs == null || (
vnode.attrs.contenteditable == null && // attribute
vnode.attrs.contentEditable == null // property
)) return
)) return false
var children = vnode.children
if (children != null && children.length === 1 && children[0].tag === "<") {
var content = children[0].children
if (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content
}
else if (vnode.text != null || children != null && children.length !== 0) throw new Error("Child node of a contenteditable must be trusted")
return true
}
//remove