(element: Element)
| 50 | } |
| 51 | |
| 52 | function getLayoutHeight(element: Element): number { |
| 53 | const containerRect = containerRects.get(element); |
| 54 | if (containerRect) { |
| 55 | return containerRect.height; |
| 56 | } |
| 57 | |
| 58 | const height = parsePixels(getStyle(element)?.height ?? ""); |
| 59 | if (height !== null) { |
| 60 | return height; |
| 61 | } |
| 62 | |
| 63 | let sum = 0; |
| 64 | for (const child of Array.from(element.children)) { |
| 65 | if (!isAbsolutelyPositioned(child)) { |
| 66 | sum += getLayoutHeight(child); |
| 67 | } |
| 68 | } |
| 69 | return sum; |
| 70 | } |
| 71 | |
| 72 | // The top of the element relative to the top of the root (e.g. the content of a scroll container) |
| 73 | function getLayoutTop(element: Element, root: Element): number { |
no test coverage detected