@@ -1021,8 +1021,7 @@ Relative URLs</h4>
10211021 the <a href="https://html.spec.whatwg.org/multipage/urls-and-fetching.html#dynamic-changes-to-base-urls">base URL is mutable</a> .
10221022
10231023 When a <<url>> appears in the computed value of a property,
1024- it is resolved to an absolute URL,
1025- as described in the preceding paragraph.
1024+ it is [=resolve a style resource URL|resolved to an absolute URL=] .
10261025 The computed value of a URL that the [=UA=] cannot resolve to an absolute URL is the specified value.
10271026
10281027 <div class="example">
@@ -1147,32 +1146,53 @@ URL Modifiers</h4>
11471146<h4 id='url-processing'>
11481147URL Processing Model</h4>
11491148
1149+ <div algorithm="style resource base URL">
1150+ To compute the <dfn>style resource base URL</dfn> for a [=CSS rule=] or a [=CSS declaration=] |cssRuleOrDeclaration|:
1151+ 1. Let |sheet| be null.
1152+
1153+ 1. If |cssRuleOrDeclaration| is a {{CSSStyleDeclaration}} whose {{CSSStyleDeclaration/parentRule}} is not null,
1154+ set |cssRuleOrDeclaration| to |cssRuleOrDeclaration|'s {{CSSStyleDeclaration/parentRule}} .
1155+
1156+ 1. If |cssRuleOrDeclaration| is a {{CSSRule}} , set |sheet| to |cssRuleOrDeclaration|'s {{CSSRule/parentStyleSheet}} .
1157+
1158+ 1. If |sheet| is not null:
1159+ 1. If |sheet|'s <a spec=cssom>stylesheet base URL</a> is not null,
1160+ return |sheet|'s <a spec=cssom>stylesheet base URL</a> .
1161+
1162+ 1. If |sheet|'s <a spec=cssom>location</a> is not null, return |sheet|' s <a spec=cssom>location</a> .
1163+
1164+ 1. Return |cssRuleOrDeclaration|'s [=relevant settings object=]' s [=environment settings object/API base URL=] .
1165+
1166+ </div>
1167+
1168+ <div algorithm="resolve a style resource URL">
1169+ To <dfn>resolve a style resource URL</dfn> from a [=/url=] or <<url>> |urlValue|,
1170+ and a a [=CSS rule=] or a [=CSS declaration=] |cssRuleOrDeclaration|:
1171+ 1. Let |base| be the [=style resource base URL=] given |cssRuleOrDeclaration|.
1172+ 1. Return the result of the [=URL parser=] steps with |urlValue|'s [=/url=] and |base|.
1173+ </div>
1174+
11501175 <div algorithm="fetch a style resource">
11511176 To <dfn export>fetch a style resource</dfn> from a [=/url=] or <<url>> |urlValue|,
1152- given a {{CSSStyleSheet}} |sheet |,
1177+ given an [=CSS rule=] or a [=css declaration=] |cssRuleOrDeclaration |,
11531178 a string |destination| matching a {{RequestDestination}} ,
11541179 a "no-cors" or "cors" |corsMode|,
11551180 and an algorithm |processResponse| accepting a [=/response=]
11561181 and a null, failure or byte stream:
11571182
1158- 1. Let |environmentSettings| be |sheet|'s [=relevant settings object=] .
1159-
1160- 2. Let |base| be |sheet|'s <a spec=cssom>stylesheet base URL</a> if it is not null,
1161- otherwise |environmentSettings|'s [=API base URL=] .
1162- [[CSSOM]]
1183+ 1. Let |parsedUrl| be the result of [=resolve a style resource URL|resolving=] |urlValue| given |cssRuleOrDeclaration|.
1184+ If that failed, return.
11631185
1164- 3. Let |parsedUrl| be the result of the [=URL parser=] steps
1165- with |urlValue|'s [=/url=] and |base|.
1166- If the algorithm returns an error, return.
1186+ 1. Let |settingsObject| be |cssRuleOrDeclaration|'s [=relevant settings object=] .
11671187
11681188 4. Let |req| be a new [=/request=] whose [=request/url=] is |parsedUrl|,
11691189 whose [=request/destination=] is |destination|,
11701190 [=request/mode=] is |corsMode|,
1171- [=request/origin=] is |environmentSettings |'s [=environment settings object/origin=] ,
1191+ [=request/origin=] is |settingsObject |'s [=environment settings object/origin=] ,
11721192 [=request/credentials mode=] is "same-origin",
11731193 [=request/use-url-credentials flag=] is set,
1174- [=request/client=] is |environmentSettings |,
1175- and whose [=request/referrer=] is |environmentSettings|'s [=API base URL=] .
1194+ [=request/client=] is |settingsObject |,
1195+ and whose [=request/referrer=] is "client" .
11761196
11771197 5. If |corsMode| is "no-cors", set |req|'s [=request/credentials mode=] to "include".
11781198
@@ -1181,14 +1201,14 @@ URL Processing Model</h4>
11811201 Note: This specification does not define any URL request modification steps,
11821202 but other specs may do so.
11831203
1184- 7. If |req|'s [=request/mode=] is "cors",
1185- set |req|'s [=request/referrer=] to |sheet|' s <a spec=cssom>location</a> . [[CSSOM]]
1204+ 7. If |req|'s [=request/mode=] is "cors", and |sheet| is not null, then
1205+ set |req|'s [=request/referrer=] to the [=style resource base URL=] given |cssRuleOrDeclaration| . [[CSSOM]]
11861206
11871207 8. If |sheet|'s <a spec=cssom>origin-clean flag</a> is set,
11881208 set |req|'s [=request/initiator type=] to "css". [[CSSOM]]
11891209
11901210 9. [=/Fetch=] |req|,
1191- with [=fetch/processresponseconsumebody=] set to |processResponse|.
1211+ with [=fetch/processresponseconsumebody|processResponseConsumeBody =] set to |processResponse|.
11921212 </div>
11931213
11941214 When interpreting [=URLs=] expressed in CSS,
0 commit comments