Find the closest node which is a ShadowRoot or Document by traversing the parentNode ancestry.
ShadowRoot
Document
parentNode
Find the closest node which is a
ShadowRoot
orDocument
by traversing theparentNode
ancestry.