if (toNode.nodeType === DOCUMENT_FRAGMENT_NODE || fromNode.nodeType === DOCUMENT_FRAGMENT_NODE) {
return;
}
// document-fragments dont have attributes so lets not do anything
var hasAttributes = (toNode.nodeType === ELEMENT_NODE || toNode.nodeType === ATTRIBUTE_NODE) &&
(fromNode.nodeType === ELEMENT_NODE || fromNode.nodeType === ATTRIBUTE_NODE);
if (!hasAttributes) {
return;
}
morphAttrs is throwing exception on various element types.For example if the nodeType is of
DOCUMENT_TYPE_NODE(10). I think the same happens on other node types that don't have attributes.I think this line
https://github.com/patrick-steele-idem/morphdom/blob/master/src/morphAttrs.js#L12
should be changed to