Skip to content

Commit

Permalink
[e] (0) Switch to using USVString where that makes the prose simpler.…
Browse files Browse the repository at this point in the history
… (WebSocket, primarily)

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=26967
Affected topics: DOM APIs

git-svn-id: https://svn.whatwg.org/webapps@8836 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 11, 2014
1 parent bf207db commit 6df9c71
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 28 deletions.
14 changes: 6 additions & 8 deletions complete.html
Expand Up @@ -2350,7 +2350,6 @@ <h4 id=dependencies>2.2.2 Dependencies</h4>
<li><dfn id=platform-array-objects>Platform array objects</dfn>
<li><dfn id=dfn-read-only-array>Read only</dfn> (when applied to arrays)
<li><dfn id=dfn-callback-this-value>Callback this value</dfn>
<li><dfn id=convert-a-domstring-to-a-sequence-of-unicode-characters>Convert a <code>DOMString</code> to a sequence of Unicode characters</dfn>
<li><dfn id=concept-idl-convert><a href=http://heycam.github.io/webidl/#es-type-mapping>Converting</a></dfn> between WebIDL types and JS types
</ul>

Expand All @@ -2362,6 +2361,7 @@ <h4 id=dependencies>2.2.2 Dependencies</h4>
<li><dfn id=idl-boolean-wrapper><code>Boolean</code></dfn>
<li><dfn id=idl-date><code>Date</code></dfn>
<li><dfn id=idl-domstring><code>DOMString</code></dfn>
<li><dfn id=idl-usvstring><code>USVString</code></dfn>
<li><dfn id=idl-double><code>double</code></dfn>
<li><dfn id=idl-error><code>Error</code></dfn>
<li><dfn id=idl-function><code>Function</code></dfn>
Expand Down Expand Up @@ -67082,12 +67082,12 @@ <h4 id=the-websocket-interface>9.3.2 The <code id=the-websocket-interface:websoc
attribute <a href=#eventhandler id=the-websocket-interface:eventhandler-3>EventHandler</a> <a href=#handler-websocket-onclose id=the-websocket-interface:handler-websocket-onclose>onclose</a>;
readonly attribute DOMString <a href=#dom-websocket-extensions id=the-websocket-interface:dom-websocket-extensions>extensions</a>;
readonly attribute DOMString <a href=#dom-websocket-protocol id=the-websocket-interface:dom-websocket-protocol>protocol</a>;
void <a href=#dom-websocket-close id=the-websocket-interface:dom-websocket-close>close</a>([Clamp] optional unsigned short code, optional DOMString reason);
void <a href=#dom-websocket-close id=the-websocket-interface:dom-websocket-close>close</a>([Clamp] optional unsigned short code, optional <a href=#idl-usvstring id=the-websocket-interface:idl-usvstring>USVString</a> reason);

// messaging
attribute <a href=#eventhandler id=the-websocket-interface:eventhandler-4>EventHandler</a> <a href=#handler-websocket-onmessage id=the-websocket-interface:handler-websocket-onmessage>onmessage</a>;
attribute <a href=#binarytype id=the-websocket-interface:binarytype>BinaryType</a> <a href=#dom-websocket-binarytype id=the-websocket-interface:dom-websocket-binarytype>binaryType</a>;
void <a href=#dom-websocket-send id=the-websocket-interface:dom-websocket-send>send</a>(DOMString data);
void <a href=#dom-websocket-send id=the-websocket-interface:dom-websocket-send>send</a>(<a href=#idl-usvstring id=the-websocket-interface:idl-usvstring-2>USVString</a> data);
void <a href=#dom-websocket-send id=the-websocket-interface:dom-websocket-send-2>send</a>(<a href=#blob id=the-websocket-interface:blob>Blob</a> data);
void <a href=#dom-websocket-send id=the-websocket-interface:dom-websocket-send-3>send</a>(<a href=#arraybuffer id=the-websocket-interface:arraybuffer>ArrayBuffer</a> data);
void <a href=#dom-websocket-send id=the-websocket-interface:dom-websocket-send-4>send</a>(<a href=#arraybufferview id=the-websocket-interface:arraybufferview>ArrayBufferView</a> data);
Expand Down Expand Up @@ -67210,8 +67210,7 @@ <h4 id=the-websocket-interface>9.3.2 The <code id=the-websocket-interface:websoc

<p>If the method's second argument is present, then run these substeps:</p>

<ol><li><p>Let <var>raw reason</var> be the method's second argument.<li><p>Let <var>Unicode reason</var> be the result of <a href=#convert-a-domstring-to-a-sequence-of-unicode-characters id=the-websocket-interface:convert-a-domstring-to-a-sequence-of-unicode-characters>converting <var>raw reason</var> to a sequence of
Unicode characters</a>.<li><p>Let <var>reason</var> be the result of encoding <var>Unicode
<ol><li><p>Let <var>raw reason</var> be the method's second argument.<li><p>Let <var>reason</var> be the result of encoding <var>raw
reason</var> as UTF-8.<li><p>If <var>reason</var> is longer than 123 bytes, then throw a
<code id=the-websocket-interface:syntaxerror-3><a href=#syntaxerror>SyntaxError</a></code> exception and abort these steps. <a href=#refsENCODING>[ENCODING]</a></ol>

Expand Down Expand Up @@ -67329,10 +67328,9 @@ <h4 id=the-websocket-interface>9.3.2 The <code id=the-websocket-interface:websoc

<dl><dt>If the argument is a string<dd>

<p>Let <var>data</var> be the result of <a href=#convert-a-domstring-to-a-sequence-of-unicode-characters id=the-websocket-interface:convert-a-domstring-to-a-sequence-of-unicode-characters-2>converting the <var>data</var> argument to a sequence of Unicode
characters</a>. If <i id=the-websocket-interface:concept-websocket-established-4><a href=#concept-websocket-established>the WebSocket connection is
<p>If <i id=the-websocket-interface:concept-websocket-established-4><a href=#concept-websocket-established>the WebSocket connection is
established</a></i> and <i id=the-websocket-interface:concept-websocket-closing-handshake-3><a href=#concept-websocket-closing-handshake>the WebSocket closing
handshake has not yet started</a></i>, then the user agent must <i id=the-websocket-interface:concept-websocket-send><a href=#concept-websocket-send>send a WebSocket Message</a></i> comprised of <var>data</var> using
handshake has not yet started</a></i>, then the user agent must <i id=the-websocket-interface:concept-websocket-send><a href=#concept-websocket-send>send a WebSocket Message</a></i> comprised of the <var>data</var> argument 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 id=the-websocket-interface:concept-websocket-close-fail>flag the
WebSocket as full</a> and then <i id=the-websocket-interface:concept-websocket-close-5><a href=#concept-websocket-close>close the WebSocket
Expand Down
14 changes: 6 additions & 8 deletions index
Expand Up @@ -2350,7 +2350,6 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li><dfn id=platform-array-objects>Platform array objects</dfn>
<li><dfn id=dfn-read-only-array>Read only</dfn> (when applied to arrays)
<li><dfn id=dfn-callback-this-value>Callback this value</dfn>
<li><dfn id=convert-a-domstring-to-a-sequence-of-unicode-characters>Convert a <code>DOMString</code> to a sequence of Unicode characters</dfn>
<li><dfn id=concept-idl-convert><a href=http://heycam.github.io/webidl/#es-type-mapping>Converting</a></dfn> between WebIDL types and JS types
</ul>

Expand All @@ -2362,6 +2361,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li><dfn id=idl-boolean-wrapper><code>Boolean</code></dfn>
<li><dfn id=idl-date><code>Date</code></dfn>
<li><dfn id=idl-domstring><code>DOMString</code></dfn>
<li><dfn id=idl-usvstring><code>USVString</code></dfn>
<li><dfn id=idl-double><code>double</code></dfn>
<li><dfn id=idl-error><code>Error</code></dfn>
<li><dfn id=idl-function><code>Function</code></dfn>
Expand Down Expand Up @@ -67082,12 +67082,12 @@ interface <dfn id=websocket>WebSocket</dfn> : <a href=#eventtarget id=the-websoc
attribute <a href=#eventhandler id=the-websocket-interface:eventhandler-3>EventHandler</a> <a href=#handler-websocket-onclose id=the-websocket-interface:handler-websocket-onclose>onclose</a>;
readonly attribute DOMString <a href=#dom-websocket-extensions id=the-websocket-interface:dom-websocket-extensions>extensions</a>;
readonly attribute DOMString <a href=#dom-websocket-protocol id=the-websocket-interface:dom-websocket-protocol>protocol</a>;
void <a href=#dom-websocket-close id=the-websocket-interface:dom-websocket-close>close</a>([Clamp] optional unsigned short code, optional DOMString reason);
void <a href=#dom-websocket-close id=the-websocket-interface:dom-websocket-close>close</a>([Clamp] optional unsigned short code, optional <a href=#idl-usvstring id=the-websocket-interface:idl-usvstring>USVString</a> reason);

// messaging
attribute <a href=#eventhandler id=the-websocket-interface:eventhandler-4>EventHandler</a> <a href=#handler-websocket-onmessage id=the-websocket-interface:handler-websocket-onmessage>onmessage</a>;
attribute <a href=#binarytype id=the-websocket-interface:binarytype>BinaryType</a> <a href=#dom-websocket-binarytype id=the-websocket-interface:dom-websocket-binarytype>binaryType</a>;
void <a href=#dom-websocket-send id=the-websocket-interface:dom-websocket-send>send</a>(DOMString data);
void <a href=#dom-websocket-send id=the-websocket-interface:dom-websocket-send>send</a>(<a href=#idl-usvstring id=the-websocket-interface:idl-usvstring-2>USVString</a> data);
void <a href=#dom-websocket-send id=the-websocket-interface:dom-websocket-send-2>send</a>(<a href=#blob id=the-websocket-interface:blob>Blob</a> data);
void <a href=#dom-websocket-send id=the-websocket-interface:dom-websocket-send-3>send</a>(<a href=#arraybuffer id=the-websocket-interface:arraybuffer>ArrayBuffer</a> data);
void <a href=#dom-websocket-send id=the-websocket-interface:dom-websocket-send-4>send</a>(<a href=#arraybufferview id=the-websocket-interface:arraybufferview>ArrayBufferView</a> data);
Expand Down Expand Up @@ -67210,8 +67210,7 @@ interface <dfn id=websocket>WebSocket</dfn> : <a href=#eventtarget id=the-websoc

<p>If the method's second argument is present, then run these substeps:</p>

<ol><li><p>Let <var>raw reason</var> be the method's second argument.<li><p>Let <var>Unicode reason</var> be the result of <a href=#convert-a-domstring-to-a-sequence-of-unicode-characters id=the-websocket-interface:convert-a-domstring-to-a-sequence-of-unicode-characters>converting <var>raw reason</var> to a sequence of
Unicode characters</a>.<li><p>Let <var>reason</var> be the result of encoding <var>Unicode
<ol><li><p>Let <var>raw reason</var> be the method's second argument.<li><p>Let <var>reason</var> be the result of encoding <var>raw
reason</var> as UTF-8.<li><p>If <var>reason</var> is longer than 123 bytes, then throw a
<code id=the-websocket-interface:syntaxerror-3><a href=#syntaxerror>SyntaxError</a></code> exception and abort these steps. <a href=#refsENCODING>[ENCODING]</a></ol>

Expand Down Expand Up @@ -67329,10 +67328,9 @@ socket.onopen = function () {

<dl><dt>If the argument is a string<dd>

<p>Let <var>data</var> be the result of <a href=#convert-a-domstring-to-a-sequence-of-unicode-characters id=the-websocket-interface:convert-a-domstring-to-a-sequence-of-unicode-characters-2>converting the <var>data</var> argument to a sequence of Unicode
characters</a>. If <i id=the-websocket-interface:concept-websocket-established-4><a href=#concept-websocket-established>the WebSocket connection is
<p>If <i id=the-websocket-interface:concept-websocket-established-4><a href=#concept-websocket-established>the WebSocket connection is
established</a></i> and <i id=the-websocket-interface:concept-websocket-closing-handshake-3><a href=#concept-websocket-closing-handshake>the WebSocket closing
handshake has not yet started</a></i>, then the user agent must <i id=the-websocket-interface:concept-websocket-send><a href=#concept-websocket-send>send a WebSocket Message</a></i> comprised of <var>data</var> using
handshake has not yet started</a></i>, then the user agent must <i id=the-websocket-interface:concept-websocket-send><a href=#concept-websocket-send>send a WebSocket Message</a></i> comprised of the <var>data</var> argument 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 id=the-websocket-interface:concept-websocket-close-fail>flag the
WebSocket as full</a> and then <i id=the-websocket-interface:concept-websocket-close-5><a href=#concept-websocket-close>close the WebSocket
Expand Down
18 changes: 6 additions & 12 deletions source
Expand Up @@ -2840,7 +2840,6 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li><dfn>Platform array objects</dfn>
<li><dfn data-x="dfn-read-only-array">Read only</dfn> (when applied to arrays)
<li><dfn data-x="dfn-callback-this-value">Callback this value</dfn>
<li><dfn>Convert a <code>DOMString</code> to a sequence of Unicode characters</dfn>
<li><dfn data-x="concept-idl-convert" data-x-href="http://heycam.github.io/webidl/#es-type-mapping">Converting</dfn> between WebIDL types and JS types
</ul>

Expand All @@ -2854,6 +2853,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li><dfn><code data-x="idl-boolean-wrapper">Boolean</code></dfn>
<li><dfn><code data-x="idl-Date">Date</code></dfn>
<li><dfn><code data-x="idl-DOMString">DOMString</code></dfn>
<li><dfn><code data-x="idl-USVString">USVString</code></dfn>
<li><dfn><code data-x="idl-double">double</code></dfn>
<li><dfn><code data-x="idl-Error">Error</code></dfn>
<li><dfn><code data-x="idl-Function">Function</code></dfn>
Expand Down Expand Up @@ -90927,12 +90927,12 @@ interface <dfn>WebSocket</dfn> : <span>EventTarget</span> {
attribute <span>EventHandler</span> <span data-x="handler-WebSocket-onclose">onclose</span>;
readonly attribute DOMString <span data-x="dom-WebSocket-extensions">extensions</span>;
readonly attribute DOMString <span data-x="dom-WebSocket-protocol">protocol</span>;
void <span data-x="dom-WebSocket-close">close</span>([Clamp] optional unsigned short code, optional DOMString reason);
void <span data-x="dom-WebSocket-close">close</span>([Clamp] optional unsigned short code, optional <span data-x="idl-USVString">USVString</span> reason);

// messaging
attribute <span>EventHandler</span> <span data-x="handler-WebSocket-onmessage">onmessage</span>;
attribute <span>BinaryType</span> <span data-x="dom-WebSocket-binaryType">binaryType</span>;
void <span data-x="dom-WebSocket-send">send</span>(DOMString data);
void <span data-x="dom-WebSocket-send">send</span>(<span data-x="idl-USVString">USVString</span> data);
void <span data-x="dom-WebSocket-send">send</span>(<span>Blob</span> data);
void <span data-x="dom-WebSocket-send">send</span>(<span>ArrayBuffer</span> data);
void <span data-x="dom-WebSocket-send">send</span>(<span>ArrayBufferView</span> data);
Expand Down Expand Up @@ -91105,11 +91105,7 @@ interface <dfn>WebSocket</dfn> : <span>EventTarget</span> {

<li><p>Let <var>raw reason</var> be the method's second argument.</p></li>

<li><p>Let <var>Unicode reason</var> be the result of <span data-x="convert a DOMString
to a sequence of Unicode characters">converting <var>raw reason</var> to a sequence of
Unicode characters</span>.</p></li>

<li><p>Let <var>reason</var> be the result of encoding <var>Unicode
<li><p>Let <var>reason</var> be the result of encoding <var>raw
reason</var> as UTF-8.</p></li>

<li><p>If <var>reason</var> is longer than 123 bytes, then throw a
Expand Down Expand Up @@ -91276,12 +91272,10 @@ socket.onopen = function () {

<dd>

<p>Let <var>data</var> be the result of <span data-x="convert a DOMString to a sequence of
Unicode characters">converting the <var>data</var> argument to a sequence of Unicode
characters</span>. If <i data-x="concept-websocket-established">the WebSocket connection is
<p>If <i data-x="concept-websocket-established">the WebSocket connection is
established</i> and <i data-x="concept-websocket-closing-handshake">the WebSocket closing
handshake has not yet started</i>, then the user agent must <i
data-x="concept-websocket-send">send a WebSocket Message</i> comprised of <var>data</var> using
data-x="concept-websocket-send">send a WebSocket Message</i> comprised of the <var>data</var> argument 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 data-x="concept-websocket-close-fail">flag the
WebSocket as full</span> and then <i data-x="concept-websocket-close">close the WebSocket
Expand Down

0 comments on commit 6df9c71

Please sign in to comment.