Bug 610345 - Add MathML named characters that expand to two code points to the HTML5 parser. rs=jonas, a=blocking2.0-betaN.

This commit is contained in:
Henri Sivonen
2010-11-23 13:49:27 +02:00
parent 4e1b2de9ef
commit f794bd9866
8 changed files with 2046 additions and 1861 deletions

View File

@@ -3076,7 +3076,6 @@ public class Tokenizer implements Locator {
continue;
}
// TODO warn about apos (IE) and TRADE (Opera)
if (candidate == -1) {
// reconsume deals with CR, LF or nul
/*
@@ -3151,11 +3150,15 @@ public class Tokenizer implements Locator {
* table).
*/
@Const @NoLength char[] val = NamedCharacters.VALUES[candidate];
// See if the first slot holds a high surrogate
if ((val[0] & 0xFC00) == 0xD800) {
emitOrAppendTwo(val, returnState);
} else {
if (
// [NOCPP[
val.length == 1
// ]NOCPP]
// CPPONLY: val[1] == 0
) {
emitOrAppendOne(val, returnState);
} else {
emitOrAppendTwo(val, returnState);
}
// this is so complicated!
if (strBufMark < strBufLen) {
@@ -6350,11 +6353,15 @@ public class Tokenizer implements Locator {
* table).
*/
@Const @NoLength char[] val = NamedCharacters.VALUES[candidate];
// See if the first slot holds a high surrogate
if ((val[0] & 0xFC00) == 0xD800) {
emitOrAppendTwo(val, returnState);
} else {
if (
// [NOCPP[
val.length == 1
// ]NOCPP]
// CPPONLY: val[1] == 0
) {
emitOrAppendOne(val, returnState);
} else {
emitOrAppendTwo(val, returnState);
}
// this is so complicated!
if (strBufMark < strBufLen) {