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

@@ -3424,7 +3424,7 @@ public class Tokenizer implements Locator {
}
switch (c) {
case '\u0000':
emitReplacementCharacter(buf, pos);
emitPlaintextReplacementCharacter(buf, pos);
continue;
case '\r':
emitCarriageReturn(buf, pos);
@@ -5785,6 +5785,13 @@ public class Tokenizer implements Locator {
cstart = pos + 1;
}
private void emitPlaintextReplacementCharacter(@NoLength char[] buf, int pos)
throws SAXException {
flushChars(buf, pos);
tokenHandler.characters(REPLACEMENT_CHARACTER, 0, 1);
cstart = pos + 1;
}
private void setAdditionalAndRememberAmpersandLocation(char add) {
additional = add;
// [NOCPP[