-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Description
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
if (toNode.nodeType === DOCUMENT_FRAGMENT_NODE || fromNode.nodeType === DOCUMENT_FRAGMENT_NODE) {
return;
}
should be changed to
// 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;
}
Metadata
Metadata
Assignees
Labels
No labels