if ((value.GetUnit() == eHTMLUnit_Integer) || (value.GetUnit() == eHTMLUnit_Enumerated)) {
nsHTMLUnit unit = value.GetUnit(); if (unit == eHTMLUnit_Integer || unit == eHTMLUnit_Enumerated) {
MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,                      nsRuleData* aData){  if (!aData)    return;  if (aData->mFontData) {    nsCSSFont& font = *(aData->mFontData);    nsHTMLValue value;        // face: string list    if (font.mFamily.GetUnit() == eCSSUnit_Null) {      aAttributes->GetAttribute(nsHTMLAtoms::face, value);      if (value.GetUnit() == eHTMLUnit_String) {        nsAutoString familyList;        value.GetStringValue(familyList);        if (!familyList.IsEmpty())          font.mFamily.SetStringValue(familyList, eCSSUnit_String);      }    }    // pointSize: int, enum    if (font.mSize.GetUnit() == eCSSUnit_Null) {      aAttributes->GetAttribute(nsHTMLAtoms::pointSize, value);      if (value.GetUnit() == eHTMLUnit_Integer ||          value.GetUnit() == eHTMLUnit_Enumerated) {        PRInt32 val = value.GetIntValue();        font.mSize.SetFloatValue((float)val, eCSSUnit_Point);      }      else {        // size: int, enum ,         aAttributes->GetAttribute(nsHTMLAtoms::size, value);        if ((value.GetUnit() == eHTMLUnit_Integer) ||            (value.GetUnit() == eHTMLUnit_Enumerated)) {           PRInt32 size = value.GetIntValue();          nsHTMLUnit unit = value.GetUnit();          if (size || unit == eHTMLUnit_Integer) { // unit is integer if attr was "+0" or "-0"            if (unit == eHTMLUnit_Integer) // int (+/-)	            size = 3 + size;  // XXX should be BASEFONT, not three	                        size = ((0 < size) ? ((size < 8) ? size : 7) : 1);             font.mSize.SetIntValue(size, eCSSUnit_Enumerated);          }        }      }    }    // fontWeight: int, enum    if (font.mWeight.GetUnit() == eCSSUnit_Null) {      aAttributes->GetAttribute(nsHTMLAtoms::fontWeight, value);      if (value.GetUnit() == eHTMLUnit_Integer) // +/-        font.mWeight.SetIntValue(value.GetIntValue(), eCSSUnit_Integer);      else if (value.GetUnit() == eHTMLUnit_Enumerated)        font.mWeight.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated);    }  }  else if (aData->mColorData && aData->mSID == eStyleStruct_Color) {    if (aData->mColorData->mColor.GetUnit() == eCSSUnit_Null) {      // color: color      nsHTMLValue value;      if (NS_CONTENT_ATTR_NOT_THERE !=          aAttributes->GetAttribute(nsHTMLAtoms::color, value)) {        if (((eHTMLUnit_Color == value.GetUnit())) ||            (eHTMLUnit_ColorName == value.GetUnit()))          aData->mColorData->mColor.SetColorValue(value.GetColorValue());      }    }  }  else if (aData->mTextData && aData->mSID == eStyleStruct_TextReset) {    nsHTMLValue value;    if (NS_CONTENT_ATTR_NOT_THERE !=        aAttributes->GetAttribute(nsHTMLAtoms::color, value)) {      if (((eHTMLUnit_Color == value.GetUnit())) ||          (eHTMLUnit_ColorName == value.GetUnit()))        aData->mTextData->mDecoration.SetIntValue(NS_STYLE_TEXT_DECORATION_OVERRIDE_ALL, eCSSUnit_Enumerated);    }  }  nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);}