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
parent 5d581dc2e9
commit 94b4c7c386
2 changed files with 7 additions and 28 deletions

View File

@ -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);

View File

@ -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 (; ; ) {