Skip to content

Commit

Permalink
[giow] (0) WebSockets: add reason and code to the event; also some mi…
Browse files Browse the repository at this point in the history
…nor editorial things. More WebSockets changes coming.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=12102

git-svn-id: http://svn.whatwg.org/webapps@5963 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Mar 24, 2011
1 parent ad9ad3e commit 54c90b1
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 18 deletions.
44 changes: 35 additions & 9 deletions complete.html
Expand Up @@ -239,7 +239,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>Web Applications 1.0</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 21 March 2011</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 24 March 2011</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
Expand Down Expand Up @@ -73430,7 +73430,7 @@ <h3 id=event-definitions-0><span class=secno>9.7 </span>Event definitions</h3>

<pre class=idl>interface <dfn id=streamevent>StreamEvent</dfn> : <a href=#event>Event</a> {
readonly attribute <a href=#stream>Stream</a> <a href=#dom-streamevent-stream title=dom-StreamEvent-stream>stream</a>;
void <a href=#dom-closeevent-initcloseevent title=dom-CloseEvent-initCloseEvent>initCloseEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in <a href=#stream>Stream</a> streamArg);
void <a href=#dom-streamevent-initstreamevent title=dom-StreamEvent-initStreamEvent>initStreamEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in <a href=#stream>Stream</a> streamArg);
};</pre>

<div class=impl>
Expand Down Expand Up @@ -76836,7 +76836,20 @@ <h4 id=the-websocket-interface><span class=secno>11.3.2 </span>The <code><a href
<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> that were collected in the <var title="">list of
cookies</span>
<!--
Once we have the cookies back:

<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>

-->
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;
Expand Down Expand Up @@ -76869,13 +76882,16 @@ <h4 id=the-websocket-interface><span class=secno>11.3.2 </span>The <code><a href
closed</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, and whose
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; 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>
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
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
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>

<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
task">queued</a> in this section is the <dfn id=websocket-task-source>WebSocket task
Expand All @@ -76886,7 +76902,9 @@ <h5 id=event-definitions-2><span class=secno>11.3.3.1 </span>Event definitions</

<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);
readonly attribute unsigned long <span title=dom-WebSocket-code>code</span>;
readonly attribute DOMString <span title=dom-WebSocket-reason>reason</span>;
void <a href=#dom-closeevent-initcloseevent title=dom-CloseEvent-initCloseEvent>initCloseEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in boolean wasCleanArg, in unsigned long codeArg, in unsigned long reasonArg);
};</pre>

<p>The <dfn id=dom-closeevent-initcloseevent title=dom-CloseEvent-initCloseEvent><code>initCloseEvent()</code></dfn>
Expand All @@ -76897,6 +76915,14 @@ <h5 id=event-definitions-2><span class=secno>11.3.3.1 </span>Event definitions</
attribute represents whether the connection closed cleanly or
not.</p>

<p>The <dfn id=dom-closeevent-code title=dom-CloseEvent-code><code>code</code></dfn>
attribute represents the WebSocket connection close code provided by
the server.</p>

<p>The <dfn id=dom-closeevent-reason title=dom-CloseEvent-reason><code>reason</code></dfn>
attribute represents the WebSocket connection close reason provided
by the server.</p>



<h5 id=garbage-collection-1><span class=secno>11.3.3.2 </span>Garbage collection</h5>
Expand Down
2 changes: 1 addition & 1 deletion index
Expand Up @@ -73436,7 +73436,7 @@ local.onaddstream = function (event) {

<pre class=idl>interface <dfn id=streamevent>StreamEvent</dfn> : <a href=#event>Event</a> {
readonly attribute <a href=#stream>Stream</a> <a href=#dom-streamevent-stream title=dom-StreamEvent-stream>stream</a>;
void <span title=dom-CloseEvent-initCloseEvent>initCloseEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in <a href=#stream>Stream</a> streamArg);
void <a href=#dom-streamevent-initstreamevent title=dom-StreamEvent-initStreamEvent>initStreamEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in <a href=#stream>Stream</a> streamArg);
};</pre>

<div class=impl>
Expand Down
44 changes: 36 additions & 8 deletions source
Expand Up @@ -83779,7 +83779,7 @@ local.onaddstream = function (event) {

<pre class="idl">interface <dfn>StreamEvent</dfn> : <span>Event</span> {
readonly attribute <span>Stream</span> <span title="dom-StreamEvent-stream">stream</span>;
void <span title="dom-CloseEvent-initCloseEvent">initCloseEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in <span>Stream</span> streamArg);
void <span title="dom-StreamEvent-initStreamEvent">initStreamEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in <span>Stream</span> streamArg);
};</pre>

<div class="impl">
Expand Down Expand Up @@ -86988,7 +86988,20 @@ socket.onopen = function () {
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> that were collected in the <var title="">list of
cookies</span>
<!--
Once we have the cookies back:

<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>

-->
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
Expand Down Expand Up @@ -87033,13 +87046,17 @@ socket.onopen = function () {
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
does not bubble, is not cancelable, has no default action, and whose
does not bubble, is not cancelable, has no default action, whose
<code title="dom-CloseEvent-wasClean">wasClean</code> attribute is
set to true if the connection closed <i title="">cleanly</i> and
false otherwise; 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 dispatch the event at the <code>WebSocket</code> object. <a
false otherwise, whose <code title="dom-CloseEvent-code">code</code>
attribute is set to the <i>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
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
dispatch the event at the <code>WebSocket</code> object. <a
href="#refsWSP">[WSP]</a></p>

<p>The <span>task source</span> for all <span
Expand All @@ -87052,7 +87069,9 @@ socket.onopen = function () {

<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);
readonly attribute unsigned long <span title="dom-WebSocket-code">code</span>;
readonly attribute DOMString <span title="dom-WebSocket-reason">reason</span>;
void <span title="dom-CloseEvent-initCloseEvent">initCloseEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in boolean wasCleanArg, in unsigned long codeArg, in unsigned long reasonArg);
};</pre>

<p>The <dfn
Expand All @@ -87066,6 +87085,15 @@ socket.onopen = function () {
attribute represents whether the connection closed cleanly or
not.</p>

<p>The <dfn title="dom-CloseEvent-code"><code>code</code></dfn>
attribute represents the WebSocket connection close code provided by
the server.</p>

<p>The <dfn
title="dom-CloseEvent-reason"><code>reason</code></dfn>
attribute represents the WebSocket connection close reason provided
by the server.</p>



<h5>Garbage collection</h5>
Expand Down

0 comments on commit 54c90b1

Please sign in to comment.