Re: [whatwg/fetch] Deferred fetching (PR #1647)

@mingyc commented on this pull request.



> +  </ol>
+
+ <li><p>If <var>quota</var> is equal or less than 0, then return 0.
+
+ <li><p>If <var>quota</var> is less than <var>quotaForRequestOrigin</var>, then return
+ <var>quota</var>.
+
+ <li><p>Return <var>quotaForRequestOrigin</var>.
+</ol>
+</div>
+
+<div algorithm>
+<p>To <dfn export>reserve deferred-fetch quota</dfn> for a <a>navigable container</a>
+<var>container</var> given an <a for=/>origin</a> <var>originToNavigateTo</var>:
+
+<p class=note>This is called when <var>container</var> and the document that initiated the

Thanks for answering!

Getting back to the [above example](https://github.com/whatwg/fetch/pull/1647#discussion_r1893485068) where a cross-origin `iframe` is created first, and gets appended later.

I tried [`potentially free deferred-fetch quota`](https://whatpr.org/fetch/1647.html#potentially-free-deferred-fetch-quota) algorithm, which gets executed on Document creation. It looks like when running with the example, `iframe` will clear its navigable container (which is `iframe`?) `deferred-fetch quota` because

> if document’s node navigable’s container document is not null, and its origin is same origin with document,

SameOrigin(iframe, main document) = SameOrigin("about:blank", "a.com") = true


Later, upon calling [`get the available deferred-fetch quota`](https://whatpr.org/fetch/1647.html#available-deferred-fetch-quota) for any requests made within `iframe`, it will always return 0 from a condition not listed in Step 5: 

* `isTopLevel == false && deferredFetchAllowed == false && deferredFetchMinimalAllowed == false` (also asked [here](https://github.com/whatwg/fetch/pull/1647#discussion_r1909914735))

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

Message ID: <whatwg/fetch/pull/1647/review/2541837960@github.com>

Received on Friday, 10 January 2025 08:46:07 UTC