Rename CSS tokens to be closer to the names of newly-added tokens (BAD_STRING, BAD_URI) in the CSS 2.1 tokenization. (Bug 604179, patch 2) r=bzbarsky

This commit is contained in:
L. David Baron 2011-03-11 11:29:44 -06:00
Родитель 0d7afcb40f
Коммит 32741bb192
2 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -196,7 +196,7 @@ nsCSSToken::AppendToString(nsString& aBuffer)
case eCSSToken_WhiteSpace:
case eCSSToken_Function:
case eCSSToken_URL:
case eCSSToken_InvalidURL:
case eCSSToken_Bad_URL:
case eCSSToken_HTMLComment:
case eCSSToken_URange:
aBuffer.Append(mIdent);
@ -251,7 +251,7 @@ nsCSSToken::AppendToString(nsString& aBuffer)
case eCSSToken_Containsmatch:
aBuffer.AppendLiteral("*=");
break;
case eCSSToken_Error:
case eCSSToken_Bad_String:
aBuffer.Append(mSymbol);
aBuffer.Append(mIdent);
break;
@ -911,12 +911,12 @@ nsCSSScanner::NextURL(nsCSSToken& aToken)
// Because of this the normal rules for tokenizing the input don't
// apply very well. To simplify the parser and relax some of the
// requirements on the scanner we parse url's here. If we find a
// malformed URL then we emit a token of type "InvalidURL" so that
// malformed URL then we emit a token of type "Bad_URL" so that
// the CSS1 parser can ignore the invalid input. The parser must
// treat an InvalidURL token like a Function token, and process
// treat a Bad_URL token like a Function token, and process
// tokens until a matching parenthesis.
aToken.mType = eCSSToken_InvalidURL;
aToken.mType = eCSSToken_Bad_URL;
nsString& ident = aToken.mIdent;
ident.SetLength(0);
@ -1319,7 +1319,7 @@ nsCSSScanner::ParseString(PRInt32 aStop, nsCSSToken& aToken)
break;
}
if (ch == '\n') {
aToken.mType = eCSSToken_Error;
aToken.mType = eCSSToken_Bad_String;
#ifdef CSS_REPORT_PARSE_ERRORS
ReportUnexpectedToken(aToken, "SEUnterminatedString");
#endif

Просмотреть файл

@ -91,7 +91,7 @@ enum nsCSSTokenType {
eCSSToken_Function, // mIdent
eCSSToken_URL, // mIdent
eCSSToken_InvalidURL, // doesn't matter
eCSSToken_Bad_URL, // doesn't matter
eCSSToken_HTMLComment, // "<!--" or "-->"
@ -106,9 +106,8 @@ enum nsCSSTokenType {
// valid range; mIdent preserves the textual
// form of the token for error reporting
// A special token indicating that there was an error in tokenization.
// It's always an unterminated string.
eCSSToken_Error // mSymbol + mIdent
// An unterminated string, which is always an error.
eCSSToken_Bad_String // mSymbol + mIdent
};
struct nsCSSToken {