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 {  aAttributes->GetAttribute(nsHTMLAtoms::size, value); nsHTMLUnit unit = value.GetUnit(); if (unit == eHTMLUnit_Integer || unit == eHTMLUnit_Enumerated) { PRInt32 size = value.GetIntValue(); if (unit == eHTMLUnit_Enumerated) size += 3;  size = ((0 < size) ? ((size < 8) ? size : 7) : 1); font.mSize.SetIntValue(size, eCSSUnit_Enumerated); } } }
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,                      nsRuleData* aData){  if (aData->mSID == eStyleStruct_Font) {    nsRuleDataFont& font = *(aData->mFontData);    nsHTMLValue value;        // face: string list    if (font.mFamily.GetUnit() == eCSSUnit_Null) {      if (aAttributes->GetAttribute(nsHTMLAtoms::face, value) !=          NS_CONTENT_ATTR_NOT_THERE &&          value.GetUnit() == eHTMLUnit_String) {        nsAutoString familyList;        value.GetStringValue(familyList);        if (!familyList.IsEmpty()) {          font.mFamily.SetStringValue(familyList, eCSSUnit_String);          font.mFamilyFromHTML = PR_TRUE;        }      }    }    // 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);        nsHTMLUnit unit = value.GetUnit();        if (unit == eHTMLUnit_Integer || unit == eHTMLUnit_Enumerated) {           PRInt32 size = value.GetIntValue();          if (unit == eHTMLUnit_Enumerated) // int (+/-)            size += 3;  // XXX should be BASEFONT, not three see bug 3875	                      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->mSID == eStyleStruct_Color) {    if (aData->mColorData->mColor.GetUnit() == eCSSUnit_Null) {      // color: color      nsHTMLValue value;      nscolor color;      if (NS_CONTENT_ATTR_NOT_THERE !=          aAttributes->GetAttribute(nsHTMLAtoms::color, value) &&          value.GetColorValue(color)) {        aData->mColorData->mColor.SetColorValue(color);      }    }  }  else if (aData->mSID == eStyleStruct_TextReset) {    // Make <a><font color="red">text</font></a> give the text a red underline    // in quirks mode.  The NS_STYLE_TEXT_DECORATION_OVERRIDE_ALL flag only    // affects quirks mode rendering.    nsHTMLValue value;    nscolor color;    if (NS_CONTENT_ATTR_NOT_THERE !=        aAttributes->GetAttribute(nsHTMLAtoms::color, value) &&        value.GetColorValue(color)) {      nsCSSValue& decoration = aData->mTextData->mDecoration;      PRInt32 newValue = NS_STYLE_TEXT_DECORATION_OVERRIDE_ALL;      if (decoration.GetUnit() == eCSSUnit_Enumerated) {        newValue |= decoration.GetIntValue();      }      decoration.SetIntValue(newValue, eCSSUnit_Enumerated);    }  }  nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);}