MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / _morphNode

Function _morphNode

tools/common/_hyperscript.iife.js:3465–3475  ·  view source on GitHub ↗
(oldNode, newNode, ctx)

Source from the content-addressed store, hash-verified

3463 }
3464 }
3465 function _morphNode(oldNode, newNode, ctx) {
3466 if (!(oldNode instanceof Element)) return;
3467 _copyAttributes(oldNode, newNode);
3468 if (oldNode instanceof HTMLTextAreaElement && oldNode.defaultValue !== newNode.defaultValue) {
3469 oldNode.value = newNode.value;
3470 }
3471 if (!oldNode.isEqualNode(newNode) || newNode.tagName === "TEMPLATE" || newNode.querySelector?.("template")) {
3472 _morphChildren(ctx, oldNode, newNode);
3473 }
3474 ctx.callbacks.afterNodeMorphed?.(oldNode);
3475 }
3476 function _findBestMatch(ctx, node, startPoint, endPoint) {
3477 if (!(node instanceof Element)) return null;
3478 var softMatch = null, displaceMatchCount = 0, scanLimit = 10;

Callers 1

_morphChildrenFunction · 0.70

Calls 2

_copyAttributesFunction · 0.70
_morphChildrenFunction · 0.70

Tested by

no test coverage detected