Variables
Let horizontallyScrolling
horizontallyScrolling: Map<any, any> = new Map()
Let lastRecursiveScrolled
lastRecursiveScrolled: any = null
Let lastX
lastX: number = 0
Let lastY
lastY: number = 0
Let verticallyScrolling
verticallyScrolling: Map<any, any> = new Map()
Tries to find a node which can be scrolled either x pixels to the right or y pixels down among the Elements in {nodes} and children of these Elements.
This function used to be recursive but isn't anymore due to various attempts at optimizing the function in order to reduce GC pressure.