Since we check all the parent elements of each target element we will check many elements multiple times, and since the rendering is blocking they can't change their state so we can cache the results to only need to do them once.
The cache should be cleared after the rendering is complete.
Since we check all the parent elements of each target element we will check many elements multiple times, and since the rendering is blocking they can't change their state so we can cache the results to only need to do them once.
The cache should be cleared after the rendering is complete.