[html5] r4079 - [] (0) Fix how line feeds and line endings are handled by the EventSource format [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Oct 5 02:08:10 PDT 2009


Author: ianh
Date: 2009-10-05 02:08:10 -0700 (Mon, 05 Oct 2009)
New Revision: 4079

Modified:
   source
Log:
[] (0) Fix how line feeds and line endings are handled by the EventSource format. Also, defer to DOM Events for what makes a correct event type, since it is unstable.

Modified: source
===================================================================
--- source	2009-10-05 06:47:12 UTC (rev 4078)
+++ source	2009-10-05 09:08:10 UTC (rev 4079)
@@ -73180,7 +73180,7 @@
 name-char     = %x0000-0009 / %x000B-000C / %x000E-0039 / %x003B-10FFFF
                 ; a Unicode character other than U+000A LINE FEED, U+000D CARRIAGE RETURN, or U+003A COLON
 any-char      = %x0000-0009 / %x000B-000C / %x000E-10FFFF
-                ; a Unicode character other than U+000D CARRIAGE RETURN or U+003A COLON</pre>
+                ; a Unicode character other than U+000A LINE FEED or U+000D CARRIAGE RETURN</pre>
 
   <p>Event streams in this format must always be encoded as
   UTF-8.</p>
@@ -73207,9 +73207,11 @@
 
   <p>The stream must then be parsed by reading everything line by
   line, with a U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF)
-  character pair, a single U+000A LINE FEED (LF) character, a single
-  U+000D CARRIAGE RETURN (CR) character, and the end of the file being
-  the four ways in which a line can end.</p>
+  character pair, a single U+000A LINE FEED (LF) character not
+  preceded by a U+000D CARRIAGE RETURN (CR) character, a single U+000D
+  CARRIAGE RETURN (CR) character not followd by a U+000D CARRIAGE
+  RETURN (LF) character, and the end of the file being the four ways
+  in which a line can end.</p>
 
   <p>When a stream is parsed, a <var title="">data</var> buffer and an
   <var title="">event name</var> buffer must be associated with
@@ -73283,9 +73285,8 @@
 
    <dt>If the field name is "data"</dt>
 
-   <dd><p>If the <var title="">data</var> buffer is not the empty
-   string, then append a single U+000A LINE FEED character to the <var
-   title="">data</var> buffer. Append the field value to the <var
+   <dd><p>Append the field value to the <var title="">data</var>
+   buffer, then append a single U+000A LINE FEED character to the <var
    title="">data</var> buffer.</p></dd>
 
 
@@ -73334,12 +73335,16 @@
    name</var> buffer to the empty string and abort these
    steps.</p></li>
 
+   <li>If the <var title="">data</var> buffer's last character is a
+   U+000A LINE FEED character, then remove the last character from the
+   <var title="">data</var> buffer.</p>
+
    <li><p>If the <var title="">event name</var> buffer is not the
-   empty string but is also not a valid <a
-   href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</a>,
-   set the <var title="">data</var> buffer and the <var title="">event
-   name</var> buffer to the empty string and abort these
-   steps.</p></li>
+   empty string but is also not a valid event type name, as defined by
+   the DOM Events specification, set the <var title="">data</var>
+   buffer and the <var title="">event name</var> buffer to the empty
+   string and abort these steps. <a
+   href="#refsDOMEVENTS">[DOMEVENTS]</a></p></li>
 
    <li><p>Otherwise, create an event that uses the
    <code>MessageEvent</code> interface, with the event name <code




More information about the Commit-Watchers mailing list