Closed rachardking closed 8 years ago
i just read your source code ,like this
DOMElement.prototype.appendChild = function _Element_appendChild(child) {
if (child.parentNode) {
child.parentNode.removeChild(child)
}
this.childNodes.push(child)
child.parentNode = this
return child
}
and if the child is fragment This is incorrect HTML AST - document fragment can't be a child node of any other node
This implementation is a simplication. I'm going to avoid adding complexity since the goal is to emulate a correct DOM; not catch all possible invalid states.
@rachardking could you provide some more details of what is going wrong? a code example would be nice - I can't quite make out what you mean