@@ -1088,19 +1088,26 @@ CSS Style Sheet Collections {#css-style-sheet-collections}
10881088Below various new concepts are defined that are associated with each
10891089{{DocumentOrShadowRoot}} object.
10901090
1091- Each {{DocumentOrShadowRoot}} has an associated list of zero or more
1092- <a>CSS style sheets</a> , named the
1091+ Each {{DocumentOrShadowRoot}} has an associated list of zero or more <a>CSS style sheets</a> , named the
10931092<dfn export for=DocumentOrShadowRoot>document or shadow root CSS style sheets</dfn> . This is
1094- an ordered list that contains all
1095- <a>CSS style sheets</a> associated with the
1096- {{DocumentOrShadowRoot}} , in
1097- <a>tree order</a> , with
1098- <a>CSS style sheets</a> created from HTTP
1099- <code> Link</code> headers first, if any, in header
1100- order.
1101-
1102- To <dfn export>create a CSS style sheet</dfn> , run these
1103- steps:
1093+ an ordered list that contains:
1094+ <ol>
1095+ <li> Any <a>CSS style sheets</a> created from HTTP <code> Link</code> headers, in header order</li>
1096+ <li> Any <a>CSS style sheets</a> associated with the {{DocumentOrShadowRoot}} , in <a>tree order</a> </li>
1097+ </ol>
1098+
1099+ Each {{DocumentOrShadowRoot}} has an associated list of zero or more <a>CSS style sheets</a> , named the
1100+ <dfn export for=DocumentOrShadowRoot>final CSS style sheets</dfn> . This is
1101+ an ordered list that contains:
1102+ <ol>
1103+ <li> Any <a>CSS style sheets</a> created from HTTP <code> Link</code> headers, in header order</li>
1104+ <li> Any <a>CSS style sheets</a> associated with the {{DocumentOrShadowRoot}} , in <a>tree order</a> </li>
1105+ <li> The contents of {{DocumentOrShadowRoot}} 's <a href="#dom-documentorshadowroot-adoptedstylesheets">adoptedStyleSheets</a>'
1106+ <a href="https://heycam.github.io/webidl/#observable-array-attribute-backing-list">backing list</a> ,
1107+ in array order.</li>
1108+ </ol>
1109+
1110+ To <dfn export>create a CSS style sheet</dfn> , run these steps:
11041111
11051112<ol>
11061113 <li> Create a new <a>CSS style sheet</a> object and set its
@@ -1285,12 +1292,20 @@ represented by the collection.
12851292<pre class=idl>
12861293partial interface mixin DocumentOrShadowRoot {
12871294 [SameObject] readonly attribute StyleSheetList styleSheets;
1295+ attribute ObservableArray<CSSStyleSheet> adoptedStyleSheets;
12881296};
12891297</pre>
12901298
12911299The <dfn attribute for=DocumentOrShadowRoot>styleSheets</dfn> attribute must return a {{StyleSheetList}} collection representing
12921300the <a>document or shadow root CSS style sheets</a> .
12931301
1302+ The <a href="https://heycam.github.io/webidl/#observable-array-attribute-set-an-indexed-value">set an indexed value</a> algorithm
1303+ for <dfn attribute for="DocumentOrShadowRoot"><code>adoptedStyleSheets</code></dfn> , given <var> value</var> and <var> index</var> , is the following:
1304+ <ol>
1305+ <li> If <var> value</var> 's <a>constructed flag</a> is not set, or its <a>constructor document</a> is not equal to this
1306+ {{DocumentOrShadowRoot}} 's <a>node document</a> , throw a "{{NotAllowedError}} " {{DOMException}} .</li>
1307+ </ol>
1308+
12941309Style Sheet Association {#style-sheet-association}
12951310--------------------------------------------------
12961311
0 commit comments