leSheets are in different document trees');

function attachShadowDiv(host) {
  const shadowRoot = host.attachShadow({mode: 'open'});
  const shadowDiv = document.createElement("div");
  shadowRoot.appendChild(shadowDiv);
  return shadowDiv;
}

test(() => {
  const sheet = new CSSStyleSheet();
  assert_equals(sheet.cssRules.length, 0);

  sheet.replaceSync(redStyleTexts[0])
  assert_equals(sheet.cssRules.length, 1);
  assert_equals(redStyleTexts[0], sheet.cssRules[0].cssText);

  sheet.replaceSync(redStyleT