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

Method onLayoutMeasure

extensions/amp-script/0.1/amp-script.js:193–207  ·  view source on GitHub ↗

* @override

()

Source from the content-addressed store, hash-verified

191 * @override
192 */
193 onLayoutMeasure() {
194 if (this.layoutCompleted_ || this.reportedZeroSize_) {
195 return;
196 }
197
198 const {height, width} = this.getLayoutSize();
199 if (width * height === 0 && !this.nodom_) {
200 this.reportedZeroSize_ = true;
201 user().warn(
202 TAG,
203 'Skipped initializing amp-script due to zero width or height.',
204 this.element
205 );
206 }
207 }
208
209 /**
210 * @param {!AmpScriptService} service

Callers 1

test-amp-script.jsFile · 0.45

Calls 3

userFunction · 0.90
warnMethod · 0.80
getLayoutSizeMethod · 0.45

Tested by

no test coverage detected