, 255)", "Class updates to the element after reattachment apply");

}, "Re-attaching shadow host and updating attributes work");

promise_test(() => {
  const plainSheet = new CSSStyleSheet();
  const redStyleSheetPromise = plainSheet.replace(redStyleTexts[0]);
  return redStyleSheetPromise.then(function(redStyleSheet) {
    document.adoptedStyleSheets = [redStyleSheet];
    assert_equals(getComputedStyle(greenSpan).color, "rgb(0, 0, 0)");
    assert_equals(getComputedStyle(redSpan).color, "rgb(255, 0, 0)")