- From: poot <cvsmail@w3.org>
- Date: Wed, 02 May 2012 16:06:45 -0400
- To: public-html-diffs@w3.org
websocket; hixie: Make WebSocket silently convert isolated surrogated to
U+FFFD rather than throwing an exception. This will result in data
corruption when a user types in astral-plane characters that get
truncated by naiive script half-way through, rather than crashing the
application. (whatwg r7084)
http://dev.w3.org/cvsweb/html5/websockets/Overview.html?r1=1.264&r2=1.265&f=h
http://html5.org/tools/web-apps-tracker?from=7083&to=7084
===================================================================
RCS file: /sources/public/html5/websockets/Overview.html,v
retrieving revision 1.264
retrieving revision 1.265
diff -u -d -r1.264 -r1.265
--- Overview.html 2 May 2012 19:51:03 -0000 1.264
+++ Overview.html 2 May 2012 20:06:40 -0000 1.265
@@ -693,14 +693,27 @@
<code>InvalidAccessError</code> exception and abort these
steps.</li>
- <li><p>If the method's second argument has any isolated surrogates,
- then throw a <code>SyntaxError</code> exception and abort these
- steps. <a href="#refsUNICODE">[UNICODE]</a></li>
+ <li>
- <li><p>If the method's second argument is present, then let <var title="">reason</var> be the result of encoding that argument as
- UTF-8. If <var title="">reason</var> is longer than 123 bytes, then
- throw a <code>SyntaxError</code> exception and abort these steps.
- <a href="#refsRFC3629">[RFC3629]</a></li>
+ <p>If the method's second argument is present, then run these
+ substeps:</p>
+
+ <ol><li><p>Let <var title="">raw reason</var> be the method's second
+ argument.</li>
+
+ <li><p>Let <var title="">Unicode reason</var> be the result of
+ <span title="convert a DOMString to a sequence of Unicode
+ characters">converting <var title="">raw reason</var> to a
+ sequence of Unicode characters</span>.</li>
+
+ <li><p>Let <var title="">reason</var> be the result of encoding
+ <var title="">Unicode reason</var> as UTF-8.</li>
+
+ <li><p>If <var title="">reason</var> is longer than 123 bytes,
+ then throw a <code>SyntaxError</code> exception and abort these
+ steps. <a href="#refsRFC3629">[RFC3629]</a></li>
+
+ </ol></li>
<li><p>Run the first matching steps from the following list:</p>
@@ -848,10 +861,10 @@
<dd>
- <p>If the <var title="">data</var> argument has any isolated
- surrogates, then throw a <code>SyntaxError</code> exception. If
- <i>the WebSocket connection is established</i>, and the string has
- no isolated surrogates, and <i title="the WebSocket closing
+ <p>Let <var title="">data</var> be the result of <span title="convert a DOMString to a sequence of Unicode
+ characters">converting the <var title="">data</var> argument to a
+ sequence of Unicode characters</span>. 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 text
Received on Wednesday, 2 May 2012 20:06:48 UTC