[html5] r4817 - [giow] (0) Prepare the spec for exposing failed closes.

whatwg at whatwg.org whatwg at whatwg.org
Tue Mar 2 02:56:15 PST 2010


Author: ianh
Date: 2010-03-02 02:56:14 -0800 (Tue, 02 Mar 2010)
New Revision: 4817

Modified:
   complete.html
   source
Log:
[giow] (0) Prepare the spec for exposing failed closes.

Modified: complete.html
===================================================================
--- complete.html	2010-03-02 10:42:16 UTC (rev 4816)
+++ complete.html	2010-03-02 10:56:14 UTC (rev 4817)
@@ -945,7 +945,8 @@
      <li><a href=#the-websocket-interface><span class=secno>10.3.2 </span>The <code>WebSocket</code> interface</a></li>
      <li><a href=#feedback-from-the-protocol><span class=secno>10.3.3 </span>Feedback from the protocol</a>
       <ol>
-       <li><a href=#garbage-collection-1><span class=secno>10.3.3.1 </span>Garbage collection</a></ol></li>
+       <li><a href=#event-definitions-1><span class=secno>10.3.3.1 </span>Event definitions</a></li>
+       <li><a href=#garbage-collection-1><span class=secno>10.3.3.2 </span>Garbage collection</a></ol></li>
      <li><a href=#websocket-protocol title="The WebSocket protocol enables
   two-way communication between a user agent running untrusted code
   running in a controlled environment to a remote host that has
@@ -67120,13 +67121,15 @@
   object.</p>
 
   <p id=closeWebSocket>When the <i><a href=#websocket-connection-is-closed>WebSocket connection is
-  closed</a></i>, the user agent must <a href=#queue-a-task>queue a task</a> to first
-  change the <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code>
-  attribute's value to <code title=dom-WebSocket-CLOSED><a href=#dom-websocket-closed>CLOSED</a></code> (2), and then <a href=#fire-a-simple-event>fire
-  a simple event</a> named <code title=event-close>close</code>
-  at the <code><a href=#websocket>WebSocket</a></code> object. (If the <code title=dom-WebSocket-close><a href=#dom-websocket-close>close()</a></code> method was called, the
-  <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code> attribute's
-  value will already be set to <code title=dom-WebSocket-CLOSED><a href=#dom-websocket-closed>CLOSED</a></code> (2) when this task
+  closed</a></i>, the user agent must create an event that uses the
+  <code><a href=#closeevent>CloseEvent</a></code> interface, with the event name <code title=event-close>close</code>, which does not bubble, is not
+  cancelable, has no default action, and whose <code title=dom-CloseEvent-wasClean><a href=#dom-closeevent-wasclean>wasClean</a></code> attribute is set to
+  false, and <a href=#queue-a-task>queue a task</a> to first change the <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code> attribute's value
+  to <code title=dom-WebSocket-CLOSED><a href=#dom-websocket-closed>CLOSED</a></code> (2), and then
+  dispatch the event at the <code><a href=#websocket>WebSocket</a></code> object. (If the
+  <code title=dom-WebSocket-close><a href=#dom-websocket-close>close()</a></code> method was called,
+  the <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code>
+  attribute's value will already be set to <code title=dom-WebSocket-CLOSED><a href=#dom-websocket-closed>CLOSED</a></code> (2) when this task
   runs.)</p>
 
   <p>The <a href=#task-source>task source</a> for all <a href=#concept-task title=concept-task>tasks</a> <a href=#queue-a-task title="queue a
@@ -67134,14 +67137,32 @@
   source</dfn>.</p>
 
 
-  <h5 id=garbage-collection-1><span class=secno>10.3.3.1 </span>Garbage collection</h5>
+  <h5 id=event-definitions-1><span class=secno>10.3.3.1 </span>Event definitions</h5>
 
+  <pre class=idl>interface <dfn id=closeevent>CloseEvent</dfn> : <a href=#event>Event</a> {
+  readonly attribute boolean <a href=#dom-closeevent-wasclean title=dom-CloseEvent-wasClean>wasClean</a>;
+  void <a href=#dom-closeevent-initcloseevent title=dom-CloseEvent-initCloseEvent>initCloseEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in boolean wasCleanArg);
+};</pre>
+
+  <p>The <dfn id=dom-closeevent-initcloseevent title=dom-CloseEvent-initCloseEvent><code>initCloseEvent()</code></dfn>
+  method must initialize the event in a manner analogous to the
+  similarly-named method in the DOM Events interfaces. <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
+
+  <p>The <dfn id=dom-closeevent-wasclean title=dom-CloseEvent-wasClean><code>wasClean</code></dfn>
+  attribute represents whether the connection closed cleanly or
+  not.</p>
+
+
+
+  <h5 id=garbage-collection-1><span class=secno>10.3.3.2 </span>Garbage collection</h5>
+
   <p>A <code><a href=#websocket>WebSocket</a></code> object with an open connection must not
   be garbage collected if there are any event listeners registered for
   <code title=event-message><a href=#event-message>message</a></code> events.</p>
 
   <p>If a <code><a href=#websocket>WebSocket</a></code> object is garbage collected while its
-  connection is still open, the user agent must <a href=#close-the-websocket-connection>close the WebSocket connection</a>.</p>
+  connection is still open, the user agent must <a href=#close-the-websocket-connection>close the
+  WebSocket connection</a>.</p>
 
 
   

Modified: source
===================================================================
--- source	2010-03-02 10:42:16 UTC (rev 4816)
+++ source	2010-03-02 10:56:14 UTC (rev 4817)
@@ -75469,15 +75469,18 @@
   object.</p>
 
   <p id="closeWebSocket">When the <i>WebSocket connection is
-  closed</i>, the user agent must <span>queue a task</span> to first
-  change the <code title="dom-WebSocket-readyState">readyState</code>
-  attribute's value to <code
-  title="dom-WebSocket-CLOSED">CLOSED</code> (2), and then <span>fire
-  a simple event</span> named <code title="event-close">close</code>
-  at the <code>WebSocket</code> object. (If the <code
-  title="dom-WebSocket-close">close()</code> method was called, the
-  <code title="dom-WebSocket-readyState">readyState</code> attribute's
-  value will already be set to <code
+  closed</i>, the user agent must create an event that uses the
+  <code>CloseEvent</code> interface, with the event name <code
+  title="event-close">close</code>, which does not bubble, is not
+  cancelable, has no default action, and whose <code
+  title="dom-CloseEvent-wasClean">wasClean</code> attribute is set to
+  false, and <span>queue a task</span> to first change the <code
+  title="dom-WebSocket-readyState">readyState</code> attribute's value
+  to <code title="dom-WebSocket-CLOSED">CLOSED</code> (2), and then
+  dispatch the event at the <code>WebSocket</code> object. (If the
+  <code title="dom-WebSocket-close">close()</code> method was called,
+  the <code title="dom-WebSocket-readyState">readyState</code>
+  attribute's value will already be set to <code
   title="dom-WebSocket-CLOSED">CLOSED</code> (2) when this task
   runs.)</p>
 
@@ -75487,6 +75490,26 @@
   source</dfn>.</p>
 
 
+  <h5>Event definitions</h5>
+
+  <pre class="idl">interface <dfn>CloseEvent</dfn> : <span>Event</span> {
+  readonly attribute boolean <span title="dom-CloseEvent-wasClean">wasClean</span>;
+  void <span title="dom-CloseEvent-initCloseEvent">initCloseEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in boolean wasCleanArg);
+};</pre>
+
+  <p>The <dfn
+  title="dom-CloseEvent-initCloseEvent"><code>initCloseEvent()</code></dfn>
+  method must initialize the event in a manner analogous to the
+  similarly-named method in the DOM Events interfaces. <a
+  href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
+
+  <p>The <dfn
+  title="dom-CloseEvent-wasClean"><code>wasClean</code></dfn>
+  attribute represents whether the connection closed cleanly or
+  not.</p>
+
+
+
   <h5>Garbage collection</h5>
 
   <p>A <code>WebSocket</code> object with an open connection must not
@@ -75494,7 +75517,8 @@
   <code title="event-message">message</code> events.</p>
 
   <p>If a <code>WebSocket</code> object is garbage collected while its
-  connection is still open, the user agent must <span>close the WebSocket connection</span>.</p>
+  connection is still open, the user agent must <span>close the
+  WebSocket connection</span>.</p>
 
 
   <!--END websocket-api-->




More information about the Commit-Watchers mailing list