(element: Element)
| 43 | // element is. That makes the width and height fractional and transform-aware |
| 44 | // where goog.style.getSize's were integer and transform-ignorant. |
| 45 | function getLocation(element: Element): Bounds | null { |
| 46 | if (!isShown(element)) { |
| 47 | return null |
| 48 | } |
| 49 | |
| 50 | const rect = getClientRect(element) |
| 51 | const win = element.ownerDocument.defaultView |
| 52 | const scrollX = win ? win.pageXOffset : 0 |
| 53 | const scrollY = win ? win.pageYOffset : 0 |
| 54 | |
| 55 | return { |
| 56 | left: rect.left + scrollX, |
| 57 | top: rect.top + scrollY, |
| 58 | width: rect.width, |
| 59 | height: rect.height, |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | export default getLocation |
nothing calls this directly
no test coverage detected