From 8966af0d32cc6d7c1151ed7946b6b2dee1efe66b 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 604c1c3c7d8..6fa8924b6fe 100644 --- a/source +++ b/source @@ -15802,8 +15802,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 @@ -15942,8 +15942,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 @@ -16118,7 +16119,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