We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92102b5 commit 64becb5Copy full SHA for 64becb5
css-cascade-4/Overview.bs
@@ -265,82 +265,42 @@ Processing Stylesheet Imports</h3>
265
<div algorithm>
266
To <dfn export>fetch an @import</dfn>, given an ''@import'' rule |rule|:
267
268
+ 1. Let |parentStylesheet| be |rule|'s <a spec=cssom for=CSSRule>parent CSS style sheet</a>.
269
+ [[CSSOM]]
270
+
271
1. If |rule| has a <<supports-condition>>,
272
and that condition is not true,
- return nothing.
-
- 1. [=Parse a URL=] given |rule|'s URL,
273
- relative to |rule|'s [=CSSRule/parent CSS style sheet's=] [=CSSStyleSheet/location=].
274
275
- Issue: Make sure this is defined correctly,
276
- drawing from the document when it's a <{style}> element, etc.
277
278
- If that fails, then return nothing. Otherwise, let |url| be the [=resulting URL record=].
279
280
- 2. Let |request| be a new [=/request=]
281
- whose [=request/URL=] is |url|,
282
- [=request/destination=] is <code>"style"</code>,
283
- [=request/mode=] is <code>"no-cors"</code>,
284
- [=request/credentials mode=] is <code>"include"</code>,
285
- and whose [=request/use-URL-credentials flag=] is set.
286
287
- 3. Set |request|'s client to ????
288
289
- Issue: The Fetch spec doesn't provide any information about what a client is
290
- or what it does,
291
- so I have no idea of what to provide here.
292
293
- 4. Run the following steps [=in parallel=]:
+ return.
294
295
- 1. Let |response| be the result of [=/fetching=] |request|.
+ 1. Let |parsedUrl| be the result of the [=URL parser=] steps with |relativeUrl| and
+ |parentStylesheet|'s <a spec=cssom>location</a>. If the algorithm returns an error,
+ return. [[CSSOM]]
296
297
- 2. Let |success| initially be true.
+ 1. [=Fetch a style resource=] |parsedUrl|, with |parentStylesheet|, "style", "no-cors",
+ and the following steps given [=/response=] |response|:
298
299
- 3. If |response| is a [=network error=]
300
- or its [=response/status=] is not an [=ok status=],
301
- set |success| to false.
+ 1. If |response| is a [=network error=] or its [=response/status=] is not an
+ [=ok status=], return.
302
303
- 4. If |rule|'s [=CSSRule/parent style sheet=] is in [=quirks mode=]
+ 1. If |parentStylesheet| is in [=quirks mode=]
304
and |response| is [=CORS-same-origin=],
305
let |content type| be <code>"text/css"</code>.
306
Otherwise, let |content type| be the Content Type metadata of |response|.
307
308
- 5. If |content type| is not <code>"text/css"</code>,
+ 1. If |content type| is not <code>"text/css"</code>,
309
return.
310
311
- 6. Issue: Do we wait for sub-imports to run now?
312
- Need to explore this.
+ 1. Let |importedStylesheet| be the result of [=Parse a stylesheet|parsing=] |response|'s
+ [=response/body=]'s [=body/stream=] given |parsedUrl|.
313
314
- 7. Let |global| be the result of [=finding the relevant global object for a stylesheet=]
315
- given |rule|'s [=CSSRule/parent CSS style sheet=].
+ 1. Set |importedStylesheet|'s <a spec=cssom>origin-clean flag</a> to
+ |parentStylesheet|'s <a spec=cssom>origin-clean flag</a>.
316
317
- 8. [=Queue a global task=],
318
- given the [=networking task source=]
319
- and |global|,
320
- to [=process an imported stylesheet=]
321
- given |rule|,
322
- |success|,
323
- and |response|.
324
- </div>
325
326
- <div algorithm>
327
- To <dfn export>find the relevant global object for a stylesheet</dfn> given a CSS style sheet |stylesheet|:
328
329
- 1. If |stylesheet| has a [=CSSStyleSheet/parent CSS style sheet=],
330
- return the result of [=finding the relevant global object for a stylesheet=]
331
- given the [=CSSStyleSheet/parent CSS style sheet=].
332
333
- 2. If |stylesheet| has an [=CSSStyleSheet/owner node=],
334
- return the [=CSSStyleSheet/owner node's=] [=relevant global object=].
335
336
337
338
- To <dfn export>process an imported stylesheet</dfn>
339
- given a parent rule |rule|,
340
- a success flag |success|,
341
- and a response |response|:
+ 1. If |response|'s [=response/url=]'s [=url/origin=] is not the [=same origin=] as
+ |rule|'s [=relevant settings object=]'s [=environment settings object/origin=],
+ unset |importedStylesheet|'s <a spec=cssom>origin-clean flag</a>.
342
343
- Issue: Create a stylesheet, assign it to the parent rule.
+ 1. Set |rule|'s {{CSSImportRule/styleSheet}} to |importedStylesheet|.
344
</div>
345
346
<h3 id='content-type'>
css-fonts-4/Overview.bs
@@ -2944,9 +2944,18 @@ downloadable fonts to avoid large page reflows where possible.
2944
<h4 id="font-fetching-requirements" oldids="same-origin-restriction,allowing-cross-origin-font-loading">
2945
Font fetching requirements</h4>
2946
2947
-For font loads from @font-face rules, user agents must create a <a>request</a>
2948
-whose <var>url</var> is the URL given by the @font-face rule, whose <var>referrer</var>
2949
-is the stylesheet's URL, and whose <var>origin</var> is the URL of the containing document.
+<div algorithm>
+ To <dfn>fetch a font</dfn> given a selected [=/url=] |url| for ''@font-face'' |rule|,
+ [=fetch a style resource|fetch=] |url|, with |rule|'s
2950
+ <a spec=cssom for=CSSRule>parent CSS style sheet</a>, "font", "cors" and the following steps
2951
+ given [=/response=] |res|:
2952
2953
+ 1. Let |body| be |res|'s [=response/body=].
2954
2955
+ 1. If |body| is null, return.
2956
2957
+ 1. ISSUE: Load a font from |body| according to its type.
2958
+</div>
2959
2960
Note: The implications of this for authors are that fonts
2961
will typically not be loaded cross-origin unless authors specifically
css-syntax-3/Overview.bs
@@ -2121,7 +2121,8 @@ Parse A Comma-Separated List According To A CSS Grammar</h4>
2121
Parse a stylesheet</h4>
2122
2123
2124
- To <dfn export>parse a stylesheet</dfn> from an |input|:
+ To <dfn export>parse a stylesheet</dfn> from an |input| given [=/url=] or Null |location|
2125
+ (default null):
2126
2127
<ol>
2128
<li>
@@ -2134,7 +2135,7 @@ Parse a stylesheet</h4>
2134
2135
and set |input| to the result.
2136
2137
- Create a new stylesheet.
2138
+ Create a new stylesheet, with its <a spec=cssom>location</a> set to |location|.
2139
2140
2141
<a>Consume a list of rules</a> from |input|,
css-values-4/Overview.bs
@@ -989,6 +989,50 @@ URL Modifiers</h4>
989
Note: A <<url>> that is either unquoted or not wrapped in ''url()'' notation
990
cannot accept any <<url-modifier>>s.
991
992
+<h4 id='prcoessing-model'>
993
+URL processing model</h4>
994
995
+ <div algorithm>
996
+ To <dfn export>fetch a style resource</dfn> [=/url=] |url|, given a {{CSSStyleSheet}}
997
+ |sheet|, a string |destination|, a "no-cors" or "cors" |corsMode|, and an algorithm
998
+ |processResponse| accepting a [=/response=]:
999
1000
+ 1. Let |environmentSettings| be |sheet|'s [=relevant settings object=].
1001
1002
+ 1. Let |global| be |environmentSettings|'s [=environment settings object/global object=].
1003
1004
+ 1. Let |documentBase| be |environmentSettings|'s [=API base URL=].
1005
1006
+ 1. Let |base| be |sheet|'s <a spec=cssom>stylesheet base URL</a>. [[CSSOM]]
1007
1008
+ 1. Let |referrer| be |documentBase|.
1009
1010
+ 1. Let |handleResourceFetchDone| be to do nothing.
1011
1012
+ 1. If |base| is null, set |base| to |documentBase|.
1013
1014
+ 1. Let |parsedUrl| be the result of the [=URL parser=] steps with |url| and |base|.
1015
+ If the algorithm returns an error, return.
1016
1017
+ 1. If |corsMode| is not "cors", or |url| is the [=same origin=] as |environmentSettings|'s
1018
+ [=environment settings object/origin=], set |referrer| to |sheet|'s
1019
+ <a spec=cssom>location</a>. [[CSSOM]]
1020
1021
+ 1. Let |req| be a new [=/request=] whose [=request/url=] is |parsedUrl|, whose
1022
+ [=request/destination=] is |destination|, [=request/mode=] is |mode|, [=request/origin=]
1023
+ is |environmentSettings|'s [=environment settings object/origin=],
1024
+ [=request/credentials mode=] is "same-origin", [=request/use-url-credentials flag=] is
1025
+ set, and whose [=request/header list=] is a [=/header list=] containing a [=header=]
1026
+ with its [=header/name=] set to "referrer" and its [=header/value=] set to |referrer|.
1027
1028
+ 1. If |sheet|'s <a spec=cssom>origin-clean flag</a> is set, set |handleResourceFetchDone|
1029
+ given [=/response=] |res| to [=finalize and report timing=] with |res|, |global|, and
1030
+ <code>"css"</code>. [[CSSOM]]
1031
1032
+ 1. [=/Fetch=] |req|, with |processResponseDone| set to |handleResourceFetchDone|,
1033
+ |taskDestination| set to |global|, and |processResponse| set to |processResponse|.
1034
+ </div>
1035
1036
<h2 id="numeric-types">
1037
Numeric Data Types</h2>
1038