MCPcopy Index your code
hub / github.com/ampproject/amphtml / whenViewportLayoutComplete_

Method whenViewportLayoutComplete_

src/service/performance-impl.js:775–787  ·  view source on GitHub ↗

* Returns a promise that is resolved when resources in viewport * have been finished being laid out. * @return {!Promise} * @private

()

Source from the content-addressed store, hash-verified

773 * @private
774 */
775 whenViewportLayoutComplete_() {
776 return this.resources_.whenFirstPass().then(() => {
777 const {documentElement} = this.win.document;
778 const size = Services.viewportForDoc(documentElement).getSize();
779 const rect = layoutRectLtwh(0, 0, size.width, size.height);
780 return whenContentIniLoad(
781 documentElement,
782 this.win,
783 rect,
784 /* isInPrerender */ true
785 );
786 });
787 }
788
789 /**
790 * Ticks a timing event.

Calls 5

layoutRectLtwhFunction · 0.90
whenContentIniLoadFunction · 0.90
thenMethod · 0.45
whenFirstPassMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected