Bug 570309 - Experimentally make -- > not terminate a comment in HTML. r=jonas.
authorHenri Sivonen <hsivonen@iki.fi>
Sat, 19 Jun 2010 09:38:41 +0300
changeset 48286 609d101acf8e6c5f89658c8b41c300f7196a5b82
parent 48285 94351964a232727a5b80c4a90cee221e6ff3bdb9
child 48287 beab39d49de913fcd0722b49181eb7585b56999b
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonas
bugs570309
milestone2.0b3pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 570309 - Experimentally make -- > not terminate a comment in HTML. r=jonas.
parser/html/javasrc/Tokenizer.java
parser/html/nsHtml5Tokenizer.cpp
--- a/parser/html/javasrc/Tokenizer.java
+++ b/parser/html/javasrc/Tokenizer.java
@@ -2656,38 +2656,24 @@ public class Tokenizer implements Locato
                                  * Append a U+002D HYPHEN-MINUS (-) character to
                                  * the comment token's data.
                                  */
                                 adjustDoubleHyphenAndAppendToLongStrBufAndErr(c);
                                 /*
                                  * Stay in the comment end state.
                                  */
                                 continue;
-                            case ' ':
-                            case '\t':
-                            case '\u000C':
-                                /*
-                                 * Parse error. Append two U+002D HYPHEN-MINUS
-                                 * (-) characters and the input character to the
-                                 * comment token's data. Switch to the comment
-                                 * end space state.
-                                 */
-                                adjustDoubleHyphenAndAppendToLongStrBufAndErr(c);
-                                state = Tokenizer.COMMENT_END_SPACE;
-                                break commentendloop;
-                            // continue stateloop;
                             case '\r':
                                 adjustDoubleHyphenAndAppendToLongStrBufCarriageReturn();
-                                state = Tokenizer.COMMENT_END_SPACE;
+                                state = Tokenizer.COMMENT;
                                 break stateloop;
                             case '\n':
                                 adjustDoubleHyphenAndAppendToLongStrBufLineFeed();
-                                state = Tokenizer.COMMENT_END_SPACE;
-                                break commentendloop;
-                            // continue stateloop;
+                                state = Tokenizer.COMMENT;
+                                continue stateloop;
                             case '!':
                                 errHyphenHyphenBang();
                                 appendLongStrBuf(c);
                                 state = Tokenizer.COMMENT_END_BANG;
                                 continue stateloop;
                             case '\u0000':
                                 c = '\uFFFD';
                                 // fall thru
--- a/parser/html/nsHtml5Tokenizer.cpp
+++ b/parser/html/nsHtml5Tokenizer.cpp
@@ -1187,32 +1187,25 @@ nsHtml5Tokenizer::stateLoop(PRInt32 stat
               emitComment(2, pos);
               state = NS_HTML5TOKENIZER_DATA;
               NS_HTML5_CONTINUE(stateloop);
             }
             case '-': {
               adjustDoubleHyphenAndAppendToLongStrBufAndErr(c);
               continue;
             }
-            case ' ':
-            case '\t':
-            case '\f': {
-              adjustDoubleHyphenAndAppendToLongStrBufAndErr(c);
-              state = NS_HTML5TOKENIZER_COMMENT_END_SPACE;
-              NS_HTML5_BREAK(commentendloop);
-            }
             case '\r': {
               adjustDoubleHyphenAndAppendToLongStrBufCarriageReturn();
-              state = NS_HTML5TOKENIZER_COMMENT_END_SPACE;
+              state = NS_HTML5TOKENIZER_COMMENT;
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               adjustDoubleHyphenAndAppendToLongStrBufLineFeed();
-              state = NS_HTML5TOKENIZER_COMMENT_END_SPACE;
-              NS_HTML5_BREAK(commentendloop);
+              state = NS_HTML5TOKENIZER_COMMENT;
+              NS_HTML5_CONTINUE(stateloop);
             }
             case '!': {
 
               appendLongStrBuf(c);
               state = NS_HTML5TOKENIZER_COMMENT_END_BANG;
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
@@ -1220,17 +1213,17 @@ nsHtml5Tokenizer::stateLoop(PRInt32 stat
             }
             default: {
               adjustDoubleHyphenAndAppendToLongStrBufAndErr(c);
               state = NS_HTML5TOKENIZER_COMMENT;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        commentendloop_end: ;
+
       }
       case NS_HTML5TOKENIZER_COMMENT_END_SPACE: {
         for (; ; ) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch(c) {