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

Method mutateOrInvoke_

src/custom-element.js:2138–2148  ·  view source on GitHub ↗

* Mutates the element using resources if available. * * @param {function()} mutator * @param {?Element=} opt_element * @param {boolean=} opt_skipRemeasure

(mutator, opt_element, opt_skipRemeasure = false)

Source from the content-addressed store, hash-verified

2136 * @param {boolean=} opt_skipRemeasure
2137 */
2138 mutateOrInvoke_(mutator, opt_element, opt_skipRemeasure = false) {
2139 if (this.ampdoc_) {
2140 Services.mutatorForDoc(this.getAmpDoc()).mutateElement(
2141 opt_element || this,
2142 mutator,
2143 opt_skipRemeasure
2144 );
2145 } else {
2146 mutator();
2147 }
2148 }
2149 }
2150 win.__AMP_BASE_CE_CLASS = BaseCustomElement;
2151 return /** @type {typeof HTMLElement} */ (win.__AMP_BASE_CE_CLASS);

Callers 1

applySizeMethod · 0.95

Calls 2

getAmpDocMethod · 0.95
mutateElementMethod · 0.45

Tested by

no test coverage detected