From aa0f4e89a9c34273ba2a4b70169cc50b247cb8da Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 1 Apr 2024 04:39:36 +0000 Subject: [PATCH] Preload: only allow certain values for as="" Closes #8332. --- source | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/source b/source index eca9f85cdb9..0de2e1efe08 100644 --- a/source +++ b/source @@ -15721,8 +15721,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 @@ -15861,8 +15861,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 @@ -16037,7 +16038,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 a preload destination given a string destination:

    + +
      +
    1. If destination is not "fetch", "font", + "image", "script", "style", + or "track", 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