diff --git a/css-cascade-4/Overview.bs b/css-cascade-4/Overview.bs index 844f9fa8b18..5991b8fbd83 100644 --- a/css-cascade-4/Overview.bs +++ b/css-cascade-4/Overview.bs @@ -265,82 +265,45 @@ Processing Stylesheet Imports
To fetch an @import, given an ''@import'' rule |rule|: - 1. If |rule| has a <>, - and that condition is not true, - return nothing. - - 1. [=Parse a URL=] given |rule|'s URL, - relative to |rule|'s [=CSSRule/parent CSS style sheet's=] [=CSSStyleSheet/location=]. - - Issue: Make sure this is defined correctly, - drawing from the document when it's a <{style}> element, etc. - - If that fails, then return nothing. Otherwise, let |url| be the [=resulting URL record=]. + 1. Let |parentStylesheet| be |rule|'s parent CSS style sheet. + [[CSSOM]] - 2. Let |request| be a new [=/request=] - whose [=request/URL=] is |url|, - [=request/destination=] is "style", - [=request/mode=] is "no-cors", - [=request/credentials mode=] is "include", - and whose [=request/use-URL-credentials flag=] is set. - - 3. Set |request|'s client to ???? - - Issue: The Fetch spec doesn't provide any information about what a client is - or what it does, - so I have no idea of what to provide here. - - 4. Run the following steps [=in parallel=]: + 2. If |rule| has a <>, + and that condition is not true, + return. - 1. Let |response| be the result of [=/fetching=] |request|. + 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]] - 2. Let |success| initially be true. + 4. [=Fetch a style resource=] from |parsedUrl|, + with stylesheet |parentStylesheet|, + destination "style", + CORS mode "no-cors", + and processResponse being the following steps given [=/response=] |response| and + byte stream, null or failure |byteStream|: - 3. If |response| is a [=network error=] - or its [=response/status=] is not an [=ok status=], - set |success| to false. + 1. If |maybeByteStream| is not a byte stream, return. - 4. If |rule|'s [=CSSRule/parent style sheet=] is in [=quirks mode=] + 2. If |parentStylesheet| is in [=quirks mode=] and |response| is [=CORS-same-origin=], let |content type| be "text/css". Otherwise, let |content type| be the Content Type metadata of |response|. - 5. If |content type| is not "text/css", + 3. If |content type| is not "text/css", return. - 6. Issue: Do we wait for sub-imports to run now? - Need to explore this. + 4. Let |importedStylesheet| be the result of [=Parse a stylesheet|parsing=] |byteStram| + given |parsedUrl|. - 7. Let |global| be the result of [=finding the relevant global object for a stylesheet=] - given |rule|'s [=CSSRule/parent CSS style sheet=]. + 5. Set |importedStylesheet|'s origin-clean flag to + |parentStylesheet|'s origin-clean flag. - 8. [=Queue a global task=], - given the [=networking task source=] - and |global|, - to [=process an imported stylesheet=] - given |rule|, - |success|, - and |response|. -
- -
- To find the relevant global object for a stylesheet given a CSS style sheet |stylesheet|: - - 1. If |stylesheet| has a [=CSSStyleSheet/parent CSS style sheet=], - return the result of [=finding the relevant global object for a stylesheet=] - given the [=CSSStyleSheet/parent CSS style sheet=]. - - 2. If |stylesheet| has an [=CSSStyleSheet/owner node=], - return the [=CSSStyleSheet/owner node's=] [=relevant global object=]. -
- -
- To process an imported stylesheet - given a parent rule |rule|, - a success flag |success|, - and a response |response|: + 6. If |response| is not [=CORS-same-origin=], unset |importedStylesheet|'s + origin-clean flag. - Issue: Create a stylesheet, assign it to the parent rule. + 7. Set |rule|'s {{CSSImportRule/styleSheet}} to |importedStylesheet|.

diff --git a/css-color-4/Overview.bs b/css-color-4/Overview.bs index 56400f0f2dd..e591b7d409b 100644 --- a/css-color-4/Overview.bs +++ b/css-color-4/Overview.bs @@ -3992,6 +3992,17 @@ Specifying a color profile: the ''@color-profile'' at-rule

which reference this profile are invalid colors. + 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, + destination "color-profile", + CORS mode "cors", + and processResponse being the following steps given [=/response=] |res| and null, failure or + a byte stream |byteStream|: + If |byteStream| is a byte stream, + apply the color profile as parsed from |byteStream. + Note: The Internet Media Type ("MIME type") for ICC profiles is application/vnd.iccprofile. diff --git a/css-fonts-4/Overview.bs b/css-fonts-4/Overview.bs index 86c3a96e889..a1e077a4d31 100644 --- a/css-fonts-4/Overview.bs +++ b/css-fonts-4/Overview.bs @@ -2944,9 +2944,19 @@ downloadable fonts to avoid large page reflows where possible.

Font fetching requirements

-For font loads from @font-face rules, user agents must create a request -whose url is the URL given by the @font-face rule, whose referrer -is the stylesheet's URL, and whose origin is the URL of the containing document. +
+ To fetch a font given a selected [=/url=] |url| for ''@font-face'' |rule|, + [=fetch a style resource|fetch=] |url|, + with stylesheet being |rule|'s parent CSS style sheet, + destination "font", + CORS mode "cors", + and processResponse being the following steps given [=/response=] |res| and null, failure or a + byte stream |stream|: + + 1. If |stream| is null, return. + + 2. ISSUE: Load a font from |stream| according to its type. +
Note: The implications of this for authors are that fonts will typically not be loaded cross-origin unless authors specifically diff --git a/css-images-4/Overview.bs b/css-images-4/Overview.bs index 630add9cf9c..fbd62965ad2 100644 --- a/css-images-4/Overview.bs +++ b/css-images-4/Overview.bs @@ -1,4 +1,4 @@ -
+uel
 Title: CSS Images Module Level 4
 Status: ED
 Work Status: Exploring
@@ -139,6 +139,18 @@ Image References: the ''url()'' notation {#url-notation}
 Note: No change from [[css3-images]].
 
 
+Fetching External Images
+------------------------------------------------------------------------------------------
+To fetch an external image for a stylesheet,
+	given a [=/url=] |url| and {{CSSStyleSheet}} sheet,
+	[=fetch a style resource=] given |url|,
+	with stylesheet {{CSSStyleSheet}},
+	destination "image",
+	CORS mode "no-cors",
+	and processResponse being the following steps given [=/response=] |res| and null, failure or
+	a byte stream |byteStream|:
+		If |byteStream| is a byte stream, load the image from the byte stream.
+