Skip to content

Commit

Permalink
[giow] (0) Fix how WebSockets close due to navigation to be more well…
Browse files Browse the repository at this point in the history
…-defined.

git-svn-id: http://svn.whatwg.org/webapps@6155 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed May 27, 2011
1 parent 5227edb commit 525e670
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 26 deletions.
52 changes: 44 additions & 8 deletions complete.html
Expand Up @@ -64367,15 +64367,19 @@ <h4 id=unloading-documents><span class=secno>6.5.10 </span>Unloading documents</
</ol><p>This specification defines the following <dfn id=unloading-document-cleanup-steps>unloading document
cleanup steps</dfn>. Other specifications can define more.</p>

<ol><li><p><span>Start the WebSocket closing handshake</span> of any
<code><a href=#websocket>WebSocket</a></code> objects that were created by the <code title=dom-WebSocket><a href=#dom-websocket>WebSocket()</a></code> constructor visible on the
<code><a href=#document>Document</a></code>'s <code><a href=#window>Window</a></code> object, with the status
code<!--CLOSE CODE--> set to 1001. If this affected any
<code><a href=#websocket>WebSocket</a></code> objects, the set <code><a href=#document>Document</a></code>'s
<var title=concept-document-salvageable>salvageable</var> state
to false.
<ol><li>

<p><a href=#make-disappear>Make disappear</a> any <code><a href=#websocket>WebSocket</a></code> objects
that were created by the <code title=dom-WebSocket><a href=#dom-websocket>WebSocket()</a></code> constructor whose global
object is the <code><a href=#document>Document</a></code>'s <code><a href=#window>Window</a></code> object.


</p>

<p>If this affected any <code><a href=#websocket>WebSocket</a></code> objects, the set
<code><a href=#document>Document</a></code>'s <var title=concept-document-salvageable>salvageable</var> state to
false.</p>

</li>

<li><p>If the <code><a href=#document>Document</a></code>'s <var title=concept-document-salvageable>salvageable</var> state is
Expand Down Expand Up @@ -79384,10 +79388,42 @@ <h5 id=garbage-collection-1><span class=secno>11.3.3.2 </span>Garbage collection
WebSocket closing handshake</span>, with no status code<!--CLOSE
CODE--> for the Close message. <a href=#refsWSP>[WSP]</a></p>

<hr><p>If a user agent is to <dfn id=make-disappear>make disappear</dfn> a
<code><a href=#websocket>WebSocket</a></code> object (this happens when a
<code><a href=#document>Document</a></code> object goes away), the user agent must follow
the first appropriate set of steps from the following list:</p>

<dl class=switch><dt>If the WebSocket connection is not yet <span title="WebSocket
connection is established">established</span> <a href=#refsWSP>[WSP]</a></dt>

<dd>

<p><span>Fail the WebSocket connection</span>. <a href=#refsWSP>[WSP]</a></p>

</div><!--data-component-->
</dd>


<dt>If the WebSocket closing handshake has not yet been <span title="the WebSocket closing handshake has started">started</span>
<a href=#refsWSP>[WSP]</a></dt>

<dd>

<p><span>Start the WebSocket closing handshake</span>, with the
status code<!--CLOSE CODE--> to use in the WebSocket Close message
being 1001. <a href=#refsWSP>[WSP]</a></p>

</dd>


<dt>Otherwise</dt>

<dd>

<p>Do nothing.</p>

</dd>

</dl></div><!--data-component-->


<!--POSTMSG-->
Expand Down
20 changes: 12 additions & 8 deletions index
Expand Up @@ -64387,17 +64387,21 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
</ol><p>This specification defines the following <dfn id=unloading-document-cleanup-steps>unloading document
cleanup steps</dfn>. Other specifications can define more.</p>

<ol><li><p><span>Start the WebSocket closing handshake</span> of any
<code>WebSocket</code> objects that were created by the <code title=dom-WebSocket>WebSocket()</code> constructor visible on the
<code><a href=#document>Document</a></code>'s <code><a href=#window>Window</a></code> object, with the status
code<!--CLOSE CODE--> set to 1001. If this affected any
<code>WebSocket</code> objects, the set <code><a href=#document>Document</a></code>'s
<var title=concept-document-salvageable>salvageable</var> state
to false.
<ol><li>

<p><span>Make disappear</span> any <code>WebSocket</code> objects
that were created by the <code title=dom-WebSocket>WebSocket()</code> constructor whose global
object is the <code><a href=#document>Document</a></code>'s <code><a href=#window>Window</a></code> object.


<a href=#refsWEBSOCKET>[WEBSOCKET]</a>

<a href=#refsWEBSOCKET>[WEBSOCKET]</a>

</p>

<p>If this affected any <code>WebSocket</code> objects, the set
<code><a href=#document>Document</a></code>'s <var title=concept-document-salvageable>salvageable</var> state to
false.</p>

</li>

Expand Down
69 changes: 59 additions & 10 deletions source
Expand Up @@ -73370,20 +73370,25 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O

<ol>

<li><p><span>Start the WebSocket closing handshake</span> of any
<code>WebSocket</code> objects that were created by the <code
title="dom-WebSocket">WebSocket()</code> constructor visible on the
<code>Document</code>'s <code>Window</code> object, with the status
code<!--CLOSE CODE--> set to 1001. If this affected any
<code>WebSocket</code> objects, the set <code>Document</code>'s
<var title="concept-document-salvageable">salvageable</var> state
to false.
<li>

<p><span>Make disappear</span> any <code>WebSocket</code> objects
that were created by the <code
title="dom-WebSocket">WebSocket()</code> constructor whose global
object is the <code>Document</code>'s <code>Window</code> object.

<!--END complete--><!--END epub-->
<a href="#refsWEBSOCKET">[WEBSOCKET]</a>
<a href="#refsWEBSOCKET">[WEBSOCKET]</a>
<!--START complete--><!--START epub-->

</p></li>
</p>

<p>If this affected any <code>WebSocket</code> objects, the set
<code>Document</code>'s <var
title="concept-document-salvageable">salvageable</var> state to
false.</p>

</li>

<li><p>If the <code>Document</code>'s <var
title="concept-document-salvageable">salvageable</var> state is
Expand Down Expand Up @@ -90149,6 +90154,50 @@ Once we have the cookies back:
WebSocket closing handshake</span>, with no status code<!--CLOSE
CODE--> for the Close message. <a href="#refsWSP">[WSP]</a></p>

<hr>

<p>If a user agent is to <dfn>make disappear</dfn> a
<code>WebSocket</code> object (this happens when a
<code>Document</code> object goes away), the user agent must follow
the first appropriate set of steps from the following list:</p>

<dl class="switch">

<dt>If the WebSocket connection is not yet <span title="WebSocket
connection is established">established</span> <a
href="#refsWSP">[WSP]</a></dt>

<dd>

<p><span>Fail the WebSocket connection</span>. <a
href="#refsWSP">[WSP]</a></p>

</dd>


<dt>If the WebSocket closing handshake has not yet been <span
title="the WebSocket closing handshake has started">started</span>
<a href="#refsWSP">[WSP]</a></dt>

<dd>

<p><span>Start the WebSocket closing handshake</span>, with the
status code<!--CLOSE CODE--> to use in the WebSocket Close message
being 1001. <a href="#refsWSP">[WSP]</a></p>

</dd>


<dt>Otherwise</dt>

<dd>

<p>Do nothing.</p>

</dd>

</dl>


<!--END websocket-api-->

Expand Down

0 comments on commit 525e670

Please sign in to comment.