MCPcopy Create free account
hub / github.com/ampproject/amphtml / shouldMutationForNodeListBeRerendered

Function shouldMutationForNodeListBeRerendered

src/preact/base-element.js:943–963  ·  view source on GitHub ↗

* @param {NodeList} nodeList * @return {boolean}

(nodeList)

Source from the content-addressed store, hash-verified

941 * @return {boolean}
942 */
943function shouldMutationForNodeListBeRerendered(nodeList) {
944 for (let i = 0; i < nodeList.length; i++) {
945 const node = nodeList[i];
946 if (isElement(node)) {
947 // Ignore service elements, e.g. `<i-amphtml-svc>` or
948 // `<x slot="i-amphtml-svc">`.
949 if (
950 node[RENDERED_PROP] ||
951 node.tagName.startsWith('I-') ||
952 node.getAttribute('slot') == 'i-amphtml-svc'
953 ) {
954 continue;
955 }
956 return true;
957 }
958 if (node.nodeType == /* TEXT */ 3) {
959 return true;
960 }
961 }
962 return false;
963}
964
965/**
966 * @param {typeof PreactBaseElement} Ctor

Callers 1

Calls 2

isElementFunction · 0.90
getAttributeMethod · 0.80

Tested by

no test coverage detected