diff --git a/css-cascade-4/Overview.bs b/css-cascade-4/Overview.bs
index 24d3d0d0387..df7a1193c9b 100644
--- a/css-cascade-4/Overview.bs
+++ b/css-cascade-4/Overview.bs
@@ -279,13 +279,8 @@ Processing Stylesheet Imports
and that condition is not true,
return.
- 3. Let |parsedUrl| be the result of the [=URL parser=] steps with |rule|'s URL and
- |parentStylesheet|'s location.
- If the algorithm returns an error,
- return. [[CSSOM]]
-
- 4. [=Fetch a style resource=] from |parsedUrl|,
- with stylesheet |parentStylesheet|,
+ 4. [=Fetch a style resource=] from |rule|'s URL,
+ with ruleOrDeclaration |rule|,
destination "style",
CORS mode "no-cors",
and processResponse being the following steps given [=/response=] |response| and
diff --git a/css-color-5/Overview.bs b/css-color-5/Overview.bs
index b821d451423..9edcb76cafc 100644
--- a/css-color-5/Overview.bs
+++ b/css-color-5/Overview.bs
@@ -1994,7 +1994,7 @@ or any other color or monochrome output device which has been characterized.
To fetch an external color profile, given a
''@color-profile'' rule |rule|,
[=fetch a style resource=] given |rule|'s URL,
- with stylesheet being |rule|'s parent CSS style sheet,
+ with ruleOrDeclaration being |rule|,
destination "color-profile",
CORS mode "cors",
and processResponse being the following steps given [=/response=] |/res| and null, failure or
diff --git a/css-fonts-4/Overview.bs b/css-fonts-4/Overview.bs
index 7b3a5a8e96b..a9e0e4176fd 100644
--- a/css-fonts-4/Overview.bs
+++ b/css-fonts-4/Overview.bs
@@ -3698,7 +3698,7 @@ Font fetching requirements
To
fetch a font given a selected <
> |url| for ''@font-face'' |rule|,
[=fetch a style resource|fetch=] |url|,
- with stylesheet being |rule|'s parent CSS style sheet,
+ with ruleOrDeclaration being |rule|,
destination "font",
CORS mode "cors",
and processResponse being the following steps given [=/response=] |res| and null, failure or a
diff --git a/css-images-4/Overview.bs b/css-images-4/Overview.bs
index 57e602f8283..f3c7c1d2624 100644
--- a/css-images-4/Overview.bs
+++ b/css-images-4/Overview.bs
@@ -145,9 +145,9 @@ Fetching External Images {#fetching-images}
-------------------------------------------
To fetch an external image for a stylesheet,
- given a <> |url| and {{CSSStyleSheet}} sheet,
+ given a <> |url| and a [=CSS style declaration=] |declaration|,
[=fetch a style resource=] given |url|,
- with stylesheet {{CSSStyleSheet}},
+ with ruleOrDeclaration being |declaration|,
destination "image",
CORS mode "no-cors",
and processResponse being the following steps
diff --git a/css-shapes-2/Overview.bs b/css-shapes-2/Overview.bs
index d60aaac3153..e13e02af03e 100644
--- a/css-shapes-2/Overview.bs
+++ b/css-shapes-2/Overview.bs
@@ -610,9 +610,9 @@ Shapes from Image
Fetching external shapes
To fetch an external resource for a shape, either an SVG or an image, given a
- {{CSSStyleRule}} |rule|,
- [=fetch a style resource=] given |rule|'s URL,
- with stylesheet being |rule|'s parent CSS style sheet,
+ [=CSS style declaration=] |declaration|,
+ [=fetch a style resource=] given a <> value,
+ with ruleOrDeclaration being |declaration|,
destination "image",
CORS mode "cors",
and processResponse being the following steps given [=/response=] |res| and null, failure or
diff --git a/css-values-4/Overview.bs b/css-values-4/Overview.bs
index f74ad22e3d3..c8dce68d6de 100644
--- a/css-values-4/Overview.bs
+++ b/css-values-4/Overview.bs
@@ -1021,8 +1021,7 @@ Relative URLs
the base URL is mutable.
When a <> appears in the computed value of a property,
- it is resolved to an absolute URL,
- as described in the preceding paragraph.
+ it is [=resolve a style resource URL|resolved to an absolute URL=].
The computed value of a URL that the [=UA=] cannot resolve to an absolute URL is the specified value.
@@ -1147,32 +1146,53 @@ URL Modifiers
URL Processing Model
+
+ To compute the
style resource base URL for a [=CSS rule=] or a [=CSS declaration=] |cssRuleOrDeclaration|:
+ 1. Let |sheet| be null.
+
+ 1. If |cssRuleOrDeclaration| is a {{CSSStyleDeclaration}} whose {{CSSStyleDeclaration/parentRule}} is not null,
+ set |cssRuleOrDeclaration| to |cssRuleOrDeclaration|'s {{CSSStyleDeclaration/parentRule}}.
+
+ 1. If |cssRuleOrDeclaration| is a {{CSSRule}}, set |sheet| to |cssRuleOrDeclaration|'s {{CSSRule/parentStyleSheet}}.
+
+ 1. If |sheet| is not null:
+ 1. If |sheet|'s
stylesheet base URL is not null,
+ return |sheet|'s
stylesheet base URL.
+
+ 1. If |sheet|'s
location is not null, return |sheet|'s
location.
+
+ 1. Return |cssRuleOrDeclaration|'s [=relevant settings object=]'s [=environment settings object/API base URL=].
+
+
+
+
+ To resolve a style resource URL from a [=/url=] or <> |urlValue|,
+ and a a [=CSS rule=] or a [=CSS declaration=] |cssRuleOrDeclaration|:
+ 1. Let |base| be the [=style resource base URL=] given |cssRuleOrDeclaration|.
+ 1. Return the result of the [=URL parser=] steps with |urlValue|'s [=/url=] and |base|.
+
+
To
fetch a style resource from a [=/url=] or <
> |urlValue|,
- given a {{CSSStyleSheet}} |sheet|,
+ given an [=CSS rule=] or a [=css declaration=] |cssRuleOrDeclaration|,
a string |destination| matching a {{RequestDestination}},
a "no-cors" or "cors" |corsMode|,
and an algorithm |processResponse| accepting a [=/response=]
and a null, failure or byte stream:
- 1. Let |environmentSettings| be |sheet|'s [=relevant settings object=].
-
- 2. Let |base| be |sheet|'s stylesheet base URL if it is not null,
- otherwise |environmentSettings|'s [=API base URL=].
- [[CSSOM]]
+ 1. Let |parsedUrl| be the result of [=resolve a style resource URL|resolving=] |urlValue| given |cssRuleOrDeclaration|.
+ If that failed, return.
- 3. Let |parsedUrl| be the result of the [=URL parser=] steps
- with |urlValue|'s [=/url=] and |base|.
- If the algorithm returns an error, return.
+ 1. Let |settingsObject| be |cssRuleOrDeclaration|'s [=relevant settings object=].
4. Let |req| be a new [=/request=] whose [=request/url=] is |parsedUrl|,
whose [=request/destination=] is |destination|,
[=request/mode=] is |corsMode|,
- [=request/origin=] is |environmentSettings|'s [=environment settings object/origin=],
+ [=request/origin=] is |settingsObject|'s [=environment settings object/origin=],
[=request/credentials mode=] is "same-origin",
[=request/use-url-credentials flag=] is set,
- [=request/client=] is |environmentSettings|,
- and whose [=request/referrer=] is |environmentSettings|'s [=API base URL=].
+ [=request/client=] is |settingsObject|,
+ and whose [=request/referrer=] is "client".
5. If |corsMode| is "no-cors", set |req|'s [=request/credentials mode=] to "include".
@@ -1181,14 +1201,14 @@ URL Processing Model
Note: This specification does not define any URL request modification steps,
but other specs may do so.
- 7. If |req|'s [=request/mode=] is "cors",
- set |req|'s [=request/referrer=] to |sheet|'s location. [[CSSOM]]
+ 7. If |req|'s [=request/mode=] is "cors", and |sheet| is not null, then
+ set |req|'s [=request/referrer=] to the [=style resource base URL=] given |cssRuleOrDeclaration|. [[CSSOM]]
8. If |sheet|'s origin-clean flag is set,
set |req|'s [=request/initiator type=] to "css". [[CSSOM]]
9. [=/Fetch=] |req|,
- with [=fetch/processresponseconsumebody=] set to |processResponse|.
+ with [=fetch/processresponseconsumebody|processResponseConsumeBody=] set to |processResponse|.
When interpreting [=URLs=] expressed in CSS,