@@ -1021,8 +1021,7 @@ Relative URLs</h4>
1021
1021
the <a href="https://html.spec.whatwg.org/multipage/urls-and-fetching.html#dynamic-changes-to-base-urls">base URL is mutable</a> .
1022
1022
1023
1023
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=] .
1026
1025
The computed value of a URL that the [=UA=] cannot resolve to an absolute URL is the specified value.
1027
1026
1028
1027
<div class="example">
@@ -1147,32 +1146,53 @@ URL Modifiers</h4>
1147
1146
<h4 id='url-processing'>
1148
1147
URL Processing Model</h4>
1149
1148
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
+
1150
1175
<div algorithm="fetch a style resource">
1151
1176
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 |,
1153
1178
a string |destination| matching a {{RequestDestination}} ,
1154
1179
a "no-cors" or "cors" |corsMode|,
1155
1180
and an algorithm |processResponse| accepting a [=/response=]
1156
1181
and a null, failure or byte stream:
1157
1182
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.
1163
1185
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=] .
1167
1187
1168
1188
4. Let |req| be a new [=/request=] whose [=request/url=] is |parsedUrl|,
1169
1189
whose [=request/destination=] is |destination|,
1170
1190
[=request/mode=] is |corsMode|,
1171
- [=request/origin=] is |environmentSettings |'s [=environment settings object/origin=] ,
1191
+ [=request/origin=] is |settingsObject |'s [=environment settings object/origin=] ,
1172
1192
[=request/credentials mode=] is "same-origin",
1173
1193
[=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" .
1176
1196
1177
1197
5. If |corsMode| is "no-cors", set |req|'s [=request/credentials mode=] to "include".
1178
1198
@@ -1181,14 +1201,14 @@ URL Processing Model</h4>
1181
1201
Note: This specification does not define any URL request modification steps,
1182
1202
but other specs may do so.
1183
1203
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]]
1186
1206
1187
1207
8. If |sheet|'s <a spec=cssom>origin-clean flag</a> is set,
1188
1208
set |req|'s [=request/initiator type=] to "css". [[CSSOM]]
1189
1209
1190
1210
9. [=/Fetch=] |req|,
1191
- with [=fetch/processresponseconsumebody=] set to |processResponse|.
1211
+ with [=fetch/processresponseconsumebody|processResponseConsumeBody =] set to |processResponse|.
1192
1212
</div>
1193
1213
1194
1214
When interpreting [=URLs=] expressed in CSS,
0 commit comments