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

Method onDomUpdate_

extensions/amp-bind/0.1/bind-impl.js:1553–1566  ·  view source on GitHub ↗

* @param {!Event} event

(event)

Source from the content-addressed store, hash-verified

1551 * @param {!Event} event
1552 */
1553 onDomUpdate_(event) {
1554 const target = dev().assertElement(event.target);
1555 // TODO(choumx): Consider removing this check now that slowScan_() skips
1556 // FAST_RESCAN_TAGS internally, and because this makes an assumption about
1557 // the DOM structure of the EventTarget.
1558 const parent = target.parentNode;
1559 if (parent && FAST_RESCAN_TAGS.includes(parent.nodeName)) {
1560 return;
1561 }
1562 dev().info(TAG, 'dom_update:', target);
1563 this.slowScan_([target], [target], 'dom_update.end').then(() => {
1564 this.dispatchEventForTesting_(BindEvents.RESCAN_TEMPLATE);
1565 });
1566 }
1567
1568 /**
1569 * Removes bindings for nodes in `remove`, then scans for bindings in `add`.

Callers 1

initialize_Method · 0.95

Calls 6

slowScan_Method · 0.95
devFunction · 0.90
assertElementMethod · 0.80
infoMethod · 0.80
thenMethod · 0.45

Tested by

no test coverage detected