From 2725c544754a6782b4deedd8714679fc0e324a5a Mon Sep 17 00:00:00 2001 From: Henri Sivonen Date: Sat, 19 Jun 2010 09:38:41 +0300 Subject: [PATCH] Bug 570309 - Experimentally make -- > not terminate a comment in HTML. r=jonas. --- parser/html/javasrc/Tokenizer.java | 20 +++----------------- parser/html/nsHtml5Tokenizer.cpp | 15 ++++----------- 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/parser/html/javasrc/Tokenizer.java b/parser/html/javasrc/Tokenizer.java index 951757657d7..376078ba819 100644 --- a/parser/html/javasrc/Tokenizer.java +++ b/parser/html/javasrc/Tokenizer.java @@ -2661,28 +2661,14 @@ public class Tokenizer implements Locator { * 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); diff --git a/parser/html/nsHtml5Tokenizer.cpp b/parser/html/nsHtml5Tokenizer.cpp index b3f2189965b..630aa0edcc6 100644 --- a/parser/html/nsHtml5Tokenizer.cpp +++ b/parser/html/nsHtml5Tokenizer.cpp @@ -1192,22 +1192,15 @@ nsHtml5Tokenizer::stateLoop(PRInt32 state, PRUnichar c, PRInt32 pos, PRUnichar* 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 '!': { @@ -1225,7 +1218,7 @@ nsHtml5Tokenizer::stateLoop(PRInt32 state, PRUnichar c, PRInt32 pos, PRUnichar* } } } - commentendloop_end: ; + } case NS_HTML5TOKENIZER_COMMENT_END_SPACE: { for (; ; ) {