aDeclaration->AddValue(aName, nsCSSValue(tk->mNumber, eCSSUnit_Percent));
aDeclaration->AppendValue(aName, nsCSSValue(tk->mNumber, eCSSUnit_Percent));
PRBool CSSParserImpl::ParseVariant(PRInt32* aErrorCode,                                   nsICSSDeclaration* aDeclaration,                                   const char* aName,                                   PRInt32 aVariants, PRInt32* aTable){  nsCSSToken* tk = &mToken;  if (!GetToken(aErrorCode, PR_TRUE)) {    return PR_FALSE;  }  if (((aVariants & (VARIANT_AHK | VARIANT_NORMAL | VARIANT_NONE)) != 0) &&      (eCSSToken_Ident == tk->mType)) {    char cbuf[50];    tk->mIdent.ToCString(cbuf, sizeof(cbuf));    PRInt32 sid = nsCSSKeywords::LookupName(cbuf);    if (sid >= 0) { // known keyword      if ((aVariants & VARIANT_AUTO) != 0) {        if (sid == KEYWORD_AUTO) {          aDeclaration->AddValue(aName, nsCSSValue(eCSSUnit_Auto));          return PR_TRUE;        }      }      if ((aVariants & VARIANT_INHERIT) != 0) {        if (sid == KEYWORD_INHERIT) {          aDeclaration->AddValue(aName, nsCSSValue(eCSSUnit_Inherit));          return PR_TRUE;        }      }      if ((aVariants & VARIANT_NONE) != 0) {        if (sid == KEYWORD_NONE) {          aDeclaration->AddValue(aName, nsCSSValue(eCSSUnit_None));          return PR_TRUE;        }      }      if ((aVariants & VARIANT_NORMAL) != 0) {        if (sid == KEYWORD_NORMAL) {          aDeclaration->AddValue(aName, nsCSSValue(eCSSUnit_Normal));          return PR_TRUE;        }      }      if ((aVariants & VARIANT_KEYWORD) != 0) {        PRInt32 ix = SearchKeywordTable(sid, aTable);        if (ix >= 0) {          aDeclaration->AddValue(aName, nsCSSValue(aTable[ix+1], eCSSUnit_Enumerated));          return PR_TRUE;        }      }    }  }  if (((aVariants & VARIANT_LENGTH) != 0) && tk->isDimension()) {    return TranslateLength(aDeclaration, aName, tk->mNumber, tk->mIdent);  }  if (((aVariants & VARIANT_PERCENT) != 0) &&      (eCSSToken_Percentage == tk->mType)) {    aDeclaration->AddValue(aName, nsCSSValue(tk->mNumber, eCSSUnit_Percent));    return PR_TRUE;  }  if (((aVariants & VARIANT_NUMBER) != 0) &&      (eCSSToken_Number == tk->mType)) {    aDeclaration->AddValue(aName, nsCSSValue(tk->mNumber, eCSSUnit_Number));    return PR_TRUE;  }  if (((aVariants & VARIANT_INTEGER) != 0) &&      (eCSSToken_Number == tk->mType) && tk->mIntegerValid) {    aDeclaration->AddValue(aName, nsCSSValue(tk->mInteger, eCSSUnit_Integer));    return PR_TRUE;  }  if (((aVariants & VARIANT_URL) != 0) &&      (eCSSToken_URL == tk->mType)) {    // Translate url into an absolute url if the url is relative to    // the style sheet.    // XXX editors won't like this - too bad for now    nsAutoString absURL;    nsString baseURL;    nsresult rv = NS_MakeAbsoluteURL(mURL, baseURL, tk->mIdent, absURL);    if (NS_OK == rv) {      aDeclaration->AddValue(aName, nsCSSValue(absURL));    }    else {      aDeclaration->AddValue(aName, nsCSSValue(tk->mIdent));    }    return PR_TRUE;  }  if ((aVariants & VARIANT_COLOR) != 0) {    if ((eCSSToken_ID == tk->mType) || (eCSSToken_Ident == tk->mType)) {      // Put token back so that parse color can get it      UngetToken();      nscolor rgba;      // XXX This loses the original input format (e.g. a name which      // should be preserved when editing)      if (ParseColor(aErrorCode, &rgba)) {        aDeclaration->AddValue(aName, nsCSSValue(rgba));        return PR_TRUE;      }      return PR_FALSE;    }  }  UngetToken();  return PR_FALSE;}