(node: DOMElement, root: DOMElement)
| 151 | } |
| 152 | |
| 153 | function isInTree(node: DOMElement, root: DOMElement): boolean { |
| 154 | let current: DOMElement | undefined = node |
| 155 | while (current) { |
| 156 | if (current === root) return true |
| 157 | current = current.parentNode |
| 158 | } |
| 159 | return false |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * Walk up to root and return it. The root is the node that holds |