s when connected");
}, 'Attaching a shadow root that already has adopted stylesheets work');

test(() => {
  const sheet = new CSSStyleSheet();
  sheet.replaceSync(":host([red]) { color: red; } :host(.blue) { color: blue; }");
  const host = document.createElement("div");
  host.toggleAttribute("red");
  document.body.appendChild(host);
  assert_equals(getComputedStyle(host).color, "rgb(0, 0, 0)", "No style applies yet");

  let sr = host.attachShadow({mode: "open"});
  sr.adoptedStyleSheets = [sheet];

  a