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

Function getContentRect

third_party/resize-observer-polyfill/ResizeObserver.js:328–336  ·  view source on GitHub ↗

* Calculates an appropriate content rectangle for provided html or svg element. * * @param {Element} target - Element content rectangle of which needs to be calculated. * @returns {DOMRectInit}

(target)

Source from the content-addressed store, hash-verified

326 * @returns {DOMRectInit}
327 */
328 function getContentRect(target) {
329 if (!isBrowser) {
330 return emptyRect;
331 }
332 if (isSVGGraphicsElement(target)) {
333 return getSVGContentRect(target);
334 }
335 return getHTMLElementContentRect(target);
336 }
337 /**
338 * Creates rectangle with an interface of the DOMRectReadOnly.
339 * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly

Callers 1

ResizeObserver.jsFile · 0.70

Calls 2

getSVGContentRectFunction · 0.70

Tested by

no test coverage detected