Re: [whatwg/fetch] Partition Blob URL fetches by Storage Key (PR #1783)

@annevk commented on this pull request.

Thank you for reworking this so quickly!

>  
       <p class=note>The `<code>GET</code>` <a for=/>method</a> restriction serves no useful purpose
       other than being interoperable.
 
-     <li><p>Let <var>blob</var> be <var>blobURLEntry</var>'s <a for="blob URL entry">object</a>.
+     <li><p>Let <var>requestEnvironment</var> be the result of
+     <a for=request>determining the environment</a> given <var>request</var>.
+
+     <li><p>Let <var>isNavigation</var> be true if <var>request</var>'s <a for=request>mode</a> is
+     not "<code>navigate</code>"; otherwise, false.
+
+     <li><p>If <var>isNavigation</var> is false and <var>requestEnvironment</var> is null, then
+     return a <a>network error</a>.
+
+     <li><p>Let <var>blob</var> be the result of <a>obtaining a blob object</a> given
+     <var>blobURLEntry</var>, <var>requestEnvironment</var>, and <var>isNavigation</var>.

So when isNavigation is true we don't even care about environment, right? I would merge those parameters into one.

So you have

> given an environment or the string "`navigation`" _environment_

on the other side or some such forcing callers to confront that question. And it should probably be top-level navigation?

>  
       <p class=note>The `<code>GET</code>` <a for=/>method</a> restriction serves no useful purpose
       other than being interoperable.
 
-     <li><p>Let <var>blob</var> be <var>blobURLEntry</var>'s <a for="blob URL entry">object</a>.
+     <li><p>Let <var>requestEnvironment</var> be the result of
+     <a for=request>determining the environment</a> given <var>request</var>.
+
+     <li><p>Let <var>isNavigation</var> be true if <var>request</var>'s <a for=request>mode</a> is
+     not "<code>navigate</code>"; otherwise, false.
+
+     <li><p>If <var>isNavigation</var> is false and <var>requestEnvironment</var> is null, then
+     return a <a>network error</a>.
+
+     <li><p>Let <var>blob</var> be the result of <a>obtaining a blob object</a> given
+     <var>blobURLEntry</var>, <var>requestEnvironment</var>, and <var>isNavigation</var>.
+
+     <li><p>If <var>blob</var> is failure, or <var>blob</var> is not a {{Blob}} object, then

You only need the second conditional to catch both conditions.

>  
       <p class=note>The `<code>GET</code>` <a for=/>method</a> restriction serves no useful purpose
       other than being interoperable.
 
-     <li><p>Let <var>blob</var> be <var>blobURLEntry</var>'s <a for="blob URL entry">object</a>.
+     <li><p>Let <var>requestEnvironment</var> be the result of
+     <a for=request>determining the environment</a> given <var>request</var>.
+
+     <li><p>Let <var>isNavigation</var> be true if <var>request</var>'s <a for=request>mode</a> is
+     not "<code>navigate</code>"; otherwise, false.

Perhaps instead of mode we should be checking destination for "document" which is only true for top-level navigations.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1783#pullrequestreview-2458752868
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1783/review/2458752868@github.com>

Received on Monday, 25 November 2024 15:34:31 UTC