[html5] r6156 - [giow] (0) Update all the WebSocket terminology to match the next WSP draft.
whatwg at whatwg.org
whatwg at whatwg.org
Fri May 27 16:31:53 PDT 2011
Author: ianh
Date: 2011-05-27 16:31:52 -0700 (Fri, 27 May 2011)
New Revision: 6156
Modified:
complete.html
index
source
Log:
[giow] (0) Update all the WebSocket terminology to match the next WSP draft.
Modified: complete.html
===================================================================
--- complete.html 2011-05-27 21:52:47 UTC (rev 6155)
+++ complete.html 2011-05-27 23:31:52 UTC (rev 6156)
@@ -3471,11 +3471,20 @@
</dd>
+ <dt>Cookies</dt>
+
+ <dd>
+
+ <p>The following term is defined in the Cookie specification: <a href=#refsCOOKIES>[COOKIES]</a></p>
+
+ <ul class=brief><li><dfn id=receives-a-set-cookie-string>Receives a set-cookie-string</dfn>
+ </ul></dd>
+
<dt>CORS</dt>
<dd>
- <p>The following terms are defined in the CORS specification:</p>
+ <p>The following terms are defined in the CORS specification: <a href=#refsCORS>[CORS]</a></p>
<ul class=brief><li><dfn id=cross-origin-request>cross-origin request</dfn>
<li><dfn id=cross-origin-request-status>cross-origin request status</dfn>
@@ -3511,6 +3520,38 @@
</dd>
+
+
+ <dt>The WebSocket protocol</dt>
+
+ <dd>
+
+ <div data-component="WebSocket API (editor: Ian Hickson)"><!--websocket-api-->
+
+ <p>The following terms are defined in the WebSocket protocol
+ specification: <a href=#refsWSP>[WSP]</a></p>
+
+ <ul class=brief><li><dfn id="parse-a-websocket-url's-components">parse a WebSocket URL's components</dfn>
+ <li><dfn id=establish-a-websocket-connection>establish a WebSocket connection</dfn>
+ <li><dfn id=the-websocket-connection-is-established>the WebSocket connection is established</dfn>
+ <li><dfn id="validate-the-server's-response">validate the server's response</dfn>
+ <li><dfn id=subprotocol-in-use>subprotocol in use</dfn>
+ <li><dfn id="cookies-set-during-the-server's-opening-handshake">cookies set during the server's opening handshake</dfn>
+ <li><dfn id=a-websocket-message-has-been-received>a WebSocket message has been received</dfn>
+ <li><dfn id=fail-the-websocket-connection>fail the WebSocket connection</dfn>
+ <li><dfn id=close-the-websocket-connection>close the WebSocket connection</dfn>
+ <li><dfn id=start-the-websocket-closing-handshake>start the WebSocket closing handshake</dfn>
+ <li><dfn id=the-websocket-closing-handshake-is-started>the WebSocket closing handshake is started</dfn>
+ <li><dfn id=the-websocket-connection-is-closed>the WebSocket connection is closed</dfn> (possibly <i title="">cleanly</i>)
+ <li><dfn id=the-websocket-connection-close-code>the WebSocket connection close code</dfn>
+ <li><dfn id=the-websocket-connection-close-reason>the WebSocket connection close reason</dfn>
+
+ </ul></div><!--data-component-->
+
+ </dd>
+
+
+
</dl><p>This specification does not <em>require</em> support of any
particular network protocol, style sheet language, scripting
language, or any of the DOM specifications beyond those described
@@ -9082,8 +9123,8 @@
<a href=#origin>origin</a> is not a scheme/host/port tuple, the user agent
must raise a <code><a href=#security_err>SECURITY_ERR</a></code> exception. Otherwise, the
user agent must <a href=#obtain-the-storage-mutex>obtain the storage mutex</a> and then act
- as it would when <span title="receives a
- set-cookie-string">receiving a set-cookie-string</span> for
+ as it would when <a href=#receives-a-set-cookie-string title="receives a
+ set-cookie-string">receiving a set-cookie-string</a> for
<a href="#the-document's-address">the document's address</a> via a "non-HTTP" API, consisting
of the new value encoded as UTF-8. <a href=#refsCOOKIES>[COOKIES]</a> <a href=#refsRFC3629>[RFC3629]</a></p>
@@ -14843,8 +14884,8 @@
<li><p><a href=#obtain-the-storage-mutex>Obtain the storage mutex</a>.</li>
- <li><p>Act as if <span title="receives a
- set-cookie-string">receiving a set-cookie-string</span> for
+ <li><p>Act as if <a href=#receives-a-set-cookie-string title="receives a
+ set-cookie-string">receiving a set-cookie-string</a> for
<a href="#the-document's-address">the document's address</a> via a "non-HTTP" API,
consisting of the value of the element's <code title=attr-meta-content><a href=#attr-meta-content>content</a></code> attribute encoded as
UTF-8. <a href=#refsCOOKIES>[COOKIES]</a> <a href=#refsRFC3629>[RFC3629]</a></li>
@@ -78840,8 +78881,8 @@
// networking
attribute <a href=#function>Function</a> <a href=#handler-websocket-onopen title=handler-WebSocket-onopen>onopen</a>;
- attribute <a href=#function>Function</a> <a href=#handler-websocket-onerror title=handler-WebSocket-onerror>onerror</a>;
- attribute <a href=#function>Function</a> <a href=#handler-websocket-onclose title=handler-WebSocket-onclose>onclose</a>;
+<!-- attribute <span>Function</span> <span title="handler-WebSocket-onerror">onerror</span>;
+--> attribute <a href=#function>Function</a> <a href=#handler-websocket-onclose title=handler-WebSocket-onclose>onclose</a>;
readonly attribute DOMString <a href=#dom-websocket-protocol title=dom-WebSocket-protocol>protocol</a>;
void <a href=#dom-websocket-close title=dom-WebSocket-close>close</a>(in optional unsigned short code, in optional DOMString reason);
@@ -78869,10 +78910,10 @@
<p>When the <code>WebSocket()</code> constructor is invoked, the UA
must run these steps:</p>
- <ol><li><p><span>Parse a WebSocket URL's components</span> from the
- <var title="">url</var> argument, to obtain <var title="">host</var>, <var title="">port</var>, <var title="">resource name</var>, and <var title="">secure</var>. If
- this fails, throw a <code><a href=#syntax_err>SYNTAX_ERR</a></code> exception and abort
- these steps. <a href=#refsWSP>[WSP]</a></li>
+ <ol><li><p><i><a href="#parse-a-websocket-url's-components">Parse a WebSocket URL's components</a></i> from the <var title="">url</var> argument, to obtain <var title="">host</var>,
+ <var title="">port</var>, <var title="">resource name</var>, and
+ <var title="">secure</var>. If this fails, throw a
+ <code><a href=#syntax_err>SYNTAX_ERR</a></code> exception and abort these steps. <a href=#refsWSP>[WSP]</a></li>
<li>
@@ -78916,16 +78957,15 @@
<li>
- <p><span>Establish a WebSocket connection</span> to a host <var title="">host</var>, on port <var title="">port</var> (if one was
- specified), from <var title="">origin</var>, with the flag <var title="">secure</var>, with <var title="">resource name</var> as
- the resource name, with <var title="">protocols</var> as the
- (possibly empty) list of protocols, and with the <var title="">defer cookies</var> flag set. <a href=#refsWSP>[WSP]</a></p>
+ <p><i><a href=#establish-a-websocket-connection>Establish a WebSocket connection</a></i> given the set (<var title="">host</var>, <var title="">port</var>, <var title="">resource name</var>, <var title="">secure</var>), along
+ with the <var title="">protocols</var> list and an empty list for
+ the extensions, and <var title="">origin</var>. <a href=#refsWSP>[WSP]</a></p>
- <p>When the user agent <i>validates the server's response</i> during
- the "<span>establish a WebSocket connection</span>" algorithm, if
- the status code received from the server is not 101 (e.g. it is a
- redirect), the user agent must <span>fail the websocket
- connection</span>.</p>
+ <p>When the user agent <i title="validate the server's
+ response"><a href="#validate-the-server's-response">validates the server's response</a></i> during the
+ "<i><a href=#establish-a-websocket-connection>establish a WebSocket connection</a></i>" algorithm, if the status
+ code received from the server is not 101 (e.g. it is a redirect),
+ the user agent must <i><a href=#fail-the-websocket-connection>fail the websocket connection</a></i>.</p>
<p class=warning>Following HTTP procedures here could introduce
serious security problems in a Web browser context. For example,
@@ -78936,12 +78976,11 @@
even if the script checks that the URL has the right hostname.</p>
<!-- http://www.ietf.org/mail-archive/web/hybi/current/msg06951.html -->
- <p class=note>If the "<span>establish a WebSocket
- connection</span>" algorithm fails, it triggers the "<span>fail
- the WebSocket connection</span>" algorithm, which then invokes
- the "<span>close the WebSocket connection</span>" algorithm,
- which then establishes that the "<span>WebSocket connection is
- closed</span>", which fires the <code title=event-close>close</code> event <a href=#closeWebSocket>as described below</a>.</p>
+ <p class=note>If the <i><a href=#establish-a-websocket-connection>establish a WebSocket connection</a></i>
+ algorithm fails, it triggers the <i><a href=#fail-the-websocket-connection>fail the WebSocket
+ connection</a></i> algorithm, which then invokes the <i><a href=#close-the-websocket-connection>close the
+ WebSocket connection</a></i> algorithm, which then establishes that
+ <i><a href=#the-websocket-connection-is-closed>the WebSocket connection is closed</a></i>, which fires the <code title=event-close>close</code> event <a href=#closeWebSocket>as described below</a>.</p>
</li>
@@ -78965,7 +79004,7 @@
<dt><dfn id=dom-websocket-open title=dom-WebSocket-OPEN><code>OPEN</code></dfn> (numeric value 1)</dt>
- <dd>The <span>WebSocket connection is established</span> and communication is possible.</dd>
+ <dd><i><a href=#the-websocket-connection-is-established>The WebSocket connection is established</a></i> and communication is possible.</dd>
<dt><dfn id=dom-websocket-closing title=dom-WebSocket-CLOSING><code>CLOSING</code></dfn> (numeric value 2)</dt>
@@ -78979,8 +79018,8 @@
<code title=dom-WebSocket-CONNECTING><a href=#dom-websocket-connecting>CONNECTING</a></code> (0).</p>
<p>The <dfn id=dom-websocket-protocol title=dom-WebSocket-protocol><code>protocol</code></dfn> attribute
- must initially return the empty string. After the <span>WebSocket
- connection is established</span>, its value might change, as defined
+ must initially return the empty string. After <i><a href=#the-websocket-connection-is-established>the WebSocket
+ connection is established</a></i>, its value might change, as defined
below.</p>
<p class=note>The <code title=dom-WebSocket-protocol><a href=#dom-websocket-protocol>protocol</a></code> attribute returns the
@@ -79011,30 +79050,30 @@
</dd>
- <dt>If the WebSocket connection is not yet <span title="WebSocket
- connection is established">established</span> <a href=#refsWSP>[WSP]</a></dt>
+ <dt>If the WebSocket connection is not yet <i title="the
+ WebSocket connection is established"><a href=#the-websocket-connection-is-established>established</a></i> <a href=#refsWSP>[WSP]</a></dt>
<dd>
- <p><span>Fail the WebSocket connection</span> and set the <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code> attribute's
+ <p><i><a href=#fail-the-websocket-connection>Fail the WebSocket connection</a></i> and set the <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code> attribute's
value to <code title=dom-WebSocket-CLOSING><a href=#dom-websocket-closing>CLOSING</a></code> (2).
<a href=#refsWSP>[WSP]</a></p>
- <p class=note>The "<span>fail the WebSocket connection</span>"
- algorithm invokes the "<span>close the WebSocket
- connection</span>" algorithm, which then establishes that the
- "<span>WebSocket connection is closed</span>", which fires the
+ <p class=note>The <i><a href=#fail-the-websocket-connection>fail the WebSocket connection</a></i>
+ algorithm invokes the <i><a href=#close-the-websocket-connection>close the WebSocket
+ connection</a></i> algorithm, which then establishes that
+ <i><a href=#the-websocket-connection-is-closed>the WebSocket connection is closed</a></i>, which fires the
<code title=event-close>close</code> event <a href=#closeWebSocket>as described below</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>
+ <dt>If the WebSocket closing handshake has not yet been <i title="the WebSocket closing handshake is
+ started"><a href=#the-websocket-closing-handshake-is-started>started</a></i> <a href=#refsWSP>[WSP]</a></dt>
<dd>
- <p><span>Start the WebSocket closing handshake</span> and set the
+ <p><i><a href=#start-the-websocket-closing-handshake>Start the WebSocket closing handshake</a></i> and set the
<code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code>
attribute's value to <code title=dom-WebSocket-CLOSING><a href=#dom-websocket-closing>CLOSING</a></code> (2). <a href=#refsWSP>[WSP]</a></p>
@@ -79044,13 +79083,12 @@
<p>If the second argument is also present, then it must be
encoded as UTF-8 and provided in the Close message after the
- status code<!--CLOSE CODE-->. <a href=#refsWSP>[WSP]</a></p>
+ status code<!--CLOSE CODE-->. <a href=#refsRFC3629>[RFC3629]</a> <a href=#refsWSP>[WSP]</a></p>
- <p class=note>The "<span>start the WebSocket closing
- handshake</span>" algorithm eventually invokes the "<span>close
- the WebSocket connection</span>" algorithm, which then establishes
- that the "<span>WebSocket connection is closed</span>", which
- fires the <code title=event-close>close</code> event <a href=#closeWebSocket>as described below</a>.</p>
+ <p class=note>The <i><a href=#start-the-websocket-closing-handshake>start the WebSocket closing handshake</a></i>
+ algorithm eventually invokes the <i><a href=#close-the-websocket-connection>close the WebSocket
+ connection</a></i> algorithm, which then establishes that <i><a href=#the-websocket-connection-is-closed>the
+ WebSocket connection is closed</a></i>, which fires the <code title=event-close>close</code> event <a href=#closeWebSocket>as described below</a>.</p>
</dd>
@@ -79063,29 +79101,27 @@
value to <code title=dom-WebSocket-CLOSING><a href=#dom-websocket-closing>CLOSING</a></code>
(2).</p>
- <p class=note><span>The WebSocket closing handshake has
- started</span>, and will eventually invokethe "<span>close the
- WebSocket connection</span>" algorithm, which will establish that
- the "<span>WebSocket connection is closed</span>", and thus the
- <code title=event-close>close</code> event will fire, <a href=#closeWebSocket>as described below</a>.</p>
+ <p class=note><i><a href=#the-websocket-closing-handshake-is-started>The WebSocket closing handshake is
+ started</a></i>, and will eventually invoke the <i><a href=#close-the-websocket-connection>close the
+ WebSocket connection</a></i> algorithm, which will establish that
+ <i><a href=#the-websocket-connection-is-closed>the WebSocket connection is closed</a></i>, and thus the <code title=event-close>close</code> event will fire, <a href=#closeWebSocket>as described below</a>.</p>
</dd>
</dl></li>
</ol><hr><p>The <dfn id=dom-websocket-bufferedamount title=dom-WebSocket-bufferedAmount><code>bufferedAmount</code></dfn>
- attribute must return the number of bytes of UTF-8 text that have
- been queued using <code title=dom-WebSocket-send><a href=#dom-websocket-send>send()</a></code> but
- that, as of the last time the <a href=#event-loop>event loop</a> started
- executing a <a href=#concept-task title=concept-task>task</a>, had not yet been
- transmitted to the network. (This thus includes any text sent during
- the execution of the current task, regardless of whether the user
- agent is able to transmit text asynchronously with script
- execution.) This does not include framing overhead incurred by the
- protocol, or buffering done by the operating system or network
- hardware. If the connection is closed, this attribute's value will
- only increase with each call to the <code title=dom-WebSocket-send><a href=#dom-websocket-send>send()</a></code> method (the number does not
- reset to zero once the connection closes).</p>
+ attribute must return the number of bytes of application data (UTF-8
+ text and binary data) that have been queued using <code title=dom-WebSocket-send><a href=#dom-websocket-send>send()</a></code> but that, as of the last
+ time the <a href=#event-loop>event loop</a> started executing a <a href=#concept-task title=concept-task>task</a>, had not yet been transmitted to
+ the network. (This thus includes any text sent during the execution
+ of the current task, regardless of whether the user agent is able to
+ transmit text asynchronously with script execution.) This does not
+ include framing overhead incurred by the protocol, or buffering done
+ by the operating system or network hardware. If the connection is
+ closed, this attribute's value will only increase with each call to
+ the <code title=dom-WebSocket-send><a href=#dom-websocket-send>send()</a></code> method (the
+ number does not reset to zero once the connection closes).</p>
<div class=example>
@@ -79151,17 +79187,18 @@
<p>If the <var title="">data</var> argument has any unpaired
surrogates, then raise an <code><a href=#syntax_err>SYNTAX_ERR</a></code> exception. If
- the connection is established, and the string has no unpaired
- surrogates, and <span title="the WebSocket closing handshake has
- started">the WebSocket closing handshake has not yet
- started</span>, then the user agent must <span>send <var title="">data</var> using the WebSocket</span> using a text frame
- opcode; if the data cannot be sent, e.g. because it would need to
- be buffered but the buffer is full, the user agent must
- <span>close the WebSocket connection</span>. Any invokation of
- this method with a string argument that does not raise an
- exception must increase the <code title=dom-WebSocket-bufferedAmount><a href=#dom-websocket-bufferedamount>bufferedAmount</a></code>
+ <i><a href=#the-websocket-connection-is-established>the WebSocket connection is established</a></i>, and the
+ string has no unpaired surrogates, and <i title="the WebSocket
+ closing handshake is started"><a href=#the-websocket-closing-handshake-is-started>the WebSocket closing handshake has
+ not yet started</a></i>, then the user agent must <i>send a WebSocket
+ Message</i> comprised of <var title="">data</var> using a text
+ frame opcode; if the data cannot be sent, e.g. because it would
+ need to be buffered but the buffer is full, the user agent must
+ <i><a href=#close-the-websocket-connection>close the WebSocket connection</a></i>. Any invokation of this
+ method with a string argument that does not raise an exception
+ must increase the <code title=dom-WebSocket-bufferedAmount><a href=#dom-websocket-bufferedamount>bufferedAmount</a></code>
attribute by the number of bytes needed to express the argument as
- UTF-8. <a href=#refsWSP>[WSP]</a></p>
+ UTF-8. <a href=#refsRFC3629>[RFC3629]</a> <a href=#refsWSP>[WSP]</a></p>
</dd>
@@ -79170,18 +79207,16 @@
<dd>
- <p>If the connection is established, and <span title="The
- WebSocket Closing Handshake is Started">the WebSocket closing
- handshake has not yet started</span>, then the user agent must
- <span>send <var title="">data</var> using the WebSocket</span>
- using a binary frame opcode; if the data cannot be sent, e.g.
- because it would need to be buffered but the buffer is full, the
- user agent must <span>close the WebSocket connection</span>. The
- data to be sent is the raw data represented by the
- <code><a href=#blob>Blob</a></code> object. <!-- that sentence is meant to invoke
- "This interface represents immutable raw data." --> Any invokation
- of this method with a <code><a href=#blob>Blob</a></code> argument that does not
- raise an exception must increase the <code title=dom-WebSocket-bufferedAmount><a href=#dom-websocket-bufferedamount>bufferedAmount</a></code>
+ <p>If <i><a href=#the-websocket-connection-is-established>the WebSocket connection is established</a></i>, and <i title="the WebSocket closing handshake is started"><a href=#the-websocket-closing-handshake-is-started>the WebSocket
+ closing handshake has not yet started</a></i>, then the user agent
+ must <i>send a WebSocket Message</i> comprised of <var title="">data</var> using a binary frame opcode; if the data
+ cannot be sent, e.g. because it would need to be buffered but the
+ buffer is full, the user agent must <i><a href=#close-the-websocket-connection>close the WebSocket
+ connection</a></i>. The data to be sent is the raw data represented by
+ the <code><a href=#blob>Blob</a></code> object. <!-- that sentence is meant to
+ invoke "This interface represents immutable raw data." --> Any
+ invokation of this method with a <code><a href=#blob>Blob</a></code> argument that
+ does not raise an exception must increase the <code title=dom-WebSocket-bufferedAmount><a href=#dom-websocket-bufferedamount>bufferedAmount</a></code>
attribute by the size of the <code><a href=#blob>Blob</a></code> object's raw data,
in bytes. <!-- that sentence is meant to invoke the same as
Blob.size --> <a href=#refsWSP>[WSP]</a> <a href=#refsFILEAPI>[FILEAPI]</a></p>
@@ -79193,19 +79228,18 @@
<dd>
- <p>If the connection is established, and <span title="The
- WebSocket Closing Handshake is Started">the WebSocket closing
- handshake has not yet started</span>, then the user agent must
- <span>send <var title="">data</var> using the WebSocket</span>
- using a binary frame opcode; if the data cannot be sent, e.g.
- because it would need to be buffered but the buffer is full, the
- user agent must <span>close the WebSocket connection</span>. The
- data to be sent is the data stored in the buffer described by the
- <code>ArrayBuffer</code> object. <!-- that sentence is meant to
- invoke "The ArrayBuffer type describes a buffer used to store data
- for the array buffer views." at the top of the Typed Array spec
- --> Any invokation of this method with an <code>ArrayBuffer</code>
- argument that does not raise an exception must increase the <code title=dom-WebSocket-bufferedAmount><a href=#dom-websocket-bufferedamount>bufferedAmount</a></code>
+ <p>If <i><a href=#the-websocket-connection-is-established>the WebSocket connection is established</a></i>, and <i title="the WebSocket closing handshake is started"><a href=#the-websocket-closing-handshake-is-started>the WebSocket
+ closing handshake has not yet started</a></i>, then the user agent
+ must <i>send a WebSocket Message</i> comprised of <var title="">data</var> using a binary frame opcode; if the data
+ cannot be sent, e.g. because it would need to be buffered but the
+ buffer is full, the user agent must <i><a href=#close-the-websocket-connection>close the WebSocket
+ connection</a></i>. The data to be sent is the data stored in the
+ buffer described by the <code>ArrayBuffer</code> object. <!-- that
+ sentence is meant to invoke "The ArrayBuffer type describes a
+ buffer used to store data for the array buffer views." at the top
+ of the Typed Array spec --> Any invokation of this method with an
+ <code>ArrayBuffer</code> argument that does not raise an exception
+ must increase the <code title=dom-WebSocket-bufferedAmount><a href=#dom-websocket-bufferedamount>bufferedAmount</a></code>
attribute by the length of the <code>ArrayBuffer</code> in bytes.
<!-- that sentence is meant to invoke the same as
ArrayBuffer.byteLength --> <a href=#refsWSP>[WSP]</a> <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
@@ -79219,34 +79253,28 @@
<table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
<tbody><tr><td><dfn id=handler-websocket-onopen title=handler-WebSocket-onopen><code>onopen</code></dfn> <td> <code title=event-open>open</code>
<tr><td><dfn id=handler-websocket-onmessage title=handler-WebSocket-onmessage><code>onmessage</code></dfn> <td> <code title=event-message><a href=#event-message>message</a></code>
- <tr><td><dfn id=handler-websocket-onerror title=handler-WebSocket-onerror><code>onerror</code></dfn> <td> <code title=event-error>error</code>
+<!-- <tr><td><dfn title="handler-WebSocket-onerror"><code>onerror</code></dfn> <td> <code title="event-error">error</code>-->
<tr><td><dfn id=handler-websocket-onclose title=handler-WebSocket-onclose><code>onclose</code></dfn> <td> <code title=event-close>close</code>
</table><h4 id=feedback-from-the-protocol><span class=secno>11.3.3 </span>Feedback from the protocol</h4>
- <p>When the <i>WebSocket connection is established</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-OPEN><a href=#dom-websocket-open>OPEN</a></code> (1); <span>apply the
- cookies</span>
-<!--
-Once we have the cookies back:
+ <p>When <i><a href=#the-websocket-connection-is-established>the WebSocket connection is established</a></i>, the user
+ agent must <a href=#queue-a-task>queue a task</a> to run these steps:</p>
- <li><p>Act as if <span title="receives a
- set-cookie-string">receiving a set-cookie-string</span> for
- <span>the document's address</span>,
- consisting of the value of the element's <code
- title="attr-meta-content">content</code> attribute encoded as
- UTF-8. <a href="#refsCOOKIES">[COOKIES]</a> <a
- href="#refsRFC3629">[RFC3629]</a></p></li>
+ <ol><li><p>Change the <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code> attribute's
+ value to <code title=dom-WebSocket-OPEN><a href=#dom-websocket-open>OPEN</a></code> (1).</li>
--->
- that were collected in the <var title="">list of
- cookies</var> when the <span title="WebSocket connection is
- established">connection was established</span>; change the <code title=dom-WebSocket-protocol><a href=#dom-websocket-protocol>protocol</a></code> attribute's value to
- the <span>selected WebSocket subprotocol</span>, if there is one;
- and then <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-open>open</code> at the <code><a href=#websocket>WebSocket</a></code> object.
- <a href=#refsWSP>[WSP]</a></p>
+ <li><p>Change the <code title=dom-WebSocket-protocol><a href=#dom-websocket-protocol>protocol</a></code> attribute's value to
+ the <i><a href=#subprotocol-in-use>subprotocol in use</a></i>, if is not the null value. <a href=#refsWSP>[WSP]</a></li>
- <p>When <i>a WebSocket message has been received</i> with type <var title="">type</var> and data <var title="">data</var>, the user
+ <li><p>Act as if the user agent had <a href=#receives-a-set-cookie-string title="receives a
+ set-cookie-string">received a set-cookie-string</a> for
+ <a href="#the-document's-address">the document's address</a>, consisting of the <i><a href="#cookies-set-during-the-server's-opening-handshake">cookies
+ set during the server's opening handshake</a></i>. <a href=#refsCOOKIES>[COOKIES]</a> <a href=#refsRFC3629>[RFC3629]</a> <a href=#refsWSP>[WSP]</a></li>
+
+ <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-open>open</code> at the <code><a href=#websocket>WebSocket</a></code>
+ object.</p>
+
+ </ol><hr><p>When <i><a href=#a-websocket-message-has-been-received>a WebSocket message has been received</a></i> with type <var title="">type</var> and data <var title="">data</var>, the user
agent must <a href=#queue-a-task>queue a task</a> to follow these steps: <a href=#refsWSP>[WSP]</a></p>
<ol><li>
@@ -79303,13 +79331,16 @@
back to RAM before running this <a href=#concept-task title=concept-task>task</a> so as to avoid stalling the main
thread while it created the <code>ArrayBuffer</code> object.</p>
+ <hr><!--
<p>When <i>a WebSocket error has been detected</i>, the user agent
- must <a href=#queue-a-task>queue a task</a> to check to see if the <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code> attribute's value
- is <code title=dom-WebSocket-OPEN><a href=#dom-websocket-open>OPEN</a></code> (1) or <code title=dom-WebSocket-CLOSING><a href=#dom-websocket-closing>CLOSING</a></code> (2), and if so,
- <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error>error</code> at the <code><a href=#websocket>WebSocket</a></code>
- object. <a href=#refsWSP>[WSP]</a></p>
-
- <p>When <i>the WebSocket closing handshake has started</i>, the user
+ must <span>queue a task</span> to check to see if the <code
+ title="dom-WebSocket-readyState">readyState</code> attribute's value
+ is <code title="dom-WebSocket-OPEN">OPEN</code> (1) or <code
+ title="dom-WebSocket-CLOSING">CLOSING</code> (2), and if so,
+ <span>fire a simple event</span> named <code
+ title="event-error">error</code> at the <code>WebSocket</code>
+ object. <a href="#refsWSP">[WSP]</a></p>
+--><p>When <i><a href=#the-websocket-closing-handshake-is-started>the WebSocket closing handshake is started</a></i>, the user
agent must <a href=#queue-a-task>queue a task</a> to change the <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code> attribute's value
to <code title=dom-WebSocket-CLOSING><a href=#dom-websocket-closing>CLOSING</a></code> (2). (If the
<code title=dom-WebSocket-close><a href=#dom-websocket-close>close()</a></code> method was called,
@@ -79317,17 +79348,17 @@
attribute's value will already be set to <code title=dom-WebSocket-CLOSING><a href=#dom-websocket-closing>CLOSING</a></code> (2) when this task
runs.) <a href=#refsWSP>[WSP]</a></p>
- <p id=closeWebSocket>When the <i>WebSocket connection is
- closed</i>, possibly <i title="">cleanly</i>, the user agent must
+ <p id=closeWebSocket>When <i><a href=#the-websocket-connection-is-closed>the WebSocket connection is
+ closed</a></i>, possibly <i title="">cleanly</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, whose
<code title=dom-CloseEvent-wasClean><a href=#dom-closeevent-wasclean>wasClean</a></code> attribute is
set to true if the connection closed <i title="">cleanly</i> and
false otherwise, whose <code title=dom-CloseEvent-code><a href=#dom-closeevent-code>code</a></code>
- attribute is set to the <i>WebSocket connection close code</i>, and
+ attribute is set to <i><a href=#the-websocket-connection-close-code>the WebSocket connection close code</a></i>, and
whose <code title=dom-CloseEvent-reason><a href=#dom-closeevent-reason>reason</a></code> attribute is
- set to the <i>WebSocket connection close reason</i>; and <a href=#queue-a-task>queue
+ set to <i><a href=#the-websocket-connection-close-reason>the WebSocket connection close reason</a></i>; 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> (3), and then
dispatch the event at the <code><a href=#websocket>WebSocket</a></code> object. <a href=#refsWSP>[WSP]</a></p>
@@ -79371,21 +79402,23 @@
(0) as of the last time the <a href=#event-loop>event loop</a> started
executing a <a href=#concept-task title=concept-task>task</a> must not be
garbage collected if there are any event listeners registered for
- <code title=event-open>open</code> events, <code title=event-message><a href=#event-message>message</a></code> events, <code title=event-error>error</code> events, or <code title=event-close>close</code> events.</p>
+ <code title=event-open>open</code> events, <code title=event-message><a href=#event-message>message</a></code> events<!--, <code
+ title="event-error">error</code> events-->, or <code title=event-close>close</code> events.</p>
<p>A <code><a href=#websocket>WebSocket</a></code> object whose <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code> attribute's value
was set to <code title=dom-WebSocket-OPEN><a href=#dom-websocket-open>OPEN</a></code> (1) or <code title=dom-WebSocket-CLOSING><a href=#dom-websocket-closing>CLOSING</a></code> (2) as of the last time
the <a href=#event-loop>event loop</a> started executing a <a href=#concept-task title=concept-task>task</a> 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, <code title=event-error>error</code> events, or <code title=event-close>close</code> events.</p>
+ there are any event listeners registered for <code title=event-message><a href=#event-message>message</a></code> events<!--, <code
+ title="event-error">error</code> events-->, or <code title=event-close>close</code> events.</p>
- <p>A <code><a href=#websocket>WebSocket</a></code> object with <span title="WebSocket
- connection is established">an established connection</span> that has
+ <p>A <code><a href=#websocket>WebSocket</a></code> object with <i title="the WebSocket
+ connection is established"><a href=#the-websocket-connection-is-established>an established connection</a></i> that has
data queued to be transmitted to the network must not be garbage
collected. <a href=#refsWSP>[WSP]</a></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 <span>start the
- WebSocket closing handshake</span>, with no status code<!--CLOSE
+ connection is still open, the user agent must <i><a href=#start-the-websocket-closing-handshake>start the
+ WebSocket closing handshake</a></i>, 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
@@ -79393,22 +79426,22 @@
<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>
+ <dl class=switch><dt>If the WebSocket connection is not yet <i title="the WebSocket
+ connection is established"><a href=#the-websocket-connection-is-established>established</a></i> <a href=#refsWSP>[WSP]</a></dt>
<dd>
- <p><span>Fail the WebSocket connection</span>. <a href=#refsWSP>[WSP]</a></p>
+ <p><i><a href=#fail-the-websocket-connection>Fail the WebSocket connection</a></i>. <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>
+ <dt>If the WebSocket closing handshake has not yet been <i title="the WebSocket closing handshake is started"><a href=#the-websocket-closing-handshake-is-started>started</a></i>
<a href=#refsWSP>[WSP]</a></dt>
<dd>
- <p><span>Start the WebSocket closing handshake</span>, with the
+ <p><i><a href=#start-the-websocket-closing-handshake>Start the WebSocket closing handshake</a></i>, with the
status code<!--CLOSE CODE--> to use in the WebSocket Close message
being 1001. <a href=#refsWSP>[WSP]</a></p>
Modified: index
===================================================================
--- index 2011-05-27 21:52:47 UTC (rev 6155)
+++ index 2011-05-27 23:31:52 UTC (rev 6156)
@@ -3488,11 +3488,20 @@
</dd>
+ <dt>Cookies</dt>
+
+ <dd>
+
+ <p>The following term is defined in the Cookie specification: <a href=#refsCOOKIES>[COOKIES]</a></p>
+
+ <ul class=brief><li><dfn id=receives-a-set-cookie-string>Receives a set-cookie-string</dfn>
+ </ul></dd>
+
<dt>CORS</dt>
<dd>
- <p>The following terms are defined in the CORS specification:</p>
+ <p>The following terms are defined in the CORS specification: <a href=#refsCORS>[CORS]</a></p>
<ul class=brief><li><dfn id=cross-origin-request>cross-origin request</dfn>
<li><dfn id=cross-origin-request-status>cross-origin request status</dfn>
@@ -3528,6 +3537,7 @@
</dd>
+
</dl><p>This specification does not <em>require</em> support of any
particular network protocol, style sheet language, scripting
language, or any of the DOM specifications beyond those described
@@ -9099,8 +9109,8 @@
<a href=#origin>origin</a> is not a scheme/host/port tuple, the user agent
must raise a <code><a href=#security_err>SECURITY_ERR</a></code> exception. Otherwise, the
user agent must <a href=#obtain-the-storage-mutex>obtain the storage mutex</a> and then act
- as it would when <span title="receives a
- set-cookie-string">receiving a set-cookie-string</span> for
+ as it would when <a href=#receives-a-set-cookie-string title="receives a
+ set-cookie-string">receiving a set-cookie-string</a> for
<a href="#the-document's-address">the document's address</a> via a "non-HTTP" API, consisting
of the new value encoded as UTF-8. <a href=#refsCOOKIES>[COOKIES]</a> <a href=#refsRFC3629>[RFC3629]</a></p>
@@ -14860,8 +14870,8 @@
<li><p><a href=#obtain-the-storage-mutex>Obtain the storage mutex</a>.</li>
- <li><p>Act as if <span title="receives a
- set-cookie-string">receiving a set-cookie-string</span> for
+ <li><p>Act as if <a href=#receives-a-set-cookie-string title="receives a
+ set-cookie-string">receiving a set-cookie-string</a> for
<a href="#the-document's-address">the document's address</a> via a "non-HTTP" API,
consisting of the value of the element's <code title=attr-meta-content><a href=#attr-meta-content>content</a></code> attribute encoded as
UTF-8. <a href=#refsCOOKIES>[COOKIES]</a> <a href=#refsRFC3629>[RFC3629]</a></li>
Modified: source
===================================================================
--- source 2011-05-27 21:52:47 UTC (rev 6155)
+++ source 2011-05-27 23:31:52 UTC (rev 6156)
@@ -2500,11 +2500,25 @@
</dd>
+ <dt>Cookies</dt>
+
+ <dd>
+
+ <p>The following term is defined in the Cookie specification: <a
+ href="#refsCOOKIES">[COOKIES]</a></p>
+
+ <ul class="brief">
+ <li><dfn>Receives a set-cookie-string</dfn>
+ </ul>
+
+ </dd>
+
<dt>CORS</dt>
<dd>
- <p>The following terms are defined in the CORS specification:</p>
+ <p>The following terms are defined in the CORS specification: <a
+ href="#refsCORS">[CORS]</a></p>
<ul class="brief">
<li><dfn>cross-origin request</dfn>
@@ -2545,6 +2559,42 @@
</dd>
+<!--END html--><!--END dev-html--><!--END w3c-html-->
+
+ <dt>The WebSocket protocol</dt>
+
+ <dd>
+
+ <div data-component="WebSocket API (editor: Ian Hickson)"><!--websocket-api-->
+
+ <p>The following terms are defined in the WebSocket protocol
+ specification: <a href="#refsWSP">[WSP]</a></p>
+
+ <ul class="brief">
+
+ <li><dfn>parse a WebSocket URL's components</dfn>
+ <li><dfn>establish a WebSocket connection</dfn>
+ <li><dfn>the WebSocket connection is established</dfn>
+ <li><dfn>validate the server's response</dfn>
+ <li><dfn>subprotocol in use</dfn>
+ <li><dfn>cookies set during the server's opening handshake</dfn>
+ <li><dfn>a WebSocket message has been received</dfn>
+ <li><dfn>fail the WebSocket connection</dfn>
+ <li><dfn>close the WebSocket connection</dfn>
+ <li><dfn>start the WebSocket closing handshake</dfn>
+ <li><dfn>the WebSocket closing handshake is started</dfn>
+ <li><dfn>the WebSocket connection is closed</dfn> (possibly <i title="">cleanly</i>)
+ <li><dfn>the WebSocket connection close code</dfn>
+ <li><dfn>the WebSocket connection close reason</dfn>
+
+ </ul>
+
+ </div><!--data-component-->
+
+ </dd>
+
+<!--START html--><!--START dev-html--><!--START w3c-html-->
+
</dl>
<p>This specification does not <em>require</em> support of any
@@ -89482,8 +89532,8 @@
// networking
attribute <span>Function</span> <span title="handler-WebSocket-onopen">onopen</span>;
- attribute <span>Function</span> <span title="handler-WebSocket-onerror">onerror</span>;
- attribute <span>Function</span> <span title="handler-WebSocket-onclose">onclose</span>;
+<!-- attribute <span>Function</span> <span title="handler-WebSocket-onerror">onerror</span>;
+--> attribute <span>Function</span> <span title="handler-WebSocket-onclose">onclose</span>;
readonly attribute DOMString <span title="dom-WebSocket-protocol">protocol</span>;
void <span title="dom-WebSocket-close">close</span>(in optional unsigned short code, in optional DOMString reason);
@@ -89515,12 +89565,12 @@
<ol>
- <li><p><span>Parse a WebSocket URL's components</span> from the
- <var title="">url</var> argument, to obtain <var
- title="">host</var>, <var title="">port</var>, <var
- title="">resource name</var>, and <var title="">secure</var>. If
- this fails, throw a <code>SYNTAX_ERR</code> exception and abort
- these steps. <a href="#refsWSP">[WSP]</a></p></li>
+ <li><p><i>Parse a WebSocket URL's components</i> from the <var
+ title="">url</var> argument, to obtain <var title="">host</var>,
+ <var title="">port</var>, <var title="">resource name</var>, and
+ <var title="">secure</var>. If this fails, throw a
+ <code>SYNTAX_ERR</code> exception and abort these steps. <a
+ href="#refsWSP">[WSP]</a></p></li>
<li>
@@ -89567,20 +89617,18 @@
<li>
- <p><span>Establish a WebSocket connection</span> to a host <var
- title="">host</var>, on port <var title="">port</var> (if one was
- specified), from <var title="">origin</var>, with the flag <var
- title="">secure</var>, with <var title="">resource name</var> as
- the resource name, with <var title="">protocols</var> as the
- (possibly empty) list of protocols, and with the <var
- title="">defer cookies</var> flag set. <a
+ <p><i>Establish a WebSocket connection</i> given the set (<var
+ title="">host</var>, <var title="">port</var>, <var
+ title="">resource name</var>, <var title="">secure</var>), along
+ with the <var title="">protocols</var> list and an empty list for
+ the extensions, and <var title="">origin</var>. <a
href="#refsWSP">[WSP]</a></p>
- <p>When the user agent <i>validates the server's response</i> during
- the "<span>establish a WebSocket connection</span>" algorithm, if
- the status code received from the server is not 101 (e.g. it is a
- redirect), the user agent must <span>fail the websocket
- connection</span>.</p>
+ <p>When the user agent <i title="validate the server's
+ response">validates the server's response</i> during the
+ "<i>establish a WebSocket connection</i>" algorithm, if the status
+ code received from the server is not 101 (e.g. it is a redirect),
+ the user agent must <i>fail the websocket connection</i>.</p>
<p class="warning">Following HTTP procedures here could introduce
serious security problems in a Web browser context. For example,
@@ -89591,12 +89639,11 @@
even if the script checks that the URL has the right hostname.</p>
<!-- http://www.ietf.org/mail-archive/web/hybi/current/msg06951.html -->
- <p class="note">If the "<span>establish a WebSocket
- connection</span>" algorithm fails, it triggers the "<span>fail
- the WebSocket connection</span>" algorithm, which then invokes
- the "<span>close the WebSocket connection</span>" algorithm,
- which then establishes that the "<span>WebSocket connection is
- closed</span>", which fires the <code
+ <p class="note">If the <i>establish a WebSocket connection</i>
+ algorithm fails, it triggers the <i>fail the WebSocket
+ connection</i> algorithm, which then invokes the <i>close the
+ WebSocket connection</i> algorithm, which then establishes that
+ <i>the WebSocket connection is closed</i>, which fires the <code
title="event-close">close</code> event <a
href="#closeWebSocket">as described below</a>.</p>
@@ -89629,7 +89676,7 @@
<dt><dfn title="dom-WebSocket-OPEN"><code>OPEN</code></dfn> (numeric value 1)</dt>
- <dd>The <span>WebSocket connection is established</span> and communication is possible.</dd>
+ <dd><i>The WebSocket connection is established</i> and communication is possible.</dd>
<dt><dfn title="dom-WebSocket-CLOSING"><code>CLOSING</code></dfn> (numeric value 2)</dt>
@@ -89647,8 +89694,8 @@
<p>The <dfn
title="dom-WebSocket-protocol"><code>protocol</code></dfn> attribute
- must initially return the empty string. After the <span>WebSocket
- connection is established</span>, its value might change, as defined
+ must initially return the empty string. After <i>the WebSocket
+ connection is established</i>, its value might change, as defined
below.</p>
<p class="note">The <code
@@ -89688,34 +89735,34 @@
</dd>
- <dt>If the WebSocket connection is not yet <span title="WebSocket
- connection is established">established</span> <a
+ <dt>If the WebSocket connection is not yet <i title="the
+ WebSocket connection is established">established</i> <a
href="#refsWSP">[WSP]</a></dt>
<dd>
- <p><span>Fail the WebSocket connection</span> and set the <code
+ <p><i>Fail the WebSocket connection</i> and set the <code
title="dom-WebSocket-readyState">readyState</code> attribute's
value to <code title="dom-WebSocket-CLOSING">CLOSING</code> (2).
<a href="#refsWSP">[WSP]</a></p>
- <p class="note">The "<span>fail the WebSocket connection</span>"
- algorithm invokes the "<span>close the WebSocket
- connection</span>" algorithm, which then establishes that the
- "<span>WebSocket connection is closed</span>", which fires the
+ <p class="note">The <i>fail the WebSocket connection</i>
+ algorithm invokes the <i>close the WebSocket
+ connection</i> algorithm, which then establishes that
+ <i>the WebSocket connection is closed</i>, which fires the
<code title="event-close">close</code> event <a
href="#closeWebSocket">as described below</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>
+ <dt>If the WebSocket closing handshake has not yet been <i
+ title="the WebSocket closing handshake is
+ started">started</i> <a href="#refsWSP">[WSP]</a></dt>
<dd>
- <p><span>Start the WebSocket closing handshake</span> and set the
+ <p><i>Start the WebSocket closing handshake</i> and set the
<code title="dom-WebSocket-readyState">readyState</code>
attribute's value to <code
title="dom-WebSocket-CLOSING">CLOSING</code> (2). <a
@@ -89728,13 +89775,14 @@
<p>If the second argument is also present, then it must be
encoded as UTF-8 and provided in the Close message after the
- status code<!--CLOSE CODE-->. <a href="#refsWSP">[WSP]</a></p>
+ status code<!--CLOSE CODE-->. <a
+ href="#refsRFC3629">[RFC3629]</a> <a href="#refsWSP">[WSP]</a></p>
- <p class="note">The "<span>start the WebSocket closing
- handshake</span>" algorithm eventually invokes the "<span>close
- the WebSocket connection</span>" algorithm, which then establishes
- that the "<span>WebSocket connection is closed</span>", which
- fires the <code title="event-close">close</code> event <a
+ <p class="note">The <i>start the WebSocket closing handshake</i>
+ algorithm eventually invokes the <i>close the WebSocket
+ connection</i> algorithm, which then establishes that <i>the
+ WebSocket connection is closed</i>, which fires the <code
+ title="event-close">close</code> event <a
href="#closeWebSocket">as described below</a>.</p>
</dd>
@@ -89749,11 +89797,11 @@
value to <code title="dom-WebSocket-CLOSING">CLOSING</code>
(2).</p>
- <p class="note"><span>The WebSocket closing handshake has
- started</span>, and will eventually invokethe "<span>close the
- WebSocket connection</span>" algorithm, which will establish that
- the "<span>WebSocket connection is closed</span>", and thus the
- <code title="event-close">close</code> event will fire, <a
+ <p class="note"><i>The WebSocket closing handshake is
+ started</i>, and will eventually invoke the <i>close the
+ WebSocket connection</i> algorithm, which will establish that
+ <i>the WebSocket connection is closed</i>, and thus the <code
+ title="event-close">close</code> event will fire, <a
href="#closeWebSocket">as described below</a>.</p>
</dd>
@@ -89768,19 +89816,19 @@
<p>The <dfn
title="dom-WebSocket-bufferedAmount"><code>bufferedAmount</code></dfn>
- attribute must return the number of bytes of UTF-8 text that have
- been queued using <code title="dom-WebSocket-send">send()</code> but
- that, as of the last time the <span>event loop</span> started
- executing a <span title="concept-task">task</span>, had not yet been
- transmitted to the network. (This thus includes any text sent during
- the execution of the current task, regardless of whether the user
- agent is able to transmit text asynchronously with script
- execution.) This does not include framing overhead incurred by the
- protocol, or buffering done by the operating system or network
- hardware. If the connection is closed, this attribute's value will
- only increase with each call to the <code
- title="dom-WebSocket-send">send()</code> method (the number does not
- reset to zero once the connection closes).</p>
+ attribute must return the number of bytes of application data (UTF-8
+ text and binary data) that have been queued using <code
+ title="dom-WebSocket-send">send()</code> but that, as of the last
+ time the <span>event loop</span> started executing a <span
+ title="concept-task">task</span>, had not yet been transmitted to
+ the network. (This thus includes any text sent during the execution
+ of the current task, regardless of whether the user agent is able to
+ transmit text asynchronously with script execution.) This does not
+ include framing overhead incurred by the protocol, or buffering done
+ by the operating system or network hardware. If the connection is
+ closed, this attribute's value will only increase with each call to
+ the <code title="dom-WebSocket-send">send()</code> method (the
+ number does not reset to zero once the connection closes).</p>
<div class="example">
@@ -89857,19 +89905,20 @@
<p>If the <var title="">data</var> argument has any unpaired
surrogates, then raise an <code>SYNTAX_ERR</code> exception. If
- the connection is established, and the string has no unpaired
- surrogates, and <span title="the WebSocket closing handshake has
- started">the WebSocket closing handshake has not yet
- started</span>, then the user agent must <span>send <var
- title="">data</var> using the WebSocket</span> using a text frame
- opcode; if the data cannot be sent, e.g. because it would need to
- be buffered but the buffer is full, the user agent must
- <span>close the WebSocket connection</span>. Any invokation of
- this method with a string argument that does not raise an
- exception must increase the <code
+ <i>the WebSocket connection is established</i>, and the
+ string has no unpaired surrogates, and <i title="the WebSocket
+ closing handshake is started">the WebSocket closing handshake has
+ not yet started</i>, then the user agent must <i>send a WebSocket
+ Message</i> comprised of <var title="">data</var> using a text
+ frame opcode; if the data cannot be sent, e.g. because it would
+ need to be buffered but the buffer is full, the user agent must
+ <i>close the WebSocket connection</i>. Any invokation of this
+ method with a string argument that does not raise an exception
+ must increase the <code
title="dom-WebSocket-bufferedAmount">bufferedAmount</code>
attribute by the number of bytes needed to express the argument as
- UTF-8. <a href="#refsWSP">[WSP]</a></p>
+ UTF-8. <a href="#refsRFC3629">[RFC3629]</a> <a
+ href="#refsWSP">[WSP]</a></p>
</dd>
@@ -89878,18 +89927,18 @@
<dd>
- <p>If the connection is established, and <span title="The
- WebSocket Closing Handshake is Started">the WebSocket closing
- handshake has not yet started</span>, then the user agent must
- <span>send <var title="">data</var> using the WebSocket</span>
- using a binary frame opcode; if the data cannot be sent, e.g.
- because it would need to be buffered but the buffer is full, the
- user agent must <span>close the WebSocket connection</span>. The
- data to be sent is the raw data represented by the
- <code>Blob</code> object. <!-- that sentence is meant to invoke
- "This interface represents immutable raw data." --> Any invokation
- of this method with a <code>Blob</code> argument that does not
- raise an exception must increase the <code
+ <p>If <i>the WebSocket connection is established</i>, and <i
+ title="the WebSocket closing handshake is started">the WebSocket
+ closing handshake has not yet started</i>, then the user agent
+ must <i>send a WebSocket Message</i> comprised of <var
+ title="">data</var> using a binary frame opcode; if the data
+ cannot be sent, e.g. because it would need to be buffered but the
+ buffer is full, the user agent must <i>close the WebSocket
+ connection</i>. The data to be sent is the raw data represented by
+ the <code>Blob</code> object. <!-- that sentence is meant to
+ invoke "This interface represents immutable raw data." --> Any
+ invokation of this method with a <code>Blob</code> argument that
+ does not raise an exception must increase the <code
title="dom-WebSocket-bufferedAmount">bufferedAmount</code>
attribute by the size of the <code>Blob</code> object's raw data,
in bytes. <!-- that sentence is meant to invoke the same as
@@ -89903,19 +89952,20 @@
<dd>
- <p>If the connection is established, and <span title="The
- WebSocket Closing Handshake is Started">the WebSocket closing
- handshake has not yet started</span>, then the user agent must
- <span>send <var title="">data</var> using the WebSocket</span>
- using a binary frame opcode; if the data cannot be sent, e.g.
- because it would need to be buffered but the buffer is full, the
- user agent must <span>close the WebSocket connection</span>. The
- data to be sent is the data stored in the buffer described by the
- <code>ArrayBuffer</code> object. <!-- that sentence is meant to
- invoke "The ArrayBuffer type describes a buffer used to store data
- for the array buffer views." at the top of the Typed Array spec
- --> Any invokation of this method with an <code>ArrayBuffer</code>
- argument that does not raise an exception must increase the <code
+ <p>If <i>the WebSocket connection is established</i>, and <i
+ title="the WebSocket closing handshake is started">the WebSocket
+ closing handshake has not yet started</i>, then the user agent
+ must <i>send a WebSocket Message</i> comprised of <var
+ title="">data</var> using a binary frame opcode; if the data
+ cannot be sent, e.g. because it would need to be buffered but the
+ buffer is full, the user agent must <i>close the WebSocket
+ connection</i>. The data to be sent is the data stored in the
+ buffer described by the <code>ArrayBuffer</code> object. <!-- that
+ sentence is meant to invoke "The ArrayBuffer type describes a
+ buffer used to store data for the array buffer views." at the top
+ of the Typed Array spec --> Any invokation of this method with an
+ <code>ArrayBuffer</code> argument that does not raise an exception
+ must increase the <code
title="dom-WebSocket-bufferedAmount">bufferedAmount</code>
attribute by the length of the <code>ArrayBuffer</code> in bytes.
<!-- that sentence is meant to invoke the same as
@@ -89938,7 +89988,7 @@
<tbody>
<tr><td><dfn title="handler-WebSocket-onopen"><code>onopen</code></dfn> <td> <code title="event-open">open</code>
<tr><td><dfn title="handler-WebSocket-onmessage"><code>onmessage</code></dfn> <td> <code title="event-message">message</code>
- <tr><td><dfn title="handler-WebSocket-onerror"><code>onerror</code></dfn> <td> <code title="event-error">error</code>
+<!-- <tr><td><dfn title="handler-WebSocket-onerror"><code>onerror</code></dfn> <td> <code title="event-error">error</code>-->
<tr><td><dfn title="handler-WebSocket-onclose"><code>onclose</code></dfn> <td> <code title="event-close">close</code>
</table>
@@ -89946,32 +89996,36 @@
<h4>Feedback from the protocol</h4>
- <p>When the <i>WebSocket connection is established</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-OPEN">OPEN</code> (1); <span>apply the
- cookies</span>
-<!--
-Once we have the cookies back:
+ <p>When <i>the WebSocket connection is established</i>, the user
+ agent must <span>queue a task</span> to run these steps:</p>
- <li><p>Act as if <span title="receives a
- set-cookie-string">receiving a set-cookie-string</span> for
- <span>the document's address</span>,
- consisting of the value of the element's <code
- title="attr-meta-content">content</code> attribute encoded as
- UTF-8. <a href="#refsCOOKIES">[COOKIES]</a> <a
- href="#refsRFC3629">[RFC3629]</a></p></li>
+ <ol>
--->
- that were collected in the <var title="">list of
- cookies</var> when the <span title="WebSocket connection is
- established">connection was established</span>; change the <code
- title="dom-WebSocket-protocol">protocol</code> attribute's value to
- the <span>selected WebSocket subprotocol</span>, if there is one;
- and then <span>fire a simple event</span> named <code
- title="event-open">open</code> at the <code>WebSocket</code> object.
- <a href="#refsWSP">[WSP]</a></p>
+ <li><p>Change the <code
+ title="dom-WebSocket-readyState">readyState</code> attribute's
+ value to <code title="dom-WebSocket-OPEN">OPEN</code> (1).</p></li>
+ <li><p>Change the <code
+ title="dom-WebSocket-protocol">protocol</code> attribute's value to
+ the <i>subprotocol in use</i>, if is not the null value. <a
+ href="#refsWSP">[WSP]</a></p></li>
+
+ <li><p>Act as if the user agent had <span title="receives a
+ set-cookie-string">received a set-cookie-string</span> for
+ <span>the document's address</span>, consisting of the <i>cookies
+ set during the server's opening handshake</i>. <a
+ href="#refsCOOKIES">[COOKIES]</a> <a
+ href="#refsRFC3629">[RFC3629]</a> <a
+ href="#refsWSP">[WSP]</a></p></li>
+
+ <li><p><span>Fire a simple event</span> named <code
+ title="event-open">open</code> at the <code>WebSocket</code>
+ object.</p>
+
+ </ol>
+
+ <hr>
+
<p>When <i>a WebSocket message has been received</i> with type <var
title="">type</var> and data <var title="">data</var>, the user
agent must <span>queue a task</span> to follow these steps: <a
@@ -90047,6 +90101,8 @@
title="concept-task">task</span> so as to avoid stalling the main
thread while it created the <code>ArrayBuffer</code> object.</p>
+ <hr>
+<!--
<p>When <i>a WebSocket error has been detected</i>, the user agent
must <span>queue a task</span> to check to see if the <code
title="dom-WebSocket-readyState">readyState</code> attribute's value
@@ -90055,8 +90111,8 @@
<span>fire a simple event</span> named <code
title="event-error">error</code> at the <code>WebSocket</code>
object. <a href="#refsWSP">[WSP]</a></p>
-
- <p>When <i>the WebSocket closing handshake has started</i>, the user
+-->
+ <p>When <i>the WebSocket closing handshake is started</i>, the user
agent must <span>queue a task</span> to change the <code
title="dom-WebSocket-readyState">readyState</code> attribute's value
to <code title="dom-WebSocket-CLOSING">CLOSING</code> (2). (If the
@@ -90066,7 +90122,7 @@
title="dom-WebSocket-CLOSING">CLOSING</code> (2) when this task
runs.) <a href="#refsWSP">[WSP]</a></p>
- <p id="closeWebSocket">When the <i>WebSocket connection is
+ <p id="closeWebSocket">When <i>the WebSocket connection is
closed</i>, possibly <i title="">cleanly</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
@@ -90074,9 +90130,9 @@
<code title="dom-CloseEvent-wasClean">wasClean</code> attribute is
set to true if the connection closed <i title="">cleanly</i> and
false otherwise, whose <code title="dom-CloseEvent-code">code</code>
- attribute is set to the <i>WebSocket connection close code</i>, and
+ attribute is set to <i>the WebSocket connection close code</i>, and
whose <code title="dom-CloseEvent-reason">reason</code> attribute is
- set to the <i>WebSocket connection close reason</i>; and <span>queue
+ set to <i>the WebSocket connection close reason</i>; 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> (3), and then
@@ -90129,8 +90185,8 @@
executing a <span title="concept-task">task</span> must not be
garbage collected if there are any event listeners registered for
<code title="event-open">open</code> events, <code
- title="event-message">message</code> events, <code
- title="event-error">error</code> events, or <code
+ title="event-message">message</code> events<!--, <code
+ title="event-error">error</code> events-->, or <code
title="event-close">close</code> events.</p>
<p>A <code>WebSocket</code> object whose <code
@@ -90140,18 +90196,18 @@
the <span>event loop</span> started executing a <span
title="concept-task">task</span> must not be garbage collected if
there are any event listeners registered for <code
- title="event-message">message</code> events, <code
- title="event-error">error</code> events, or <code
+ title="event-message">message</code> events<!--, <code
+ title="event-error">error</code> events-->, or <code
title="event-close">close</code> events.</p>
- <p>A <code>WebSocket</code> object with <span title="WebSocket
- connection is established">an established connection</span> that has
+ <p>A <code>WebSocket</code> object with <i title="the WebSocket
+ connection is established">an established connection</i> that has
data queued to be transmitted to the network must not be garbage
collected. <a href="#refsWSP">[WSP]</a></p>
<p>If a <code>WebSocket</code> object is garbage collected while its
- connection is still open, the user agent must <span>start the
- WebSocket closing handshake</span>, with no status code<!--CLOSE
+ connection is still open, the user agent must <i>start the
+ WebSocket closing handshake</i>, with no status code<!--CLOSE
CODE--> for the Close message. <a href="#refsWSP">[WSP]</a></p>
<hr>
@@ -90163,25 +90219,25 @@
<dl class="switch">
- <dt>If the WebSocket connection is not yet <span title="WebSocket
- connection is established">established</span> <a
+ <dt>If the WebSocket connection is not yet <i title="the WebSocket
+ connection is established">established</i> <a
href="#refsWSP">[WSP]</a></dt>
<dd>
- <p><span>Fail the WebSocket connection</span>. <a
+ <p><i>Fail the WebSocket connection</i>. <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>
+ <dt>If the WebSocket closing handshake has not yet been <i
+ title="the WebSocket closing handshake is started">started</i>
<a href="#refsWSP">[WSP]</a></dt>
<dd>
- <p><span>Start the WebSocket closing handshake</span>, with the
+ <p><i>Start the WebSocket closing handshake</i>, with the
status code<!--CLOSE CODE--> to use in the WebSocket Close message
being 1001. <a href="#refsWSP">[WSP]</a></p>
More information about the Commit-Watchers
mailing list