Adjust tokenization of U+0000.

master
Fedor 2019-11-12 08:46:59 +03:00
parent 55a7f5e372
commit c9d2fb326d
1 changed files with 2 additions and 13 deletions

View File

@ -1054,9 +1054,6 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu
} }
c = checkChar(buf, pos); c = checkChar(buf, pos);
switch(c) { switch(c) {
case '\0': {
NS_HTML5_BREAK(stateloop);
}
case '-': { case '-': {
clearStrBufAfterOneHyphen(); clearStrBufAfterOneHyphen();
state = P::transition(mViewSource, NS_HTML5TOKENIZER_COMMENT_START, reconsume, pos); state = P::transition(mViewSource, NS_HTML5TOKENIZER_COMMENT_START, reconsume, pos);
@ -1461,9 +1458,6 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu
NS_HTML5_BREAK(stateloop); NS_HTML5_BREAK(stateloop);
} }
c = checkChar(buf, pos); c = checkChar(buf, pos);
if (c == '\0') {
NS_HTML5_BREAK(stateloop);
}
switch(c) { switch(c) {
case ' ': case ' ':
case '\t': case '\t':
@ -1471,7 +1465,8 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu
case '\r': case '\r':
case '\f': case '\f':
case '<': case '<':
case '&': { case '&':
case '\0': {
emitOrAppendCharRefBuf(returnState); emitOrAppendCharRefBuf(returnState);
if (!(returnState & NS_HTML5TOKENIZER_DATA_AND_RCDATA_MASK)) { if (!(returnState & NS_HTML5TOKENIZER_DATA_AND_RCDATA_MASK)) {
cstart = pos; cstart = pos;
@ -1519,9 +1514,6 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu
NS_HTML5_BREAK(stateloop); NS_HTML5_BREAK(stateloop);
} }
c = checkChar(buf, pos); c = checkChar(buf, pos);
if (c == '\0') {
NS_HTML5_BREAK(stateloop);
}
int32_t hilo = 0; int32_t hilo = 0;
if (c <= 'z') { if (c <= 'z') {
const int32_t* row = nsHtml5NamedCharactersAccel::HILO_ACCEL[c]; const int32_t* row = nsHtml5NamedCharactersAccel::HILO_ACCEL[c];
@ -1556,9 +1548,6 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu
NS_HTML5_BREAK(stateloop); NS_HTML5_BREAK(stateloop);
} }
c = checkChar(buf, pos); c = checkChar(buf, pos);
if (c == '\0') {
NS_HTML5_BREAK(stateloop);
}
entCol++; entCol++;
for (; ; ) { for (; ; ) {
if (hi < lo) { if (hi < lo) {