@@ -267,82 +267,45 @@ Processing Stylesheet Imports</h3>
267267 <div algorithm>
268268 To <dfn export>fetch an @import</dfn> , given an ''@import'' rule |rule|:
269269
270- 1. If |rule| has a <<supports-condition>> ,
271- and that condition is not true,
272- return nothing.
273-
274- 1. [=Parse a URL=] given |rule|'s URL,
275- relative to |rule|'s [=CSSRule/parent CSS style sheet' s=] [=CSSStyleSheet/location=] .
276-
277- Issue: Make sure this is defined correctly,
278- drawing from the document when it's a <{style}> element, etc.
279-
280- If that fails, then return nothing. Otherwise, let |url| be the [=resulting URL record=] .
270+ 1. Let |parentStylesheet| be |rule|'s <a spec=cssom for=CSSRule>parent CSS style sheet</a> .
271+ [[CSSOM]]
281272
282- 2. Let |request| be a new [=/request=]
283- whose [=request/URL=] is |url|,
284- [=request/destination=] is <code> "style"</code> ,
285- [=request/mode=] is <code> "no-cors"</code> ,
286- [=request/credentials mode=] is <code> "include"</code> ,
287- and whose [=request/use-URL-credentials flag=] is set.
288-
289- 3. Set |request|'s client to ????
290-
291- Issue: The Fetch spec doesn't provide any information about what a client is
292- or what it does,
293- so I have no idea of what to provide here.
294-
295- 4. Run the following steps [=in parallel=] :
273+ 2. If |rule| has a <<supports-condition>> ,
274+ and that condition is not true,
275+ return.
296276
297- 1. Let |response| be the result of [=/fetching=] |request|.
277+ 3. Let |parsedUrl| be the result of the [=URL parser=] steps with |rule|'s URL and
278+ |parentStylesheet|'s <a spec=cssom>location</a> .
279+ If the algorithm returns an error,
280+ return. [[CSSOM]]
298281
299- 2. Let |success| initially be true.
282+ 4. [=Fetch a style resource=] from |parsedUrl|,
283+ with stylesheet |parentStylesheet|,
284+ destination "style",
285+ CORS mode "no-cors",
286+ and processResponse being the following steps given [=/response=] |response| and
287+ byte stream, null or failure |byteStream|:
300288
301- 3. If |response| is a [=network error=]
302- or its [=response/status=] is not an [=ok status=] ,
303- set |success| to false.
289+ 1. If |maybeByteStream| is not a byte stream, return.
304290
305- 4 . If |rule|'s [=CSSRule/parent style sheet=] is in [=quirks mode=]
291+ 2 . If |parentStylesheet| is in [=quirks mode=]
306292 and |response| is [=CORS-same-origin=] ,
307293 let |content type| be <code> "text/css"</code> .
308294 Otherwise, let |content type| be the Content Type metadata of |response|.
309295
310- 5 . If |content type| is not <code> "text/css"</code> ,
296+ 3 . If |content type| is not <code> "text/css"</code> ,
311297 return.
312298
313- 6. Issue: Do we wait for sub-imports to run now?
314- Need to explore this .
299+ 4. Let |importedStylesheet| be the result of [=Parse a stylesheet|parsing=] |byteStram|
300+ given |parsedUrl| .
315301
316- 7. Let |global| be the result of [=finding the relevant global object for a stylesheet=]
317- given |rule |'s [=CSSRule/parent CSS style sheet=] .
302+ 5. Set |importedStylesheet|'s <a spec=cssom>origin-clean flag</a> to
303+ |parentStylesheet |'s <a spec=cssom>origin-clean flag</a> .
318304
319- 8. [=Queue a global task=] ,
320- given the [=networking task source=]
321- and |global|,
322- to [=process an imported stylesheet=]
323- given |rule|,
324- |success|,
325- and |response|.
326- </div>
327-
328- <div algorithm>
329- To <dfn export>find the relevant global object for a stylesheet</dfn> given a CSS style sheet |stylesheet|:
330-
331- 1. If |stylesheet| has a [=CSSStyleSheet/parent CSS style sheet=] ,
332- return the result of [=finding the relevant global object for a stylesheet=]
333- given the [=CSSStyleSheet/parent CSS style sheet=] .
334-
335- 2. If |stylesheet| has an [=CSSStyleSheet/owner node=] ,
336- return the [=CSSStyleSheet/owner node's=] [=relevant global object=] .
337- </div>
338-
339- <div algorithm>
340- To <dfn export>process an imported stylesheet</dfn>
341- given a parent rule |rule|,
342- a success flag |success|,
343- and a response |response|:
305+ 6. If |response| is not [=CORS-same-origin=] , unset |importedStylesheet|'s
306+ <a spec=cssom>origin-clean flag</a> .
344307
345- Issue: Create a stylesheet, assign it to the parent rule .
308+ 7. Set |rule|'s {{CSSImportRule/styleSheet}} to |importedStylesheet| .
346309 </div>
347310
348311<h3 id='content-type'>
0 commit comments