From 6b6ec06127a50436fd40a49a1863a8a96bee5f82 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Fri, 14 Nov 2025 15:40:06 +0000 Subject: [PATCH 1/3] Bypass blob URL partitioning for top-level self fetches Implements the fetch spec sid of bypassing partitioning when a top-level blob URL document attempts to fetch itself. For more info see: https://github.com/w3c/FileAPI/issues/210 --- fetch.bs | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/fetch.bs b/fetch.bs index 8d19ae84d..b52a6a787 100755 --- a/fetch.bs +++ b/fetch.bs @@ -5363,14 +5363,41 @@ returning a response directly, or allowing the request to proceed by returning n
  • Let isTopLevelNavigation be true if request's destination is "document"; otherwise, false. -

  • If isTopLevelNavigation is false and requestEnvironment is null, - then return a network error. +

  • Let isTopLevelSelfFetch be false. + +

  • If request's client is non-null: +

      +
    1. Let global be request's client's + global object. + +

    2. +

      If all of the following conditions are true: + +

        +
      • global is a {{Window}} object; + +

      • global's navigable is not null; -

      • Let navigationOrEnvironment be the string "navigation" if - isTopLevelNavigation is true; otherwise, requestEnvironment. +

      • global's navigable's parent + is null; and + +

      • requestEnvironment's creation URL + equals request's current URL, +

      + +

      then set isTopLevelSelfFetch to false. + +

    3. Let stringOrEnvironment be requestEnvironment. + +

    4. If isTopLevelNavigation is true, then set stringOrEnvironment + to the string "navigation". + +

    5. Otherwise, if isTopLevelSelfFetch is true, then set + stringOrEnvironment to the string "top-level-self-fetch". +

  • Let blob be the result of obtaining a blob object given - blobURLEntry and navigationOrEnvironment. + blobURLEntry and stringOrEnvironment.

  • If blob is not a {{Blob}} object, then return a network error. From 30c735affc58e2d14f097ae1e0f423f5883bb4ba Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Wed, 19 Nov 2025 17:05:44 -0500 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Anne van Kesteren --- fetch.bs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fetch.bs b/fetch.bs index b52a6a787..eef015c06 100755 --- a/fetch.bs +++ b/fetch.bs @@ -5365,7 +5365,9 @@ returning a response directly, or allowing the request to proceed by returning n

  • Let isTopLevelSelfFetch be false. -

  • If request's client is non-null: +

  • +

    If request's client is non-null: +

    1. Let global be request's client's global object. @@ -5390,10 +5392,10 @@ returning a response directly, or allowing the request to proceed by returning n

    2. Let stringOrEnvironment be requestEnvironment.

    3. If isTopLevelNavigation is true, then set stringOrEnvironment - to the string "navigation". + to "navigation".

    4. Otherwise, if isTopLevelSelfFetch is true, then set - stringOrEnvironment to the string "top-level-self-fetch". + stringOrEnvironment to "top-level-self-fetch".

  • Let blob be the result of obtaining a blob object given From bf7b57943ed5e29d3ba46a966ad2b0363cea33b3 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Wed, 19 Nov 2025 23:25:09 +0000 Subject: [PATCH 3/3] Address review feedback --- fetch.bs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fetch.bs b/fetch.bs index eef015c06..6d084dd91 100755 --- a/fetch.bs +++ b/fetch.bs @@ -5375,19 +5375,19 @@ returning a response directly, or allowing the request to proceed by returning n

  • If all of the following conditions are true: -

    -

    then set isTopLevelSelfFetch to false. +

    then set isTopLevelSelfFetch to true.

  • Let stringOrEnvironment be requestEnvironment.