MCPcopy
hub / github.com/ampproject/amphtml / completeUpgrade_

Method completeUpgrade_

src/custom-element.js:410–422  ·  view source on GitHub ↗

* Completes the upgrade of the element with the provided implementation. * @param {!./base-element.BaseElement} newImpl * @param {number} upgradeStartTime * @final @private

(newImpl, upgradeStartTime)

Source from the content-addressed store, hash-verified

408 * @final @private
409 */
410 completeUpgrade_(newImpl, upgradeStartTime) {
411 this.impl_ = newImpl;
412 this.upgradeDelayMs_ = win.Date.now() - upgradeStartTime;
413 this.upgradeState_ = UpgradeState_Enum.UPGRADED;
414 this.setReadyStateInternal(ReadyState_Enum.BUILDING);
415 this.classList.remove('amp-unresolved', 'i-amphtml-unresolved');
416 this.assertLayout_();
417 this.dispatchCustomEventForTesting(AmpEvents_Enum.ATTACHED);
418 if (!this.R1()) {
419 this.getResources().upgraded(this);
420 }
421 this.signals_.signal(CommonSignals_Enum.UPGRADED);
422 }
423
424 /** @private */
425 assertLayout_() {

Callers 1

tryUpgrade_Method · 0.95

Calls 9

setReadyStateInternalMethod · 0.95
assertLayout_Method · 0.95
R1Method · 0.95
getResourcesMethod · 0.95
nowMethod · 0.80
removeMethod · 0.45
upgradedMethod · 0.45
signalMethod · 0.45

Tested by

no test coverage detected