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

Function getBoundingClientRect

src/polyfills/get-bounding-client-rect.js:23–30  ·  view source on GitHub ↗

* Polyfill for Node.getBoundingClientRect API. * @this {Element} * @return {ClientRect|LayoutRectDef}

()

Source from the content-addressed store, hash-verified

21 * @return {ClientRect|LayoutRectDef}
22 */
23function getBoundingClientRect() {
24 // eslint-disable-next-line local/no-invalid-this
25 if (mode.isEsm() || isConnectedNode(this)) {
26 return nativeClientRect.call(this);
27 }
28
29 return layoutRectLtwh(0, 0, 0, 0);
30}
31
32/**
33 * Determines if this polyfill should be installed.

Callers

nothing calls this directly

Calls 2

isConnectedNodeFunction · 0.90
layoutRectLtwhFunction · 0.90

Tested by

no test coverage detected