[html5] r6688 - [giow] (2) Make EventSource.close() cause the events to stop firing even if they [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Oct 14 15:31:28 PDT 2011


Author: ianh
Date: 2011-10-14 15:31:27 -0700 (Fri, 14 Oct 2011)
New Revision: 6688

Modified:
   complete.html
   index
   source
Log:
[giow] (2) Make EventSource.close() cause the events to stop firing even if they're already queued.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=14331

Modified: complete.html
===================================================================
--- complete.html	2011-10-14 22:24:05 UTC (rev 6687)
+++ complete.html	2011-10-14 22:31:27 UTC (rev 6688)
@@ -80168,7 +80168,9 @@
   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>
+  to <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>.</p> <!-- this
+  also causes all the message events to stop firing, even if they were
+  queued before close() was called -->
 
   <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
@@ -80523,8 +80525,12 @@
 
    <li><p>Set the <var title="">data</var> buffer and the <var title="">event name</var> buffer to the empty string.</li>
 
-   <li><p><a href=#queue-a-task>Queue a task</a> to dispatch the newly created
-   event at the <code><a href=#eventsource>EventSource</a></code> object.</li>
+   <li><p><a href=#queue-a-task>Queue a task</a> which, if the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute is
+   set to a value other than <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>, dispatches the newly
+   created event at the <code><a href=#eventsource>EventSource</a></code> object.</li> <!--
+   so calling close() drops the messages immediately. The connection
+   dying doesn't interfere with already-sent messages since it sets us
+   to CLOSED via a task, not synchronously -->
 
   </ol><p class=note>If an event doesn't have an "id" field, but an
   earlier event did set the event source's <a href=#concept-event-stream-last-event-id title=concept-event-stream-last-event-id>last event ID

Modified: index
===================================================================
--- index	2011-10-14 22:24:05 UTC (rev 6687)
+++ index	2011-10-14 22:31:27 UTC (rev 6688)
@@ -80168,7 +80168,9 @@
   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>
+  to <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>.</p> <!-- this
+  also causes all the message events to stop firing, even if they were
+  queued before close() was called -->
 
   <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
@@ -80523,8 +80525,12 @@
 
    <li><p>Set the <var title="">data</var> buffer and the <var title="">event name</var> buffer to the empty string.</li>
 
-   <li><p><a href=#queue-a-task>Queue a task</a> to dispatch the newly created
-   event at the <code><a href=#eventsource>EventSource</a></code> object.</li>
+   <li><p><a href=#queue-a-task>Queue a task</a> which, if the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute is
+   set to a value other than <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>, dispatches the newly
+   created event at the <code><a href=#eventsource>EventSource</a></code> object.</li> <!--
+   so calling close() drops the messages immediately. The connection
+   dying doesn't interfere with already-sent messages since it sets us
+   to CLOSED via a task, not synchronously -->
 
   </ol><p class=note>If an event doesn't have an "id" field, but an
   earlier event did set the event source's <a href=#concept-event-stream-last-event-id title=concept-event-stream-last-event-id>last event ID

Modified: source
===================================================================
--- source	2011-10-14 22:24:05 UTC (rev 6687)
+++ source	2011-10-14 22:31:27 UTC (rev 6688)
@@ -90734,7 +90734,9 @@
   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>
+  to <code title="dom-EventSource-CLOSED">CLOSED</code>.</p> <!-- this
+  also causes all the message events to stop firing, even if they were
+  queued before close() was called -->
 
   <p>The following are the <span>event handlers</span> (and their
   corresponding <span title="event handler event type">event handler
@@ -91149,8 +91151,14 @@
    <li><p>Set the <var title="">data</var> buffer and the <var
    title="">event name</var> buffer to the empty string.</p></li>
 
-   <li><p><span>Queue a task</span> to dispatch the newly created
-   event at the <code>EventSource</code> object.</p></li>
+   <li><p><span>Queue a task</span> which, if the <code
+   title="dom-EventSource-readyState">readyState</code> attribute is
+   set to a value other than <code
+   title="dom-EventSource-CLOSED">CLOSED</code>, dispatches the newly
+   created event at the <code>EventSource</code> object.</p></li> <!--
+   so calling close() drops the messages immediately. The connection
+   dying doesn't interfere with already-sent messages since it sets us
+   to CLOSED via a task, not synchronously -->
 
   </ol>
 




More information about the Commit-Watchers mailing list