Bug 612527 - Implement spec tweaks to U+0000 handling in the HTML5 parser. rs=jonas, a=blocking2.0-betaN.

This commit is contained in:
Henri Sivonen
2010-12-09 11:27:58 +02:00
parent 0e46554119
commit 034b529d7e
9 changed files with 66 additions and 12 deletions

View File

@@ -1717,7 +1717,7 @@ nsHtml5Tokenizer::stateLoop(PRInt32 state, PRUnichar c, PRInt32 pos, PRUnichar*
}
switch(c) {
case '\0': {
emitReplacementCharacter(buf, pos);
emitPlaintextReplacementCharacter(buf, pos);
continue;
}
case '\r': {
@@ -3300,6 +3300,14 @@ nsHtml5Tokenizer::emitReplacementCharacter(PRUnichar* buf, PRInt32 pos)
cstart = pos + 1;
}
void
nsHtml5Tokenizer::emitPlaintextReplacementCharacter(PRUnichar* buf, PRInt32 pos)
{
flushChars(buf, pos);
tokenHandler->characters(REPLACEMENT_CHARACTER, 0, 1);
cstart = pos + 1;
}
void
nsHtml5Tokenizer::setAdditionalAndRememberAmpersandLocation(PRUnichar add)
{