-
Notifications
You must be signed in to change notification settings - Fork 728
[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
Changes from 1 commit
64becb5
6865584
e47f6fe
05e285e
99b8996
ab66419
34002f2
ffc8bf7
69379fb
6dc96e0
e053f32
cdbbf63
e610888
45e648d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Add a generic method to fetch style resources, and make use of it in fonts & imports. [css-syntax-3]: Make sure we have a location when parsing a stylesheet. [css-values-3]: Add a reusable method to fetch a style-originated resource. [css-cascade-4]: Formalize the import algorithm to use the new fetch method. [css=fonts-4]: Formalize font loading to use the new fetch method.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -989,6 +989,50 @@ URL Modifiers</h4> | |
Note: A <<url>> that is either unquoted or not wrapped in ''url()'' notation | ||
cannot accept any <<url-modifier>>s. | ||
|
||
<h4 id='prcoessing-model'> | ||
URL processing model</h4> | ||
|
||
<div algorithm> | ||
To <dfn export>fetch a style resource</dfn> [=/url=] |url|, given a {{CSSStyleSheet}} | ||
|sheet|, a string |destination|, a "no-cors" or "cors" |corsMode|, and an algorithm | ||
|processResponse| accepting a [=/response=]: | ||
noamr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
1. Let |environmentSettings| be |sheet|'s [=relevant settings object=]. | ||
|
||
1. Let |global| be |environmentSettings|'s [=environment settings object/global object=]. | ||
|
||
1. Let |documentBase| be |environmentSettings|'s [=API base URL=]. | ||
|
||
1. Let |base| be |sheet|'s <a spec=cssom>stylesheet base URL</a>. [[CSSOM]] | ||
|
||
1. Let |referrer| be |documentBase|. | ||
|
||
1. Let |handleResourceFetchDone| be to do nothing. | ||
|
||
1. If |base| is null, set |base| to |documentBase|. | ||
|
||
1. Let |parsedUrl| be the result of the [=URL parser=] steps with |url| and |base|. | ||
If the algorithm returns an error, return. | ||
|
||
1. If |corsMode| is not "cors", or |url| is the [=same origin=] as |environmentSettings|'s | ||
[=environment settings object/origin=], set |referrer| to |sheet|'s | ||
<a spec=cssom>location</a>. [[CSSOM]] | ||
|
||
1. 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/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|. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, fixed. |
||
|
||
1. If |sheet|'s <a spec=cssom>origin-clean flag</a> is set, set |handleResourceFetchDone| | ||
given [=/response=] |res| to [=finalize and report timing=] with |res|, |global|, and | ||
<code>"css"</code>. [[CSSOM]] | ||
|
||
1. [=/Fetch=] |req|, with |processResponseDone| set to |handleResourceFetchDone|, | ||
|taskDestination| set to |global|, and |processResponse| set to |processResponse|. | ||
</div> | ||
|
||
<h2 id="numeric-types"> | ||
Numeric Data Types</h2> | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.