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

Method getOwner

src/service/resource.js:243–256  ·  view source on GitHub ↗

* Returns an owner element or null. * @return {?AmpElement}

()

Source from the content-addressed store, hash-verified

241 * @return {?AmpElement}
242 */
243 getOwner() {
244 if (this.owner_ === undefined) {
245 for (let n = this.element; n; n = n.parentElement) {
246 if (n[OWNER_PROP_]) {
247 this.owner_ = n[OWNER_PROP_];
248 break;
249 }
250 }
251 if (this.owner_ === undefined) {
252 this.owner_ = null;
253 }
254 }
255 return this.owner_;
256 }
257
258 /**
259 * Whether the resource has an owner.

Callers 4

hasOwnerMethod · 0.95
completeCollapseMethod · 0.95
test-resource.jsFile · 0.45
layoutBuiltChild_Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected