* 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)
| 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 |
no test coverage detected