Bug 570309 - Experimentally make -- > not terminate a comment in HTML. r=jonas.

This commit is contained in:
Henri Sivonen 2010-06-19 09:38:41 +03:00
Родитель 43dd58c585
Коммит 2725c54475
2 изменённых файлов: 7 добавлений и 28 удалений

Просмотреть файл

@ -2661,28 +2661,14 @@ public class Tokenizer implements Locator {
* Stay in the comment end state. * Stay in the comment end state.
*/ */
continue; 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': case '\r':
adjustDoubleHyphenAndAppendToLongStrBufCarriageReturn(); adjustDoubleHyphenAndAppendToLongStrBufCarriageReturn();
state = Tokenizer.COMMENT_END_SPACE; state = Tokenizer.COMMENT;
break stateloop; break stateloop;
case '\n': case '\n':
adjustDoubleHyphenAndAppendToLongStrBufLineFeed(); adjustDoubleHyphenAndAppendToLongStrBufLineFeed();
state = Tokenizer.COMMENT_END_SPACE; state = Tokenizer.COMMENT;
break commentendloop; continue stateloop;
// continue stateloop;
case '!': case '!':
errHyphenHyphenBang(); errHyphenHyphenBang();
appendLongStrBuf(c); appendLongStrBuf(c);

Просмотреть файл

@ -1192,22 +1192,15 @@ nsHtml5Tokenizer::stateLoop(PRInt32 state, PRUnichar c, PRInt32 pos, PRUnichar*
adjustDoubleHyphenAndAppendToLongStrBufAndErr(c); adjustDoubleHyphenAndAppendToLongStrBufAndErr(c);
continue; continue;
} }
case ' ':
case '\t':
case '\f': {
adjustDoubleHyphenAndAppendToLongStrBufAndErr(c);
state = NS_HTML5TOKENIZER_COMMENT_END_SPACE;
NS_HTML5_BREAK(commentendloop);
}
case '\r': { case '\r': {
adjustDoubleHyphenAndAppendToLongStrBufCarriageReturn(); adjustDoubleHyphenAndAppendToLongStrBufCarriageReturn();
state = NS_HTML5TOKENIZER_COMMENT_END_SPACE; state = NS_HTML5TOKENIZER_COMMENT;
NS_HTML5_BREAK(stateloop); NS_HTML5_BREAK(stateloop);
} }
case '\n': { case '\n': {
adjustDoubleHyphenAndAppendToLongStrBufLineFeed(); adjustDoubleHyphenAndAppendToLongStrBufLineFeed();
state = NS_HTML5TOKENIZER_COMMENT_END_SPACE; state = NS_HTML5TOKENIZER_COMMENT;
NS_HTML5_BREAK(commentendloop); NS_HTML5_CONTINUE(stateloop);
} }
case '!': { case '!': {
@ -1225,7 +1218,7 @@ nsHtml5Tokenizer::stateLoop(PRInt32 state, PRUnichar c, PRInt32 pos, PRUnichar*
} }
} }
} }
commentendloop_end: ;
} }
case NS_HTML5TOKENIZER_COMMENT_END_SPACE: { case NS_HTML5TOKENIZER_COMMENT_END_SPACE: {
for (; ; ) { for (; ; ) {