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

Method getSizer_

src/custom-element.js:981–992  ·  view source on GitHub ↗

* @return {?Element} * @private

()

Source from the content-addressed store, hash-verified

979 * @private
980 */
981 getSizer_() {
982 if (
983 this.sizerElement === undefined &&
984 (this.layout_ === Layout_Enum.RESPONSIVE ||
985 this.layout_ === Layout_Enum.INTRINSIC)
986 ) {
987 // Expect sizer to exist, just not yet discovered.
988 this.sizerElement = this.querySelector('i-amphtml-sizer');
989 this.sizerElement?.setAttribute('slot', 'i-amphtml-svc');
990 }
991 return this.sizerElement || null;
992 }
993
994 /**
995 * @param {Element} sizer

Callers 3

buildInternalMethod · 0.95
applyMediaAttrs_Method · 0.95
applySizeMethod · 0.95

Calls 1

setAttributeMethod · 0.45

Tested by

no test coverage detected