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

Method renderOutsideViewport

src/service/resource.js:794–806  ·  view source on GitHub ↗

* Whether this is allowed to render when not in viewport. * @return {boolean}

()

Source from the content-addressed store, hash-verified

792 * @return {boolean}
793 */
794 renderOutsideViewport() {
795 // The exception is for owned resources, since they only attempt to
796 // render outside viewport when the owner has explicitly allowed it.
797 // TODO(jridgewell, #5803): Resources should be asking owner if it can
798 // prerender this resource, so that it can avoid expensive elements wayyy
799 // outside of viewport. For now, blindly trust that owner knows what it's
800 // doing.
801 this.resolveDeferredsWhenWithinViewports_();
802 return (
803 this.hasOwner() ||
804 this.isWithinViewportRatio(this.element.renderOutsideViewport())
805 );
806 }
807
808 /**
809 * Whether this is allowed to render when scheduler is idle but not in

Callers 1

isLayoutAllowed_Method · 0.45

Calls 3

hasOwnerMethod · 0.95
isWithinViewportRatioMethod · 0.95

Tested by

no test coverage detected