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

@noamr 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

> > This is called when the iframe is being [navigated](https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate),
> 
> It might still be ambigous. This algorithm later relies on [inherited policies](https://w3c.github.io/webappsec-permissions-policy/#inherited-policies), which is also only available on navigation.
> 
> Combined with my question in [this commit](https://github.com/whatwg/fetch/pull/1647/commits/de1457f75cd8efe468a59f823325f2b7fe466fe1#r1906260008), could you please clarify?
> 
> > provided that the sourceDocument of the navigation is the container document.
> 
> What's the `container document` here, is it `iframe` or the `main document`?

Main document
> 
> > To reserve deferred-fetch quota for a [navigable container](https://html.spec.whatwg.org/multipage/document-sequences.html#navigable-container) container given an [origin](https://html.spec.whatwg.org/multipage/browsers.html#concept-origin) originToNavigateTo:
> 
> Trying to summarize the triggering condition and place. This algorithm:
> 
> * Is triggered by a navigable container
>   
>   * Given the above case, `navigable container` = `iframe`?

Yes, like the iframe element.

> * `Should be triggered on navigation, when the source document of the navigation is the navigable's parent document.`
>   
>   * Is `source document of the navigation` = `iframe's parent document` = `main document`?

Yes, when the iframe is being navigated by its container, e.g. by setting the iframe's src.

>   * Is `navigable` = `iframe`?

Sort of, It's like the iframe's contents.

>   * Is `navigable's parent document` = `main document`?

Yes, in this case
> * Combined the above, this algorithm should be run by `iframe` when its source document is main document and when it is navigating its content document?

Yes

>   
>   * But `inherited policies` of the content document will only be available during navigation...

Not exactly. It should run the https://w3c.github.io/webappsec-permissions-policy/#algo-define-inherited-policy-in-container algorithm which only needs the container and the target origin.

>   * If this is run by `content document` after it obtains `inherited policies`, `content document` might not be able to get access to `iframe` if it is cross-origin.

See previous response


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

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

Received on Wednesday, 8 January 2025 13:13:19 UTC