lib/jsdom/living/helpers/shadow-dom.js
function shadowIncludingRoot(node) {
  const root = getRoot(node);
  return isShadowRoot(root) ? shadowIncludingRoot(root.host) : root;
}
function shadowIncludingRoot(node) {
  const root = getRoot(node);
  return isShadowRoot(root) ? shadowIncludingRoot(root.host) : root;
}
https://dom.spec.whatwg.org/#concept-shadow-including-root