Skip to content

Commit

Permalink
[giow] (2) Make EventSource.close() cause the events to stop firing e…
Browse files Browse the repository at this point in the history
…ven if they're already queued.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=14331

git-svn-id: http://svn.whatwg.org/webapps@6688 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 14, 2011
1 parent 210d4ef commit 0a3e8a7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
12 changes: 9 additions & 3 deletions complete.html
Expand Up @@ -80168,7 +80168,9 @@ <h4 id=the-eventsource-interface><span class=secno>11.2.2 </span>The <code><a hr
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
Expand Down Expand Up @@ -80523,8 +80525,12 @@ <h4 id=event-stream-interpretation><span class=secno>11.2.5 </span>Interpreting

<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
Expand Down
12 changes: 9 additions & 3 deletions index
Expand Up @@ -80168,7 +80168,9 @@ interface <dfn id=eventsource>EventSource</dfn> : <a href=#eventtarget>EventTarg
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
Expand Down Expand Up @@ -80523,8 +80525,12 @@ any-char = %x0000-0009 / %x000B-000C / %x000E-10FFFF

<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
Expand Down
14 changes: 11 additions & 3 deletions source
Expand Up @@ -90734,7 +90734,9 @@ interface <dfn>EventSource</dfn> : <span>EventTarget</span> {
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
Expand Down Expand Up @@ -91149,8 +91151,14 @@ any-char = %x0000-0009 / %x000B-000C / %x000E-10FFFF
<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>

Expand Down

0 comments on commit 0a3e8a7

Please sign in to comment.