From a8eac2de6cb9f5b11543444b214ee573aeaa1d6f Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Tue, 19 Mar 2024 15:29:12 +0000 Subject: [PATCH] Preload: only allow certain values for the `as` attribute Closes #8332 --- source | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/source b/source index ecce5858cd9..e33d226019a 100644 --- a/source +++ b/source @@ -15684,8 +15684,8 @@ interface HTMLLinkElement : HTMLElement {
  • Assert: options's href is not the empty string.

  • -
  • If options's destination is not - a destination, then return null.

  • +
  • If options's destination is + null, then return null.

  • Let url be the result of encoding-parsing a URL given @@ -15824,8 +15824,9 @@ interface HTMLLinkElement : HTMLElement {

    destination
    -
    the result of translating the - state of el's as attribute
    +
    the result of translating the state of el's as attribute.
    crossorigin
    the state of el's crossorigin @@ -16000,7 +16001,7 @@ interface HTMLLinkElement : HTMLElement {
  • If attribs["as"] exists, then set options's destination to the result of translating attribs["translating attribs["as"].

  • If attribs["crossorigin"] credentials mode is request's credentials mode.

    +

    To translate preload destination given a string destination:

    + +
      +
    1. If destination is neither "image", "font", + "script", "style", "fetch", + "track", or "json", then return null.

    2. + +
    3. Return the result of translating + destination.

    4. +
    +

    To preload given a link processing options options and an optional processResponse, which is an algorithm accepting a