span.appendChild(div);
  const shadowDiv = attachShadowDiv(div);
  const sheet = new CSSStyleSheet();
  sheet.replaceSync("* { color: red; }");
  div.shadowRoot.adoptedStyleSheets = [sheet];
  assert_equals(getComputedStyle(shadowDiv).color, "rgb(255, 0, 0)");

  document.adoptNode(span);
  assert_equals(div.shadowRoot.adoptedStyleSheets.length, 1);
  assert_equals(div.shadowRoot.adoptedStyleSheets[0], sheet);

  const iframe = document.createElement("iframe");
  document.body.appendChild(iframe);
  iframe.