Skip to content

Commit

Permalink
[e] (0) Clarify that close() doesn't drop earlier sent() images.
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=24824
Affected topics: HTML, WebSocket API

git-svn-id: http://svn.whatwg.org/webapps@8516 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 28, 2014
1 parent a45a601 commit e697e58
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
19 changes: 13 additions & 6 deletions complete.html
Expand Up @@ -298,7 +298,7 @@

<header class=head id=head><p><a href=http://www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 27 February 2014</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 28 February 2014</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -4016,6 +4016,7 @@ <h4 id=dependencies><span class=secno>2.2.2 </span>Dependencies</h4>
<li><dfn id=headers-to-send-appropriate-cookies>headers to send appropriate cookies</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=send-a-websocket-message>send a WebSocket Message</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>
Expand Down Expand Up @@ -81392,7 +81393,13 @@ <h4 id=the-websocket-interface><span class=secno>9.3.2 </span>The <code><a href=

</dl></li>

</ol><hr><!--CLEANUP--><p>The <dfn id=dom-websocket-bufferedamount title=dom-WebSocket-bufferedAmount><code>bufferedAmount</code></dfn> attribute must
</ol><p class=note>The <code title=dom-WebSocket-close><a href=#dom-websocket-close>close()</a></code> method does not discard
previously sent messages before starting the WebSocket closing handshake &mdash; even if, in
practice, the user agent is still busy sending those messages, the handshake will only start after
the messages are sent.</p> <!-- this is trivially true in this spec, because we don't buffer at
all. We just tell the WebSocket API spec to do it. -->

<hr><!--CLEANUP--><p>The <dfn id=dom-websocket-bufferedamount title=dom-WebSocket-bufferedAmount><code>bufferedAmount</code></dfn> 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> reached step 1, had not yet been
Expand Down Expand Up @@ -81452,7 +81459,7 @@ <h4 id=the-websocket-interface><span class=secno>9.3.2 </span>The <code><a href=
<p>Let <var title="">data</var> be the result of <a href=#convert-a-domstring-to-a-sequence-of-unicode-characters title="convert a DOMString to a
sequence of Unicode characters">converting the <var title="">data</var> argument to a sequence
of Unicode characters</a>. 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 text frame opcode; if the data cannot be sent, e.g. because it
started</a></i>, then the user agent must <i><a href=#send-a-websocket-message>send a WebSocket Message</a></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 <a href=#concept-websocket-close-fail title=concept-websocket-close-fail>flag the WebSocket as full</a> and then <i><a href=#close-the-websocket-connection>close the
WebSocket connection</a></i>. Any invocation of this method with a string argument that does not
throw an exception must increase the <code title=dom-WebSocket-bufferedAmount><a href=#dom-websocket-bufferedamount>bufferedAmount</a></code> attribute by the number of bytes
Expand All @@ -81467,7 +81474,7 @@ <h4 id=the-websocket-interface><span class=secno>9.3.2 </span>The <code><a href=

<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
agent must <i><a href=#send-a-websocket-message>send a WebSocket Message</a></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 <a href=#concept-websocket-close-fail title=concept-websocket-close-fail>flag the
WebSocket as full</a> and then <i><a href=#close-the-websocket-connection>close the WebSocket connection</a></i>. The data to be sent is
Expand All @@ -81487,7 +81494,7 @@ <h4 id=the-websocket-interface><span class=secno>9.3.2 </span>The <code><a href=
<!--CLEANUP-->
<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
agent must <i><a href=#send-a-websocket-message>send a WebSocket Message</a></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 <a href=#concept-websocket-close-fail title=concept-websocket-close-fail>flag the
WebSocket as full</a> and then <i><a href=#close-the-websocket-connection>close the WebSocket connection</a></i>. The data to be sent is
Expand All @@ -81505,7 +81512,7 @@ <h4 id=the-websocket-interface><span class=secno>9.3.2 </span>The <code><a href=
<!--CLEANUP-->
<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
agent must <i><a href=#send-a-websocket-message>send a WebSocket Message</a></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 <a href=#concept-websocket-close-fail title=concept-websocket-close-fail>flag the
WebSocket as full</a> and then <i><a href=#close-the-websocket-connection>close the WebSocket connection</a></i>. The data to be sent is
Expand Down
19 changes: 13 additions & 6 deletions index
Expand Up @@ -298,7 +298,7 @@

<header class=head id=head><p><a href=http://www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 27 February 2014</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 28 February 2014</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -4016,6 +4016,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li><dfn id=headers-to-send-appropriate-cookies>headers to send appropriate cookies</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=send-a-websocket-message>send a WebSocket Message</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>
Expand Down Expand Up @@ -81392,7 +81393,13 @@ interface <dfn id=websocket>WebSocket</dfn> : <a href=#eventtarget>EventTarget</

</dl></li>

</ol><hr><!--CLEANUP--><p>The <dfn id=dom-websocket-bufferedamount title=dom-WebSocket-bufferedAmount><code>bufferedAmount</code></dfn> attribute must
</ol><p class=note>The <code title=dom-WebSocket-close><a href=#dom-websocket-close>close()</a></code> method does not discard
previously sent messages before starting the WebSocket closing handshake &mdash; even if, in
practice, the user agent is still busy sending those messages, the handshake will only start after
the messages are sent.</p> <!-- this is trivially true in this spec, because we don't buffer at
all. We just tell the WebSocket API spec to do it. -->

<hr><!--CLEANUP--><p>The <dfn id=dom-websocket-bufferedamount title=dom-WebSocket-bufferedAmount><code>bufferedAmount</code></dfn> 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> reached step 1, had not yet been
Expand Down Expand Up @@ -81452,7 +81459,7 @@ socket.onopen = function () {
<p>Let <var title="">data</var> be the result of <a href=#convert-a-domstring-to-a-sequence-of-unicode-characters title="convert a DOMString to a
sequence of Unicode characters">converting the <var title="">data</var> argument to a sequence
of Unicode characters</a>. 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 text frame opcode; if the data cannot be sent, e.g. because it
started</a></i>, then the user agent must <i><a href=#send-a-websocket-message>send a WebSocket Message</a></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 <a href=#concept-websocket-close-fail title=concept-websocket-close-fail>flag the WebSocket as full</a> and then <i><a href=#close-the-websocket-connection>close the
WebSocket connection</a></i>. Any invocation of this method with a string argument that does not
throw an exception must increase the <code title=dom-WebSocket-bufferedAmount><a href=#dom-websocket-bufferedamount>bufferedAmount</a></code> attribute by the number of bytes
Expand All @@ -81467,7 +81474,7 @@ socket.onopen = function () {

<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
agent must <i><a href=#send-a-websocket-message>send a WebSocket Message</a></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 <a href=#concept-websocket-close-fail title=concept-websocket-close-fail>flag the
WebSocket as full</a> and then <i><a href=#close-the-websocket-connection>close the WebSocket connection</a></i>. The data to be sent is
Expand All @@ -81487,7 +81494,7 @@ socket.onopen = function () {
<!--CLEANUP-->
<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
agent must <i><a href=#send-a-websocket-message>send a WebSocket Message</a></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 <a href=#concept-websocket-close-fail title=concept-websocket-close-fail>flag the
WebSocket as full</a> and then <i><a href=#close-the-websocket-connection>close the WebSocket connection</a></i>. The data to be sent is
Expand All @@ -81505,7 +81512,7 @@ socket.onopen = function () {
<!--CLEANUP-->
<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
agent must <i><a href=#send-a-websocket-message>send a WebSocket Message</a></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 <a href=#concept-websocket-close-fail title=concept-websocket-close-fail>flag the
WebSocket as full</a> and then <i><a href=#close-the-websocket-connection>close the WebSocket connection</a></i>. The data to be sent is
Expand Down
7 changes: 7 additions & 0 deletions source
Expand Up @@ -2786,6 +2786,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li><dfn>headers to send appropriate cookies</dfn>
<li><dfn>cookies set during the server's opening handshake</dfn>
<li><dfn>a WebSocket message has been received</dfn>
<li><dfn>send a WebSocket Message</dfn>
<li><dfn>fail the WebSocket connection</dfn>
<li><dfn>close the WebSocket connection</dfn>
<li><dfn>start the WebSocket closing handshake</dfn>
Expand Down Expand Up @@ -91283,6 +91284,12 @@ interface <dfn>WebSocket</dfn> : <span>EventTarget</span> {

</ol>

<p class="note">The <code data-x="dom-WebSocket-close">close()</code> method does not discard
previously sent messages before starting the WebSocket closing handshake &mdash; even if, in
practice, the user agent is still busy sending those messages, the handshake will only start after
the messages are sent.</p> <!-- this is trivially true in this spec, because we don't buffer at
all. We just tell the WebSocket API spec to do it. -->

<hr>

<!--CLEANUP-->
Expand Down

0 comments on commit e697e58

Please sign in to comment.