- From: Anne van Kesteren <notifications@github.com>
- Date: Tue, 25 Jul 2023 04:12:48 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/fetch/pull/1647/review/1545204467@github.com>
@annevk commented on this pull request. > @@ -2697,15 +2700,89 @@ functionality. <dfn export for="fetch record" id=concept-fetch-record-fetch>controller</dfn> (a <a for=/>fetch controller</a> or null). +<p>A <dfn export>deferred fetch record</dfn> is a <a for=/>struct</a> used to maintain state needed +to invoke a fetch at a later time, e.g., when a <code>Document</code> is unloaded or becomes Nit: Document object > @@ -2697,15 +2700,89 @@ functionality. <dfn export for="fetch record" id=concept-fetch-record-fetch>controller</dfn> (a <a for=/>fetch controller</a> or null). +<p>A <dfn export>deferred fetch record</dfn> is a <a for=/>struct</a> used to maintain state needed +to invoke a fetch at a later time, e.g., when a <code>Document</code> is unloaded or becomes +not <a for=Document>fully active</a>. It has the following <a for=struct>items</a>: + +<dl> + <dt><dfn export for="deferred fetch record">request</dfn> + <dd>A <a for=/>request</a> Nit: needs to end in a dot (also applies to others). > <hr> -<p>When a <a for=fetch>fetch group</a> is -<dfn export for="fetch group" id=concept-fetch-group-terminate>terminated</dfn>, for each associated -<a for="fetch group">fetch record</a> whose <a for="fetch group">fetch record</a>'s -<a for="fetch record">controller</a> is non-null, and whose <a for="fetch record">request</a>'s -<a>done flag</a> is unset or <a for=request>keepalive</a> is false, -<a for="fetch controller">terminate</a> the <a for="fetch group">fetch record</a>'s -<a for="fetch record">controller</a>. +<p>When a <a for=fetch>fetch group</a> <var>fetchGroup</var> is +<dfn export for="fetch group" id=concept-fetch-group-terminate>terminated</dfn>: + +<ol> + <li><p>For each associated <a for="fetch group">fetch record</a> <var>record</var>, The pattern is usually "For each ITEM of GROUP". Not sure how to read this. > -<a for="fetch record">controller</a> is non-null, and whose <a for="fetch record">request</a>'s -<a>done flag</a> is unset or <a for=request>keepalive</a> is false, -<a for="fetch controller">terminate</a> the <a for="fetch group">fetch record</a>'s -<a for="fetch record">controller</a>. +<p>When a <a for=fetch>fetch group</a> <var>fetchGroup</var> is +<dfn export for="fetch group" id=concept-fetch-group-terminate>terminated</dfn>: + +<ol> + <li><p>For each associated <a for="fetch group">fetch record</a> <var>record</var>, + if <var>record</var>'s <a for="fetch record">controller</a> is non-null and + <var>record</var>'s <a for="fetch record">request</a>'s <a>done flag</a> is unset and + <a for=request>keepalive</a> is false, <a for="fetch controller">terminate</a> <var>record</var>'s + <a for="fetch record">controller</a>. + + <li><p><a for=list>For each</a> <a for="fetch group">deferred fetch record</a> + <var>deferredRecord</var> in <var>fetchGroup</var>'s of* > + <var>record</var>'s <a for="fetch record">request</a>'s <a>done flag</a> is unset and + <a for=request>keepalive</a> is false, <a for="fetch controller">terminate</a> <var>record</var>'s + <a for="fetch record">controller</a>. + + <li><p><a for=list>For each</a> <a for="fetch group">deferred fetch record</a> + <var>deferredRecord</var> in <var>fetchGroup</var>'s + <a for="fetch group">deferred fetch records</a>: If the result of atomically exchanging the value + of <var>deferredRecord</var>'s <a for="deferred fetch record">invoke state</a> with + "<code>terminated</code>" is not "<code>sent</code>", then the user agent should + <a for=/>fetch</a> <var>deferredRecord</var>'s <a for="deferred fetch record">request</a>. The + exact time in which the <a for=/>fetch</a> takes place is <a>implementation-defined</a>. +</ol> + +<p>When a <a for=fetch>fetch group</a> <var>fetchGroup</var> is +<dfn export for="fetch group" id=concept-fetch-group-deactivate>deactivated</dfn>: +<a for=list>For each</a> <a>deferred fetch record</a> <var>deferredRecord</var> in of* > + <li><p>Let <var>request</var> be <var>requestObject</var>'s <a for=Request>request</a>. + + <li><p>Let <var>backgroundTimeout</var> be null. + + <li><p>If <var>init</var> is given and <var>init</var>["<code>backgroundTimeout</code>"] + <a for=map>exists</a> then set <var>backgroundTimeout</var> to + <var>init</var>["<code>backgroundTimeout</code>"]. + + <li><p>If <var>backgroundTimeout</var> is not a {{DOMHighResTimeStamp}} then throw a {{TypeError}}. + + <li><p>Let <var>deferredRecord</var> be the result of calling + <a>request a deferred fetch</a> given <var>request</var> and <var>backgroundTimeout</var>. This + may throw an exception. + + <li> + <p><a for=AbortSignal lt=add>Add the following abort steps</a> to <var>requestObject</var>'s Maybe `attempted`? > -<a>done flag</a> is unset or <a for=request>keepalive</a> is false, -<a for="fetch controller">terminate</a> the <a for="fetch group">fetch record</a>'s -<a for="fetch record">controller</a>. +<p>When a <a for=fetch>fetch group</a> <var>fetchGroup</var> is +<dfn export for="fetch group" id=concept-fetch-group-terminate>terminated</dfn>: + +<ol> + <li><p>For each associated <a for="fetch group">fetch record</a> <var>record</var>, + if <var>record</var>'s <a for="fetch record">controller</a> is non-null and + <var>record</var>'s <a for="fetch record">request</a>'s <a>done flag</a> is unset and + <a for=request>keepalive</a> is false, <a for="fetch controller">terminate</a> <var>record</var>'s + <a for="fetch record">controller</a>. + + <li><p><a for=list>For each</a> <a for="fetch group">deferred fetch record</a> + <var>deferredRecord</var> in <var>fetchGroup</var>'s + <a for="fetch group">deferred fetch records</a>: If the result of atomically exchanging the value Instead of saying "atomically exchanging" we should just have a list of steps. Within the same thread everything always happens in order. (Or if we really need this primitive we should add it to Infra, but I don't think we do.) -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/fetch/pull/1647#pullrequestreview-1545204467 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/fetch/pull/1647/review/1545204467@github.com>
Received on Tuesday, 25 July 2023 11:12:53 UTC