Skip to content

[css-syntax-3][css-values-3][css-cascade-4][css-fonts-4] Formalize fetching and resource timing reporting #6715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Nov 3, 2021
Merged
Prev Previous commit
Next Next commit
Shapes, images, colors
  • Loading branch information
noamr committed Oct 12, 2021
commit 6dc96e01c6bf5dacc278453c0e5369b28bf6b706
11 changes: 11 additions & 0 deletions css-color-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3992,6 +3992,17 @@ Specifying a color profile: the ''@color-profile'' at-rule</h3>
which reference this profile
are <a>invalid color</a>s.

To <dfn>fetch an external color profile</dfn>, given a
''@color-profile'' rule |rule|,
[=fetch a style resource=] given |rule|'s URL,
with stylesheet being |rule|'s <a spec=cssom for=CSSRule>parent CSS style sheet</a>,
destination "color-profile",
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,
apply the color profile as parsed from |byteStream.

Note: The Internet Media Type ("MIME type")
for ICC profiles is
<a href="https://www.iana.org/assignments/media-types/application/vnd.iccprofile">application/vnd.iccprofile</a>.
Expand Down
14 changes: 13 additions & 1 deletion css-images-4/Overview.bs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<pre class='metadata'>
uel<pre class='metadata'>
Title: CSS Images Module Level 4
Status: ED
Work Status: Exploring
Expand Down Expand Up @@ -139,6 +139,18 @@ Image References: the ''url()'' notation {#url-notation}
Note: No change from [[css3-images]].


Fetching External Images
------------------------------------------------------------------------------------------
To <dfn>fetch an external image for a stylesheet</dfn>,
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.


<!--
████ ██ ██ ███ ██████ ████████ ██████ ████████ ████████ ███ ███
Expand Down
9 changes: 2 additions & 7 deletions css-shapes-2/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,8 @@ Shapes from Image</h3>
Fetching external shapes</h2>

To <dfn>fetch an external resource for a shape</dfn>, either an SVG or an image, given a
{{CSSStyleRule}} |rule|:
1. Let |parsedUrl| be the result of the [=URL parser=] steps with |rule|'s URL and |rule|'s
|parentStylesheet|'s <a spec=cssom>location</a>.
If the algorithm returns an error,
return. [[CSSOM]]

2. [=Fetch a style resource=] given |parsedUrl|,
{{CSSStyleRule}} |rule|,
[=fetch a style resource=] given |rule|'s URL,
with stylesheet being |rule|'s <a spec=cssom for=CSSRule>parent CSS style sheet</a>,
destination "image",
CORS mode "cors",
Expand Down
4 changes: 2 additions & 2 deletions css-values-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,8 +1021,8 @@ URL processing model</h4>
<a spec=cssom>location</a>. [[CSSOM]]

10. Let |req| be a new [=/request=] whose [=request/url=] is |parsedUrl|, whose
[=request/destination=] is |destination|, [=request/mode=] is |mode|, [=request/origin=]
is |environmentSettings|'s [=environment settings object/origin=],
[=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, and whose [=request/header list=] is a [=/header list=] containing a [=header=]
with its [=header/name=] set to "referrer" and its [=header/value=] set to |referrer|.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is somewhat wrong. You want to set the referrer field on the request. That will set the Referer (note, one r less) header. But good that it sets it explicitly though as CSS cannot take it from the global.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, fixed.

Expand Down