contentDocument.adoptNode(span);
  iframe.contentDocument.body.appendChild(span);
  assert_not_equals(div.shadowRoot, null);
  assert_equals(div.shadowRoot.adoptedStyleSheets.length, 0);
  assert_equals(getComputedStyle(shadowDiv).color, "rgb(0, 0, 0)");
}, `Adopting a shadow host's ancestor will empty adoptedStyleSheets if adopting to a different document`);

test(() => {
  const host = document.createElement("div");
  const root = host.attachShadow({mode: "open"});
  root.adoptedStyleSheets = [new CSSStyl