From f3e1dbce111b5e5facbdb7c02ad190b42b99a19e Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Wed, 14 Dec 2022 11:41:46 +0200 Subject: [PATCH 01/10] WIP: request modifiers --- css-fonts-4/Overview.bs | 2 +- css-images-4/Overview.bs | 2 +- css-values-4/Overview.bs | 70 ++++++++++++++++++++++++++++++---------- 3 files changed, 55 insertions(+), 19 deletions(-) diff --git a/css-fonts-4/Overview.bs b/css-fonts-4/Overview.bs index 3d8dfe4bf9cb..d01a2f579c49 100644 --- a/css-fonts-4/Overview.bs +++ b/css-fonts-4/Overview.bs @@ -3208,7 +3208,7 @@ downloadable fonts to avoid large page reflows where possible. Font fetching requirements
- To fetch a font given a selected [=/url=] |url| for ''@font-face'' |rule|, + 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, destination "font", diff --git a/css-images-4/Overview.bs b/css-images-4/Overview.bs index 945ec631d0e1..026625b3cd5f 100644 --- a/css-images-4/Overview.bs +++ b/css-images-4/Overview.bs @@ -144,7 +144,7 @@ Fetching External Images {#fetching-images} ------------------------------------------- To fetch an external image for a stylesheet, - given a [=/url=] |url| and {{CSSStyleSheet}} sheet, + given a <> |url| and {{CSSStyleSheet}} sheet, [=fetch a style resource=] given |url|, with stylesheet {{CSSStyleSheet}}, destination "image", diff --git a/css-values-4/Overview.bs b/css-values-4/Overview.bs index 6eb3acb2a2f3..bd2dabad987d 100644 --- a/css-values-4/Overview.bs +++ b/css-values-4/Overview.bs @@ -1050,8 +1050,8 @@ URL Modifiers URL Processing Model
- To fetch a style resource from [=/url=] |url|, - given a {{CSSStyleSheet}} |sheet|, + To fetch a style resource from [=/url=] or + <> |urlValue|, given a {{CSSStyleSheet}} |sheet|, 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 @@ -1063,33 +1063,69 @@ URL Processing Model 4. Let |base| be |sheet|'s stylesheet base URL. [[CSSOM]] - 5. Let |referrer| be |documentBase|. + 5. If |base| is null, set |base| to |documentBase|. - 6. If |base| is null, set |base| to |documentBase|. + 6. Let |url| be |urlValue|. - 7. Let |parsedUrl| be the result of the [=URL parser=] steps with |url| and |base|. - If the algorithm returns an error, return. + 7. If |urlValue| is a <>, set |url| to |urlValue|'s [/=url]. - 8. If |corsMode| is "cors", set |referrer| to |sheet|'s - location. [[CSSOM]] + 8. Let |parsedUrl| be the result of the [=URL parser=] steps with |url| and |base|. + If the algorithm returns an error, return. 9. 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/credentials mode=] is "same-origin", [=request/use-url-credentials flag=] is - set, [=request/client=] is |environmentSettings|, and whose [=request/referrer=] is - |referrer|. + [=request/origin=] is |environmentSettings|'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 |documentBase|. - 10. If |sheet|'s origin-clean flag is set, set |req|'s + 10. [=Apply request modifiers from URL value=] given |req| and |urlValue|. + + 11. If |req|'s [=request/mode] is "cors", set |req|'s [=request/referrer=] to |sheet|'s + location. [[CSSOM]] + + 12. If |sheet|'s origin-clean flag is set, set |req|'s [=request/initiator type=] to "css". [[CSSOM]] - 11. [=/Fetch|fetching=] |req|, with [=fetch/processresponseconsumebody=] set to + 13. [=/Fetch|fetching=] |req|, with [=fetch/processresponseconsumebody=] set to |processResponse|.
- Note: Resources loaded through CSS style sheets - are cached and cleared the same as any other resources - linked from the document. +

+Request URL Modifiers

+ + The <>s represent <>s that affect the resource's + [=/request=]. Each <> has a request modifier steps which accepts + a [=/requests=]. + +
+		<> = <> | <> | <>
+		<> = crossorigin(anonymous | use-credentials)
+		<> = integrity(<>)
+		<> = referrerpolicy(no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url)
+	
+ +
+
<> = crossorigin(anonymous | use-credentials) +
The [=request modifier steps=] for this modifier given [=/request=] |req| are: + 1. Set [=/request=]'s [=request/mode=] to "cors". + + 2. If the given value is ''use-credentials'', set [=/request=]'s + [=request/credentials mode=] to "include". + +
<> = integrity(<>) +
The [=request modifier steps=] for this modifier given [=/request=] |req| are to set + [=/request=]'s [=request/integrity metadata=] to the given <>. + +
<> = referrerpolicy(no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url) +
The [=request modifier steps=] for this modifier given [=/request=] |req| are to set + [=/request=]'s [=request/referrer policy=] to the [=referrer policy=] that matches the given value. + +
+ To apply request modifiers from URL value given a [=/request=] |req| and a <> + |urlValue|, call the [=request modifier steps=] for <>'s <>s in sequence + given |req|. +

Numeric Data Types

From 402192ef4e0ba96d475fba14ba2c2bc94660f477 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 15 Dec 2022 06:55:06 +0200 Subject: [PATCH 02/10] Update css-values-4/Overview.bs Co-authored-by: Tab Atkins Jr. --- css-values-4/Overview.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css-values-4/Overview.bs b/css-values-4/Overview.bs index bd2dabad987d..2ed2d9ea6dbc 100644 --- a/css-values-4/Overview.bs +++ b/css-values-4/Overview.bs @@ -1067,7 +1067,7 @@ URL Processing Model 6. Let |url| be |urlValue|. - 7. If |urlValue| is a <>, set |url| to |urlValue|'s [/=url]. + 7. If |urlValue| is a <>, set |url| to |urlValue|'s [=/url=]. 8. Let |parsedUrl| be the result of the [=URL parser=] steps with |url| and |base|. If the algorithm returns an error, return. From 9e1acada725a035a981902248f2df82f89ad2882 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 15 Dec 2022 06:55:19 +0200 Subject: [PATCH 03/10] Update css-values-4/Overview.bs Co-authored-by: Tab Atkins Jr. --- css-values-4/Overview.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css-values-4/Overview.bs b/css-values-4/Overview.bs index 2ed2d9ea6dbc..6462ec290cb7 100644 --- a/css-values-4/Overview.bs +++ b/css-values-4/Overview.bs @@ -1081,8 +1081,8 @@ URL Processing Model 10. [=Apply request modifiers from URL value=] given |req| and |urlValue|. - 11. If |req|'s [=request/mode] is "cors", set |req|'s [=request/referrer=] to |sheet|'s - location. [[CSSOM]] + 11. If |req|'s [=request/mode] is "cors", + set |req|'s [=request/referrer=] to |sheet|'s location. [[CSSOM]] 12. If |sheet|'s origin-clean flag is set, set |req|'s [=request/initiator type=] to "css". [[CSSOM]] From c97ba4d7f7f3cbc020cf146f61e8cb35f3df56df Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 15 Dec 2022 06:55:24 +0200 Subject: [PATCH 04/10] Update css-values-4/Overview.bs Co-authored-by: Tab Atkins Jr. --- css-values-4/Overview.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css-values-4/Overview.bs b/css-values-4/Overview.bs index 6462ec290cb7..9c25213f0006 100644 --- a/css-values-4/Overview.bs +++ b/css-values-4/Overview.bs @@ -1084,8 +1084,8 @@ URL Processing Model 11. If |req|'s [=request/mode] is "cors", set |req|'s [=request/referrer=] to |sheet|'s location. [[CSSOM]] - 12. If |sheet|'s origin-clean flag is set, set |req|'s - [=request/initiator type=] to "css". [[CSSOM]] + 12. If |sheet|'s origin-clean flag is set, + set |req|'s [=request/initiator type=] to "css". [[CSSOM]] 13. [=/Fetch|fetching=] |req|, with [=fetch/processresponseconsumebody=] set to |processResponse|. From 59a3ac2f577b2fee703a2233be8712426921464f Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 15 Dec 2022 06:55:30 +0200 Subject: [PATCH 05/10] Update css-values-4/Overview.bs Co-authored-by: Tab Atkins Jr. --- css-values-4/Overview.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css-values-4/Overview.bs b/css-values-4/Overview.bs index 9c25213f0006..d7419a515355 100644 --- a/css-values-4/Overview.bs +++ b/css-values-4/Overview.bs @@ -1087,8 +1087,8 @@ URL Processing Model 12. If |sheet|'s origin-clean flag is set, set |req|'s [=request/initiator type=] to "css". [[CSSOM]] - 13. [=/Fetch|fetching=] |req|, with [=fetch/processresponseconsumebody=] set to - |processResponse|. + 13. [=/Fetch|fetching=] |req|, + with [=fetch/processresponseconsumebody=] set to |processResponse|.

From 63b557bbeed65e1ab29f67cd1c362b89b7e2e7b0 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 15 Dec 2022 06:55:35 +0200 Subject: [PATCH 06/10] Update css-values-4/Overview.bs Co-authored-by: Tab Atkins Jr. --- css-values-4/Overview.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css-values-4/Overview.bs b/css-values-4/Overview.bs index d7419a515355..b98d157ba7f6 100644 --- a/css-values-4/Overview.bs +++ b/css-values-4/Overview.bs @@ -1096,7 +1096,7 @@ Request URL Modifiers

The <>s represent <>s that affect the resource's [=/request=]. Each <> has a request modifier steps which accepts - a [=/requests=]. + a [=/request=].
 		<> = <> | <> | <>

From 353a224e4a3aa39dd8f84014f9d92bf3cbddc133 Mon Sep 17 00:00:00 2001
From: Noam Rosenthal 
Date: Thu, 15 Dec 2022 06:55:48 +0200
Subject: [PATCH 07/10] Update css-values-4/Overview.bs

Co-authored-by: Tab Atkins Jr. 
---
 css-values-4/Overview.bs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/css-values-4/Overview.bs b/css-values-4/Overview.bs
index b98d157ba7f6..73988b4760f7 100644
--- a/css-values-4/Overview.bs
+++ b/css-values-4/Overview.bs
@@ -1108,7 +1108,7 @@ Request URL Modifiers
 	
<> = crossorigin(anonymous | use-credentials)
The [=request modifier steps=] for this modifier given [=/request=] |req| are: - 1. Set [=/request=]'s [=request/mode=] to "cors". + 1. Set [=/request=]'s [=request/mode=] to "cors". 2. If the given value is ''use-credentials'', set [=/request=]'s [=request/credentials mode=] to "include". From 4673423149a93087c71dd3888dc3df1fb6d0ffed Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 15 Dec 2022 14:17:17 +0200 Subject: [PATCH 08/10] Fix lots of style thingies --- css-values-4/Overview.bs | 48 ++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/css-values-4/Overview.bs b/css-values-4/Overview.bs index 73988b4760f7..dbdb6eae3ddd 100644 --- a/css-values-4/Overview.bs +++ b/css-values-4/Overview.bs @@ -1059,35 +1059,28 @@ URL Processing Model 1. Let |environmentSettings| be |sheet|'s [=relevant settings object=]. - 3. Let |documentBase| be |environmentSettings|'s [=API base URL=]. + 2. Let |base| be |sheet|'s stylesheet base URL if it is not null, otherwise + |environmentSettings|'s [=API base URL=]. [[CSSOM]] - 4. Let |base| be |sheet|'s stylesheet base URL. [[CSSOM]] - - 5. If |base| is null, set |base| to |documentBase|. - - 6. Let |url| be |urlValue|. - - 7. If |urlValue| is a <>, set |url| to |urlValue|'s [=/url=]. - - 8. Let |parsedUrl| be the result of the [=URL parser=] steps with |url| and |base|. + 3. Let |parsedUrl| be the result of the [=URL parser=] steps with |urlValue|'s [=/url=] and |base|. If the algorithm returns an error, return. - 9. Let |req| be a new [=/request=] whose [=request/url=] is |parsedUrl|, whose + 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/credentials mode=] is - "same-origin", [=request/use-url-credentials flag=] is set, [=request/client=] is - |environmentSettings|, and whose [=request/referrer=] is |documentBase|. + [=request/origin=] is |environmentSettings|'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=]. - 10. [=Apply request modifiers from URL value=] given |req| and |urlValue|. + 5. [=Apply request modifiers from URL value=] given |req| and |urlValue|. - 11. If |req|'s [=request/mode] is "cors", + 6. If |req|'s [=request/mode=] is "cors", set |req|'s [=request/referrer=] to |sheet|'s location. [[CSSOM]] - 12. If |sheet|'s origin-clean flag is set, + 7. If |sheet|'s origin-clean flag is set, set |req|'s [=request/initiator type=] to "css". [[CSSOM]] - 13. [=/Fetch|fetching=] |req|, + 8. [=/Fetch=] |req|, with [=fetch/processresponseconsumebody=] set to |processResponse|. @@ -1099,31 +1092,32 @@ Request URL Modifiers a [=/request=].
-		<> = <> | <> | <>
+		<> = <> | <> | <>
 		<> = crossorigin(anonymous | use-credentials)
 		<> = integrity(<>)
 		<> = referrerpolicy(no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url)
 	
-
<> = crossorigin(anonymous | use-credentials) +
<> = crossorigin(anonymous | use-credentials)
The [=request modifier steps=] for this modifier given [=/request=] |req| are: 1. Set [=/request=]'s [=request/mode=] to "cors". 2. If the given value is ''use-credentials'', set [=/request=]'s - [=request/credentials mode=] to "include". + [=request/credentials mode=] to "include". -
<> = integrity(<>) +
<> = integrity(<>)
The [=request modifier steps=] for this modifier given [=/request=] |req| are to set - [=/request=]'s [=request/integrity metadata=] to the given <>. + [=/request=]'s [=request/integrity metadata=] to the given <>. -
<> = referrerpolicy(no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url) +
<> = referrerpolicy(no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url)
The [=request modifier steps=] for this modifier given [=/request=] |req| are to set - [=/request=]'s [=request/referrer policy=] to the [=referrer policy=] that matches the given value. + [=/request=]'s [=request/referrer policy=] to the {{ReferrerPolicy}} that matches the given value. +
To apply request modifiers from URL value given a [=/request=] |req| and a <> - |urlValue|, call the [=request modifier steps=] for <>'s <>s in sequence + |url|, call the [=request modifier steps=] for |url|'s <>s in sequence given |req|.
From 240822a8aee39fc7f22dcbdcd95979114168158f Mon Sep 17 00:00:00 2001 From: Tab Atkins Jr Date: Tue, 7 Mar 2023 15:39:22 -0800 Subject: [PATCH 09/10] Update css-values-4/Overview.bs --- css-values-4/Overview.bs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/css-values-4/Overview.bs b/css-values-4/Overview.bs index dbdb6eae3ddd..032abd8ba861 100644 --- a/css-values-4/Overview.bs +++ b/css-values-4/Overview.bs @@ -1087,9 +1087,10 @@ URL Processing Model

Request URL Modifiers

- The <>s represent <>s that affect the resource's - [=/request=]. Each <> has a request modifier steps which accepts - a [=/request=]. + The <>s represent <>s + that affect the resource's [=/request=]. + Each <> has a request modifier steps + which accepts a [=/request=].
 		<> = <> | <> | <>

From d89efe0205ab47cc5a7edd2346a64063cf22dbe7 Mon Sep 17 00:00:00 2001
From: Tab Atkins Jr 
Date: Tue, 7 Mar 2023 15:39:28 -0800
Subject: [PATCH 10/10] Update css-values-4/Overview.bs

---
 css-values-4/Overview.bs | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/css-values-4/Overview.bs b/css-values-4/Overview.bs
index 032abd8ba861..dd5b235d518e 100644
--- a/css-values-4/Overview.bs
+++ b/css-values-4/Overview.bs
@@ -1117,9 +1117,11 @@ Request URL Modifiers
 	
- To apply request modifiers from URL value given a [=/request=] |req| and a <> - |url|, call the [=request modifier steps=] for |url|'s <>s in sequence - given |req|. + To apply request modifiers from URL value + given a [=/request=] |req| + and a <> |url|, + call the [=request modifier steps=] for |url|'s <>s in sequence + given |req|.