[html5] r6155 - [giow] (0) Fix how WebSockets close due to navigation to be more well-defined.

whatwg at whatwg.org whatwg at whatwg.org
Fri May 27 14:52:49 PDT 2011


Author: ianh
Date: 2011-05-27 14:52:47 -0700 (Fri, 27 May 2011)
New Revision: 6155

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Fix how WebSockets close due to navigation to be more well-defined.

Modified: complete.html
===================================================================
--- complete.html	2011-05-27 21:38:55 UTC (rev 6154)
+++ complete.html	2011-05-27 21:52:47 UTC (rev 6155)
@@ -64367,15 +64367,19 @@
   </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
@@ -79384,12 +79388,44 @@
   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>
 
-  </div><!--data-component-->
+    <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></div><!--data-component-->
+
+
 <!--POSTMSG-->
 
 

Modified: index
===================================================================
--- index	2011-05-27 21:38:55 UTC (rev 6154)
+++ index	2011-05-27 21:52:47 UTC (rev 6155)
@@ -64387,18 +64387,22 @@
   </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>
 
    <li><p>If the <code><a href=#document>Document</a></code>'s <var title=concept-document-salvageable>salvageable</var> state is

Modified: source
===================================================================
--- source	2011-05-27 21:38:55 UTC (rev 6154)
+++ source	2011-05-27 21:52:47 UTC (rev 6155)
@@ -73370,21 +73370,26 @@
 
   <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
    false, empty the <code>Document</code>'s <code>Window</code>'s
@@ -90149,7 +90154,51 @@
   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-->
 
   </div><!--data-component-->




More information about the Commit-Watchers mailing list