   } else {
          element.setAttribute(SCOPE_NAME, scope);
        }
      } else {
        // note: if using classes, we add both the general 'style-scope' class
        // as well as the specific scope. This enables easy filtering of all
        // `style-scope` elements
        if (scope) {
          if (shouldRemoveScope) {
            element.classList.remove(SCOPE_NAME);
            element.classList.remove(scope);
          } else {
            element.classList.add(SCOPE_NAME);
    