Skip to content

Commit

Permalink
Follow-up to PR 29267
Browse files Browse the repository at this point in the history
  • Loading branch information
wbamberg committed Oct 11, 2023
1 parent 6f0b1e2 commit 2ec0d0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions files/en-us/web/api/document/adoptedstylesheets/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ Only stylesheets created using the [`CSSStyleSheet()` constructor](/en-US/docs/W

## Value

The value is an array of {{domxref("CSSStyleSheet()")}} instances that must have been created using the {{domxref("CSSStyleSheet.CSSStyleSheet()", "CSSStyleSheet()")}} constructor within the context of the same {{domxref("Document")}}.
The value is an array of {{domxref("CSSStyleSheet")}} instances that must have been created using the {{domxref("CSSStyleSheet.CSSStyleSheet()", "CSSStyleSheet()")}} constructor within the context of the same {{domxref("Document")}}.

If the array needs to be modified, then a new array must be assigned (in-place mutations like `push()` will throw an exception).
Note however that the {{domxref("CSSStyleSheet()")}} instances themselves can be modified, and these changes will apply wherever the stylesheet is adopted.
If the array needs to be modified, use in-place mutations like `push()`. The {{domxref("CSSStyleSheet")}} instances themselves can also be modified, and these changes will apply wherever the stylesheet is adopted.

In an earlier version of the specification, the array was not modifiable, so the only way to add new stylesheets was to assign a new array to `adoptedStyleSheets`.

### Exceptions

Expand Down
7 changes: 4 additions & 3 deletions files/en-us/web/api/shadowroot/adoptedstylesheets/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ Only stylesheets created using the [`CSSStyleSheet()` constructor](/en-US/docs/W

## Value

The value is an array of {{domxref("CSSStyleSheet()")}} instances that must have been created using the {{domxref("CSSStyleSheet.CSSStyleSheet()", "CSSStyleSheet()")}} constructor within the context of the shadow root's parent {{domxref("Document")}}.
The value is an array of {{domxref("CSSStyleSheet")}} instances that must have been created using the {{domxref("CSSStyleSheet.CSSStyleSheet()", "CSSStyleSheet()")}} constructor within the context of the shadow root's parent {{domxref("Document")}}.

If the array needs to be modified, use in-place mutations like `push()`.
Note, the {{domxref("CSSStyleSheet()")}} instances themselves can also be modified, and these changes will apply wherever the stylesheet is adopted.
If the array needs to be modified, use in-place mutations like `push()`. The {{domxref("CSSStyleSheet")}} instances themselves can also be modified, and these changes will apply wherever the stylesheet is adopted.

In an earlier version of the specification, the array was not modifiable, so the only way to add new stylesheets was to assign a new array to `adoptedStyleSheets`.

## Examples

Expand Down

0 comments on commit 2ec0d0f

Please sign in to comment.