Skip to content
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

Update fetchPriority to match the final spec #24595

Merged
merged 2 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion files/en-us/learn/performance/multimedia/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Getting the most important images in front of visitors sooner than the less impo

The first thing to check is that your content images use `<img>` or `<picture>` elements and your background images are defined in CSS with `background-image` — images referenced in `<img>` elements are assigned a higher loading priority than background images.

Secondly, with the adoption of Priority Hints, you can control the priority further by adding an `importance` attribute to your image tags. An example use case for priority hints on images are carousels where the first image is a higher priority than the subsequent images.
Secondly, with the adoption of Priority Hints, you can control the priority further by adding a `fetchPriority` attribute to your image tags. An example use case for priority hints on images are carousels where the first image is a higher priority than the subsequent images.

### Rendering strategy: preventing jank when loading images

Expand Down
5 changes: 5 additions & 0 deletions files/en-us/web/api/fetch/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ fetch(resource, options)
- `signal`
- : An {{domxref("AbortSignal")}} object instance; allows you to communicate with a
fetch request and abort it if desired via an {{domxref("AbortController")}}.
- `priority`
- : Specifies the priority of the fetch request relative to other requests of the same type. Must be one of the following strings:
- `high`: A high priority fetch request relative to other requests of the same type.
- `low`: A low priority fetch request relative to other requests of the same type.
- `auto`: Automatically determine the priority of the fetch request relative to other requests of the same type (default).

### Return value

Expand Down
2 changes: 0 additions & 2 deletions files/en-us/web/api/request/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ You can create a new `Request` object using the {{domxref("Request.Request","Req
- : Contains the request's method (`GET`, `POST`, etc.)
- {{domxref("Request.mode")}} {{ReadOnlyInline}}
- : Contains the mode of the request (e.g., `cors`, `no-cors`, `same-origin`, `navigate`.)
- {{domxref("Request.priority")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : Contains the request's priority hint (e.g., `high`, `low`, `auto`).
- {{domxref("Request.redirect")}} {{ReadOnlyInline}}
- : Contains the mode for how redirects are handled. It may be one of `follow`, `error`, or `manual`.
- {{domxref("Request.referrer")}} {{ReadOnlyInline}}
Expand Down
52 changes: 0 additions & 52 deletions files/en-us/web/api/request/priority/index.md

This file was deleted.

5 changes: 5 additions & 0 deletions files/en-us/web/api/request/request/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ new Request(input, options)
- : A boolean that indicates whether to make a persistent connection for multiple requests/responses.
- `signal`
- : An [AbortSignal](/en-US/docs/Web/API/abortsignal) object which can be used to communicate with/abort a request.
- `priority`
- : Specifies the priority of the fetch request relative to other requests of the same type. Must be one of the following strings:
- `high`: A high priority fetch request relative to other requests of the same type.
- `low`: A low priority fetch request relative to other requests of the same type.
- `auto`: Automatically determine the priority of the fetch request relative to other requests of the same type (default).

If you construct a new `Request` from an existing `Request`, any options you set in an _options_ argument for the new request replace any corresponding options set in the original `Request`. For example:

Expand Down
11 changes: 0 additions & 11 deletions files/en-us/web/html/attributes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -741,17 +741,6 @@ Elements in HTML have **attributes**; these are additional values that configure
attribute must be unique.
</td>
</tr>
<tr>
<td>
<code><a href="/en-US/docs/Web/HTML/Attributes/importance">importance</a></code>
{{experimental_inline}}
</td>
<td>
{{ HTMLElement("iframe") }}, {{ HTMLElement("img") }},
{{ HTMLElement("link") }}, {{ HTMLElement("script") }}
</td>
<td>Indicates the relative fetch priority for the resource.</td>
</tr>
<tr>
<td>
<code><a href="/en-US/docs/Web/Security/Subresource_Integrity">integrity</a></code>
Expand Down
11 changes: 0 additions & 11 deletions files/en-us/web/html/element/iframe/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,6 @@ This element includes the [global attributes](/en-US/docs/Web/HTML/Global_attrib

- : A [Content Security Policy](/en-US/docs/Web/HTTP/CSP) enforced for the embedded resource. See {{domxref("HTMLIFrameElement.csp")}} for details.

- {{htmlattrdef("fetchpriority")}} {{Experimental_Inline}}

- : Provides a hint of the relative priority to use when fetching the iframe document. Allowed values:

- `high`
- : Signals a high-priority fetch relative to other iframe documents.
- `low`
- : Signals a low-priority fetch relative to other iframe documents.
- `auto`
- : Default: Signals automatic determination of fetch priority relative to other iframe documents.

- {{htmlattrdef("height")}}
- : The height of the frame in CSS pixels. Default is `150`.
- {{htmlattrdef("loading")}} {{experimental_inline}}
Expand Down
5 changes: 0 additions & 5 deletions files/jsondata/SpecData.json
Original file line number Diff line number Diff line change
Expand Up @@ -1339,11 +1339,6 @@
"url": "https://w3c.github.io/presentation-api/",
"status": "CR"
},
"Priority Hints": {
"name": "Priority Hints",
"url": "https://wicg.github.io/priority-hints/",
"status": "Draft"
},
"Promise.any": {
"name": "Promise.any",
"url": "https://tc39.es/proposal-promise-any/",
Expand Down