if (((aVariantMask & VARIANT_NUMBER) != 0) && (eCSSToken_Number == tk->mType)) { aValue.SetFloatValue(tk->mNumber, eCSSUnit_Number); aParsedVariant = VARIANT_NUMBER; return PR_TRUE; } if (((aVariantMask & VARIANT_INTEGER) != 0) && (eCSSToken_Number == tk->mType) && tk->mIntegerValid) { aValue.SetIntValue(tk->mInteger, eCSSUnit_Integer); aParsedVariant = VARIANT_INTEGER; return PR_TRUE; } if (PR_TRUE == mNavQuirkMode) { if (((aVariantMask & VARIANT_LENGTH) != 0) && (eCSSToken_Number == tk->mType)) { aValue.SetFloatValue(tk->mNumber, eCSSUnit_Pixel); aParsedVariant = VARIANT_LENGTH; return PR_TRUE; } } if (((aVariantMask & VARIANT_URL) != 0) && (eCSSToken_Function == tk->mType) && tk->mIdent.EqualsIgnoreCase("url")) { if (ParseURL(aErrorCode, aValue)) { aParsedVariant = VARIANT_URL; return PR_TRUE; } return PR_FALSE; } if ((aVariantMask & VARIANT_COLOR) != 0) { if ((eCSSToken_ID == tk->mType) || (eCSSToken_Ident == tk->mType) || ((eCSSToken_Function == tk->mType) && (tk->mIdent.EqualsIgnoreCase("rgb")))) {  UngetToken(); if (ParseColor(aErrorCode, aValue)) { aParsedVariant = VARIANT_COLOR; return PR_TRUE; } return PR_FALSE; } } if (((aVariantMask & VARIANT_STRING) != 0) && (eCSSToken_String == tk->mType)) { nsAutoString  buffer; buffer.Append(tk->mSymbol); buffer.Append(tk->mIdent); buffer.Append(tk->mSymbol); aValue.SetStringValue(buffer, eCSSUnit_String); aParsedVariant = VARIANT_STRING; return PR_TRUE; } if (((aVariantMask & VARIANT_IDENTIFIER) != 0) && (eCSSToken_Ident == tk->mType)) { aValue.SetStringValue(tk->mIdent, eCSSUnit_String); aParsedVariant = VARIANT_IDENTIFIER; return PR_TRUE; } if (((aVariantMask & VARIANT_COUNTER) != 0) && (eCSSToken_Function == tk->mType) && (tk->mIdent.EqualsIgnoreCase("counter") || tk->mIdent.EqualsIgnoreCase("counters"))) { if (ParseCounter(aErrorCode, aValue)) { aParsedVariant = VARIANT_COUNTER; return PR_TRUE; } return PR_FALSE; } if (((aVariantMask & VARIANT_ATTR) != 0) && (eCSSToken_Function == tk->mType) && tk->mIdent.EqualsIgnoreCase("attr")) {  if (ParseAttr(aErrorCode, aValue)) { aParsedVariant = VARIANT_ATTR; return PR_TRUE; } return PR_FALSE; }  UngetToken();
PRBool CSSParserImpl::ParseVariant(PRInt32& aErrorCode,                                   nsICSSDeclaration* aDeclaration,                                   PRInt32 aPropID,                                   PRInt32 aVariantMask, const PRInt32 aKeywordTable[],                                   PRInt32& aParsedVariant){  nsCSSValue  value;  if (ParseVariant(aErrorCode, value, aVariantMask, aKeywordTable, aParsedVariant)) {    aDeclaration->AppendValue(aPropID, value);    return PR_TRUE;  }  return PR_FALSE;}