[html5] r6624 - [giow] (1) Rephrase how EventSource is protected from garbage collection to make [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Oct 4 12:55:30 PDT 2011


Author: ianh
Date: 2011-10-04 12:55:28 -0700 (Tue, 04 Oct 2011)
New Revision: 6624

Modified:
   complete.html
   index
   source
Log:
[giow] (1) Rephrase how EventSource is protected from garbage collection to make more sense. Note that EventSource objects are allowed to survive the bfcache (unlike, say, WebSocket connections).
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=13812

Modified: complete.html
===================================================================
--- complete.html	2011-10-04 19:18:53 UTC (rev 6623)
+++ complete.html	2011-10-04 19:55:28 UTC (rev 6624)
@@ -65713,6 +65713,12 @@
    </li>
 
    <li><p>If the <code><a href=#document>Document</a></code>'s <var title=concept-document-salvageable><a href=#concept-document-salvageable>salvageable</a></var> state is
+   false, <a href=#concept-eventsource-forcibly-close title=concept-EventSource-forcibly-close>forcibly
+   close</a> any <code><a href=#eventsource>EventSource</a></code> objects that whose
+   constructor was invoked from the <code><a href=#document>Document</a></code>'s
+   <code><a href=#window>Window</a></code> object.</li>
+
+   <li><p>If the <code><a href=#document>Document</a></code>'s <var title=concept-document-salvageable><a href=#concept-document-salvageable>salvageable</a></var> state is
    false, empty the <code><a href=#document>Document</a></code>'s <code><a href=#window>Window</a></code>'s
    <a href=#list-of-active-timeouts>list of active timeouts</a> and its <a href=#list-of-active-intervals>list of active
    intervals</a>.</li>
@@ -79705,10 +79711,10 @@
   changes.</p>
 
   <p>The <dfn id=dom-eventsource-close title=dom-EventSource-close><code>close()</code></dfn>
-  method must close the connection, if any; must abort any instances
-  of the <a href=#fetch>fetch</a> algorithm started for this
-  <code><a href=#eventsource>EventSource</a></code> object; and must set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
-  <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>.</p>
+  method must abort any instances of the <a href=#fetch>fetch</a> algorithm
+  started for this <code><a href=#eventsource>EventSource</a></code> object, and must set the
+  <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute
+  to <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>.</p>
 
   <p>The following are the <a href=#event-handlers>event handlers</a> (and their
   corresponding <a href=#event-handler-event-type title="event handler event type">event handler
@@ -79817,18 +79823,17 @@
   <p>For non-HTTP protocols, UAs should act in equivalent ways.</p>
 
   <hr><p>When a user agent is to <dfn id=announce-the-connection>announce the connection</dfn>, the
-  user agent must set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
-  <code title=dom-EventSource-OPEN><a href=#dom-eventsource-open>OPEN</a></code> and <a href=#queue-a-task>queue a
-  task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-open>open</code> at the
-  <code><a href=#eventsource>EventSource</a></code> object.</p>
+  user agent must <a href=#queue-a-task>queue a task</a> to set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
+  <code title=dom-EventSource-OPEN><a href=#dom-eventsource-open>OPEN</a></code> and <a href=#fire-a-simple-event>fire a
+  simple event</a> named <code title=event-open>open</code> at
+  the <code><a href=#eventsource>EventSource</a></code> object.</p>
 
   <p>When a user agent is to <dfn id=reestablish-the-connection>reestablish the connection</dfn>,
-  the user agent must set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
-  <code title=dom-EventSource-CONNECTING><a href=#dom-eventsource-connecting>CONNECTING</a></code>,
-  <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named
-  <code title=event-error>error</code> at the
-  <code><a href=#eventsource>EventSource</a></code> object, and then, after a delay equal to
-  the reconnection time of the event source, if the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute is
+  the user agent must <a href=#queue-a-task>queue a task</a> to set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
+  <code title=dom-EventSource-CONNECTING><a href=#dom-eventsource-connecting>CONNECTING</a></code> and
+  <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error>error</code> at the <code><a href=#eventsource>EventSource</a></code>
+  object, and then, after a delay equal to the reconnection time of
+  the event source, if the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute is
   still set to <code title=dom-EventSource-CONNECTING><a href=#dom-eventsource-connecting>CONNECTING</a></code>, once again do
   a <a href=#potentially-cors-enabled-fetch>potentially CORS-enabled fetch</a> of the <a href=#absolute-url>absolute
   URL</a> of the event source resource, with the <i>mode</i> being
@@ -79842,12 +79847,12 @@
   section.</p>
 
   <p>When a user agent is to <dfn id=fail-the-connection>fail the connection</dfn>, the user
-  agent must set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
-  <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code> and <a href=#queue-a-task>queue a
-  task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error>error</code> at the <code><a href=#eventsource>EventSource</a></code>
-  object. <strong>Once the user agent has <a href=#fail-the-connection title="fail the
-  connection">failed the connection</a>, it does <em>not</em>
-  attempt to reconnect!</strong></p>
+  agent must <a href=#queue-a-task>queue a task</a> to set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
+  <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code> and <a href=#fire-a-simple-event>fire a
+  simple event</a> named <code title=event-error>error</code> at
+  the <code><a href=#eventsource>EventSource</a></code> object. <strong>Once the user agent has
+  <a href=#fail-the-connection title="fail the connection">failed the connection</a>, it
+  does <em>not</em> attempt to reconnect!</strong></p>
 
   <hr><p>The <a href=#task-source>task source</a> for any <a href=#concept-task title=concept-task>tasks</a> that are <a href=#queue-a-task title="queue a
   task">queued</a> by <code><a href=#eventsource>EventSource</a></code> objects is the
@@ -80250,23 +80255,44 @@
 
   <h4 id=garbage-collection-1><span class=secno>11.2.8 </span>Garbage collection</h4>
 
-  <p>While an <code><a href=#eventsource>EventSource</a></code> object's <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> is not <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>, and the object has one
-  or more event listeners registered for <code title=event-message><a href=#event-message>message</a></code> events, there must be a strong
+  <p>While an <code><a href=#eventsource>EventSource</a></code> object's <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> is <code title=dom-EventSource-CONNECTING><a href=#dom-eventsource-connecting>CONNECTING</a></code>, and the object
+  has one or more event listeners registered for <code title=event-open>open</code>, <code title=event-message><a href=#event-message>message</a></code> or <code title=event-error>error</code> events, there must be a strong
   reference from the <code><a href=#window>Window</a></code> or <code><a href=#workerutils>WorkerUtils</a></code>
   object that the <code><a href=#eventsource>EventSource</a></code> object's constructor was
   invoked from to the <code><a href=#eventsource>EventSource</a></code> object itself.</p>
 
+  <p>While an <code><a href=#eventsource>EventSource</a></code> object's <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> is <code title=dom-EventSource-OPEN><a href=#dom-eventsource-open>OPEN</a></code>, and the object has one or
+  more event listeners registered for <code title=event-message><a href=#event-message>message</a></code> or <code title=event-error>error</code> events, there must be a strong
+  reference from the <code><a href=#window>Window</a></code> or <code><a href=#workerutils>WorkerUtils</a></code>
+  object that the <code><a href=#eventsource>EventSource</a></code> object's constructor was
+  invoked from to the <code><a href=#eventsource>EventSource</a></code> object itself.</p>
+
+  <p>While there is a task queued by an <code><a href=#eventsource>EventSource</a></code>
+  object on the <a href=#remote-event-task-source>remote event task source</a>, there must be a
+  strong reference from the <code><a href=#window>Window</a></code> or
+  <code><a href=#workerutils>WorkerUtils</a></code> object that the <code><a href=#eventsource>EventSource</a></code>
+  object's constructor was invoked from to that
+  <code><a href=#eventsource>EventSource</a></code> object.</p>
+
+  <p>If a user agent is to <dfn id=concept-eventsource-forcibly-close title=concept-EventSource-forcibly-close>forcibly close</dfn> an
+  <code><a href=#eventsource>EventSource</a></code> object (this happens when a
+  <code><a href=#document>Document</a></code> object goes away permanently), the user agent
+  must abort any instances of the <a href=#fetch>fetch</a> algorithm started
+  for this <code><a href=#eventsource>EventSource</a></code> object, and must set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
+  <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>.</p> <!-- same as
+  calling close() -->
+
   <p>If an <code><a href=#eventsource>EventSource</a></code> object is garbage collected while
-  its connection is still open, the user agent must cancel any
-  instance of the <a href=#fetch title=fetch>fetch</a> algorithm opened by
-  this <code><a href=#eventsource>EventSource</a></code>, discarding any <a href=#concept-task title=concept-task>tasks</a> <a href=#queue-a-task title="queue a
-  task">queued</a> for them, and discarding any further data
-  received from the network for them.</p>
+  its connection is still open, the user agent must abort any instance
+  of the <a href=#fetch title=fetch>fetch</a> algorithm opened by this
+  <code><a href=#eventsource>EventSource</a></code>.</p> <!-- no need to throw tasks away or
+  anything; for it to get garbage collected, there can't be anything
+  that would be able to receive those events -->
 
   <p class=note>It's possible for one active network connection to
   be shared by multiple <code><a href=#eventsource>EventSource</a></code> objects and their
   <a href=#fetch>fetch</a> algorithms, which is why the above is phrased in
-  terms of canceling the <a href=#fetch>fetch</a> algorithm and not the
+  terms of aborting the <a href=#fetch>fetch</a> algorithm and not the
   actual underlying download.</p>
 
 

Modified: index
===================================================================
--- index	2011-10-04 19:18:53 UTC (rev 6623)
+++ index	2011-10-04 19:55:28 UTC (rev 6624)
@@ -65713,6 +65713,12 @@
    </li>
 
    <li><p>If the <code><a href=#document>Document</a></code>'s <var title=concept-document-salvageable><a href=#concept-document-salvageable>salvageable</a></var> state is
+   false, <a href=#concept-eventsource-forcibly-close title=concept-EventSource-forcibly-close>forcibly
+   close</a> any <code><a href=#eventsource>EventSource</a></code> objects that whose
+   constructor was invoked from the <code><a href=#document>Document</a></code>'s
+   <code><a href=#window>Window</a></code> object.</li>
+
+   <li><p>If the <code><a href=#document>Document</a></code>'s <var title=concept-document-salvageable><a href=#concept-document-salvageable>salvageable</a></var> state is
    false, empty the <code><a href=#document>Document</a></code>'s <code><a href=#window>Window</a></code>'s
    <a href=#list-of-active-timeouts>list of active timeouts</a> and its <a href=#list-of-active-intervals>list of active
    intervals</a>.</li>
@@ -79705,10 +79711,10 @@
   changes.</p>
 
   <p>The <dfn id=dom-eventsource-close title=dom-EventSource-close><code>close()</code></dfn>
-  method must close the connection, if any; must abort any instances
-  of the <a href=#fetch>fetch</a> algorithm started for this
-  <code><a href=#eventsource>EventSource</a></code> object; and must set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
-  <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>.</p>
+  method must abort any instances of the <a href=#fetch>fetch</a> algorithm
+  started for this <code><a href=#eventsource>EventSource</a></code> object, and must set the
+  <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute
+  to <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>.</p>
 
   <p>The following are the <a href=#event-handlers>event handlers</a> (and their
   corresponding <a href=#event-handler-event-type title="event handler event type">event handler
@@ -79817,18 +79823,17 @@
   <p>For non-HTTP protocols, UAs should act in equivalent ways.</p>
 
   <hr><p>When a user agent is to <dfn id=announce-the-connection>announce the connection</dfn>, the
-  user agent must set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
-  <code title=dom-EventSource-OPEN><a href=#dom-eventsource-open>OPEN</a></code> and <a href=#queue-a-task>queue a
-  task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-open>open</code> at the
-  <code><a href=#eventsource>EventSource</a></code> object.</p>
+  user agent must <a href=#queue-a-task>queue a task</a> to set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
+  <code title=dom-EventSource-OPEN><a href=#dom-eventsource-open>OPEN</a></code> and <a href=#fire-a-simple-event>fire a
+  simple event</a> named <code title=event-open>open</code> at
+  the <code><a href=#eventsource>EventSource</a></code> object.</p>
 
   <p>When a user agent is to <dfn id=reestablish-the-connection>reestablish the connection</dfn>,
-  the user agent must set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
-  <code title=dom-EventSource-CONNECTING><a href=#dom-eventsource-connecting>CONNECTING</a></code>,
-  <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named
-  <code title=event-error>error</code> at the
-  <code><a href=#eventsource>EventSource</a></code> object, and then, after a delay equal to
-  the reconnection time of the event source, if the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute is
+  the user agent must <a href=#queue-a-task>queue a task</a> to set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
+  <code title=dom-EventSource-CONNECTING><a href=#dom-eventsource-connecting>CONNECTING</a></code> and
+  <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error>error</code> at the <code><a href=#eventsource>EventSource</a></code>
+  object, and then, after a delay equal to the reconnection time of
+  the event source, if the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute is
   still set to <code title=dom-EventSource-CONNECTING><a href=#dom-eventsource-connecting>CONNECTING</a></code>, once again do
   a <a href=#potentially-cors-enabled-fetch>potentially CORS-enabled fetch</a> of the <a href=#absolute-url>absolute
   URL</a> of the event source resource, with the <i>mode</i> being
@@ -79842,12 +79847,12 @@
   section.</p>
 
   <p>When a user agent is to <dfn id=fail-the-connection>fail the connection</dfn>, the user
-  agent must set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
-  <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code> and <a href=#queue-a-task>queue a
-  task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error>error</code> at the <code><a href=#eventsource>EventSource</a></code>
-  object. <strong>Once the user agent has <a href=#fail-the-connection title="fail the
-  connection">failed the connection</a>, it does <em>not</em>
-  attempt to reconnect!</strong></p>
+  agent must <a href=#queue-a-task>queue a task</a> to set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
+  <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code> and <a href=#fire-a-simple-event>fire a
+  simple event</a> named <code title=event-error>error</code> at
+  the <code><a href=#eventsource>EventSource</a></code> object. <strong>Once the user agent has
+  <a href=#fail-the-connection title="fail the connection">failed the connection</a>, it
+  does <em>not</em> attempt to reconnect!</strong></p>
 
   <hr><p>The <a href=#task-source>task source</a> for any <a href=#concept-task title=concept-task>tasks</a> that are <a href=#queue-a-task title="queue a
   task">queued</a> by <code><a href=#eventsource>EventSource</a></code> objects is the
@@ -80250,23 +80255,44 @@
 
   <h4 id=garbage-collection-1><span class=secno>11.2.8 </span>Garbage collection</h4>
 
-  <p>While an <code><a href=#eventsource>EventSource</a></code> object's <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> is not <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>, and the object has one
-  or more event listeners registered for <code title=event-message><a href=#event-message>message</a></code> events, there must be a strong
+  <p>While an <code><a href=#eventsource>EventSource</a></code> object's <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> is <code title=dom-EventSource-CONNECTING><a href=#dom-eventsource-connecting>CONNECTING</a></code>, and the object
+  has one or more event listeners registered for <code title=event-open>open</code>, <code title=event-message><a href=#event-message>message</a></code> or <code title=event-error>error</code> events, there must be a strong
   reference from the <code><a href=#window>Window</a></code> or <code><a href=#workerutils>WorkerUtils</a></code>
   object that the <code><a href=#eventsource>EventSource</a></code> object's constructor was
   invoked from to the <code><a href=#eventsource>EventSource</a></code> object itself.</p>
 
+  <p>While an <code><a href=#eventsource>EventSource</a></code> object's <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> is <code title=dom-EventSource-OPEN><a href=#dom-eventsource-open>OPEN</a></code>, and the object has one or
+  more event listeners registered for <code title=event-message><a href=#event-message>message</a></code> or <code title=event-error>error</code> events, there must be a strong
+  reference from the <code><a href=#window>Window</a></code> or <code><a href=#workerutils>WorkerUtils</a></code>
+  object that the <code><a href=#eventsource>EventSource</a></code> object's constructor was
+  invoked from to the <code><a href=#eventsource>EventSource</a></code> object itself.</p>
+
+  <p>While there is a task queued by an <code><a href=#eventsource>EventSource</a></code>
+  object on the <a href=#remote-event-task-source>remote event task source</a>, there must be a
+  strong reference from the <code><a href=#window>Window</a></code> or
+  <code><a href=#workerutils>WorkerUtils</a></code> object that the <code><a href=#eventsource>EventSource</a></code>
+  object's constructor was invoked from to that
+  <code><a href=#eventsource>EventSource</a></code> object.</p>
+
+  <p>If a user agent is to <dfn id=concept-eventsource-forcibly-close title=concept-EventSource-forcibly-close>forcibly close</dfn> an
+  <code><a href=#eventsource>EventSource</a></code> object (this happens when a
+  <code><a href=#document>Document</a></code> object goes away permanently), the user agent
+  must abort any instances of the <a href=#fetch>fetch</a> algorithm started
+  for this <code><a href=#eventsource>EventSource</a></code> object, and must set the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute to
+  <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>.</p> <!-- same as
+  calling close() -->
+
   <p>If an <code><a href=#eventsource>EventSource</a></code> object is garbage collected while
-  its connection is still open, the user agent must cancel any
-  instance of the <a href=#fetch title=fetch>fetch</a> algorithm opened by
-  this <code><a href=#eventsource>EventSource</a></code>, discarding any <a href=#concept-task title=concept-task>tasks</a> <a href=#queue-a-task title="queue a
-  task">queued</a> for them, and discarding any further data
-  received from the network for them.</p>
+  its connection is still open, the user agent must abort any instance
+  of the <a href=#fetch title=fetch>fetch</a> algorithm opened by this
+  <code><a href=#eventsource>EventSource</a></code>.</p> <!-- no need to throw tasks away or
+  anything; for it to get garbage collected, there can't be anything
+  that would be able to receive those events -->
 
   <p class=note>It's possible for one active network connection to
   be shared by multiple <code><a href=#eventsource>EventSource</a></code> objects and their
   <a href=#fetch>fetch</a> algorithms, which is why the above is phrased in
-  terms of canceling the <a href=#fetch>fetch</a> algorithm and not the
+  terms of aborting the <a href=#fetch>fetch</a> algorithm and not the
   actual underlying download.</p>
 
 

Modified: source
===================================================================
--- source	2011-10-04 19:18:53 UTC (rev 6623)
+++ source	2011-10-04 19:55:28 UTC (rev 6624)
@@ -74673,6 +74673,13 @@
 
    <li><p>If the <code>Document</code>'s <var
    title="concept-document-salvageable">salvageable</var> state is
+   false, <span title="concept-EventSource-forcibly-close">forcibly
+   close</span> any <code>EventSource</code> objects that whose
+   constructor was invoked from the <code>Document</code>'s
+   <code>Window</code> object.</p></li>
+
+   <li><p>If the <code>Document</code>'s <var
+   title="concept-document-salvageable">salvageable</var> state is
    false, empty the <code>Document</code>'s <code>Window</code>'s
    <span>list of active timeouts</span> and its <span>list of active
    intervals</span>.</p></li>
@@ -90225,11 +90232,10 @@
   changes.</p>
 
   <p>The <dfn title="dom-EventSource-close"><code>close()</code></dfn>
-  method must close the connection, if any; must abort any instances
-  of the <span>fetch</span> algorithm started for this
-  <code>EventSource</code> object; and must set the <code
-  title="dom-EventSource-readyState">readyState</code> attribute to
-  <code title="dom-EventSource-CLOSED">CLOSED</code>.</p>
+  method must abort any instances of the <span>fetch</span> algorithm
+  started for this <code>EventSource</code> object, and must set the
+  <code title="dom-EventSource-readyState">readyState</code> attribute
+  to <code title="dom-EventSource-CLOSED">CLOSED</code>.</p>
 
   <p>The following are the <span>event handlers</span> (and their
   corresponding <span title="event handler event type">event handler
@@ -90362,21 +90368,20 @@
   <hr>
 
   <p>When a user agent is to <dfn>announce the connection</dfn>, the
-  user agent must set the <code
+  user agent must <span>queue a task</span> to set the <code
   title="dom-EventSource-readyState">readyState</code> attribute to
-  <code title="dom-EventSource-OPEN">OPEN</code> and <span>queue a
-  task</span> to <span>fire a simple event</span> named <code
-  title="event-open">open</code> at the
-  <code>EventSource</code> object.</p>
+  <code title="dom-EventSource-OPEN">OPEN</code> and <span>fire a
+  simple event</span> named <code title="event-open">open</code> at
+  the <code>EventSource</code> object.</p>
 
   <p>When a user agent is to <dfn>reestablish the connection</dfn>,
-  the user agent must set the <code
+  the user agent must <span>queue a task</span> to set the <code
   title="dom-EventSource-readyState">readyState</code> attribute to
-  <code title="dom-EventSource-CONNECTING">CONNECTING</code>,
-  <span>queue a task</span> to <span>fire a simple event</span> named
-  <code title="event-error">error</code> at the
-  <code>EventSource</code> object, and then, after a delay equal to
-  the reconnection time of the event source, if the <code
+  <code title="dom-EventSource-CONNECTING">CONNECTING</code> and
+  <span>fire a simple event</span> named <code
+  title="event-error">error</code> at the <code>EventSource</code>
+  object, and then, after a delay equal to the reconnection time of
+  the event source, if the <code
   title="dom-EventSource-readyState">readyState</code> attribute is
   still set to <code
   title="dom-EventSource-CONNECTING">CONNECTING</code>, once again do
@@ -90392,14 +90397,13 @@
   section.</p>
 
   <p>When a user agent is to <dfn>fail the connection</dfn>, the user
-  agent must set the <code
+  agent must <span>queue a task</span> to set the <code
   title="dom-EventSource-readyState">readyState</code> attribute to
-  <code title="dom-EventSource-CLOSED">CLOSED</code> and <span>queue a
-  task</span> to <span>fire a simple event</span> named <code
-  title="event-error">error</code> at the <code>EventSource</code>
-  object. <strong>Once the user agent has <span title="fail the
-  connection">failed the connection</span>, it does <em>not</em>
-  attempt to reconnect!</strong></p>
+  <code title="dom-EventSource-CLOSED">CLOSED</code> and <span>fire a
+  simple event</span> named <code title="event-error">error</code> at
+  the <code>EventSource</code> object. <strong>Once the user agent has
+  <span title="fail the connection">failed the connection</span>, it
+  does <em>not</em> attempt to reconnect!</strong></p>
 
   <hr>
 
@@ -90850,26 +90854,54 @@
   <h4>Garbage collection</h4>
 
   <p>While an <code>EventSource</code> object's <code
-  title="dom-EventSource-readyState">readyState</code> is not <code
-  title="dom-EventSource-CLOSED">CLOSED</code>, and the object has one
-  or more event listeners registered for <code
-  title="event-message">message</code> events, there must be a strong
+  title="dom-EventSource-readyState">readyState</code> is <code
+  title="dom-EventSource-CONNECTING">CONNECTING</code>, and the object
+  has one or more event listeners registered for <code
+  title="event-open">open</code>, <code
+  title="event-message">message</code> or <code
+  title="event-error">error</code> events, there must be a strong
   reference from the <code>Window</code> or <code>WorkerUtils</code>
   object that the <code>EventSource</code> object's constructor was
   invoked from to the <code>EventSource</code> object itself.</p>
 
+  <p>While an <code>EventSource</code> object's <code
+  title="dom-EventSource-readyState">readyState</code> is <code
+  title="dom-EventSource-OPEN">OPEN</code>, and the object has one or
+  more event listeners registered for <code
+  title="event-message">message</code> or <code
+  title="event-error">error</code> events, there must be a strong
+  reference from the <code>Window</code> or <code>WorkerUtils</code>
+  object that the <code>EventSource</code> object's constructor was
+  invoked from to the <code>EventSource</code> object itself.</p>
+
+  <p>While there is a task queued by an <code>EventSource</code>
+  object on the <span>remote event task source</span>, there must be a
+  strong reference from the <code>Window</code> or
+  <code>WorkerUtils</code> object that the <code>EventSource</code>
+  object's constructor was invoked from to that
+  <code>EventSource</code> object.</p>
+
+  <p>If a user agent is to <dfn
+  title="concept-EventSource-forcibly-close">forcibly close</dfn> an
+  <code>EventSource</code> object (this happens when a
+  <code>Document</code> object goes away permanently), the user agent
+  must abort any instances of the <span>fetch</span> algorithm started
+  for this <code>EventSource</code> object, and must set the <code
+  title="dom-EventSource-readyState">readyState</code> attribute to
+  <code title="dom-EventSource-CLOSED">CLOSED</code>.</p> <!-- same as
+  calling close() -->
+
   <p>If an <code>EventSource</code> object is garbage collected while
-  its connection is still open, the user agent must cancel any
-  instance of the <span title="fetch">fetch</span> algorithm opened by
-  this <code>EventSource</code>, discarding any <span
-  title="concept-task">tasks</span> <span title="queue a
-  task">queued</span> for them, and discarding any further data
-  received from the network for them.</p>
+  its connection is still open, the user agent must abort any instance
+  of the <span title="fetch">fetch</span> algorithm opened by this
+  <code>EventSource</code>.</p> <!-- no need to throw tasks away or
+  anything; for it to get garbage collected, there can't be anything
+  that would be able to receive those events -->
 
   <p class="note">It's possible for one active network connection to
   be shared by multiple <code>EventSource</code> objects and their
   <span>fetch</span> algorithms, which is why the above is phrased in
-  terms of canceling the <span>fetch</span> algorithm and not the
+  terms of aborting the <span>fetch</span> algorithm and not the
   actual underlying download.</p>
 
 




More information about the Commit-Watchers mailing list