From 0ce45ae44008a91209ead87ff1354cf0c42ce6bd Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Mon, 9 Dec 2024 16:50:00 +0900 Subject: [PATCH] Partition blob: URL fetches by storage key See https://github.com/w3c/FileAPI/issues/153#issuecomment-2330085478 and https://github.com/w3c/FileAPI/pull/201 for additional context. And https://privacycg.github.io/storage-partitioning/ for the overall partitioning story. --- fetch.bs | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/fetch.bs b/fetch.bs index 6558d9414..5cbfef674 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4972,15 +4972,28 @@ steps: blob URL entry.
  • -

    If request's method is not `GET`, - blobURLEntry is null, or blobURLEntry's - object is not a {{Blob}} object, then return a - network error. [[!FILEAPI]] +

    If request's method is not `GET` or + blobURLEntry is null, then return a network error. [[!FILEAPI]]

    The `GET` method restriction serves no useful purpose other than being interoperable. -

  • Let blob be blobURLEntry's object. +

  • Let requestEnvironment be the result of + determining the environment given request. + +

  • 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 navigationOrEnvironment be the string "navigation" if + isTopLevelNavigation is true; otherwise, requestEnvironment. + +

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

  • If blob is not a {{Blob}} object, then return a network error.

  • Let response be a new response. @@ -5113,6 +5126,21 @@ steps: +

    +

    To determine the environment, given a request +request: + +

      +
    1. If request's reserved client is non-null, then return + request's reserved client. + +

    2. If request's client is non-null, then return + request's client. + +

    3. Return null. +

    +
    +

    HTTP fetch

    @@ -9044,6 +9072,7 @@ Alexey Proskuryakov, Andreas Kling, Andrés Gutiérrez, Andrew Sutherland, +Andrew Williams, Ángel González, Anssi Kostiainen, Arkadiusz Michalski,