MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / _morphNode

Function _morphNode

src/core/runtime/morph.js:130–140  ·  view source on GitHub ↗
(oldNode, newNode, ctx)

Source from the content-addressed store, hash-verified

128}
129
130function _morphNode(oldNode, newNode, ctx) {
131 if (!(oldNode instanceof Element)) return;
132 _copyAttributes(oldNode, newNode);
133 if (oldNode instanceof HTMLTextAreaElement && oldNode.defaultValue !== newNode.defaultValue) {
134 oldNode.value = newNode.value;
135 }
136 if (!oldNode.isEqualNode(newNode) || newNode.tagName === "TEMPLATE" || newNode.querySelector?.("template")) {
137 _morphChildren(ctx, oldNode, newNode);
138 }
139 ctx.callbacks.afterNodeMorphed?.(oldNode);
140}
141
142function _findBestMatch(ctx, node, startPoint, endPoint) {
143 if (!(node instanceof Element)) return null;

Callers 1

_morphChildrenFunction · 0.70

Calls 2

_copyAttributesFunction · 0.70
_morphChildrenFunction · 0.70

Tested by

no test coverage detected