if (!value || value->Type() != nsAttrValue::eInteger)
nsCompatibility mode = aData->mPresContext->CompatibilityMode(); if (!value || value->Type() != nsAttrValue::eInteger || eCompatibility_NavQuirks != mode)
void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,                           nsRuleData* aData){  if (aData->mSID == eStyleStruct_Position) {    // width: value    if (aData->mPositionData->mWidth.GetUnit() == eCSSUnit_Null) {      const nsAttrValue* value = aAttributes->GetAttr(nsHTMLAtoms::width);      if (value && value->Type() == nsAttrValue::eInteger) {        if (value->GetIntegerValue() > 0)          aData->mPositionData->mWidth.SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);         // else 0 implies auto for compatibility.      }      else if (value && value->Type() == nsAttrValue::ePercent) {        if (value->GetPercentValue() > 0.0f)          aData->mPositionData->mWidth.SetPercentValue(value->GetPercentValue());        // else 0 implies auto for compatibility      }    }    // height: value    if (aData->mPositionData->mHeight.GetUnit() == eCSSUnit_Null) {      const nsAttrValue* value = aAttributes->GetAttr(nsHTMLAtoms::height);      if (value && value->Type() == nsAttrValue::eInteger) {        if (value->GetIntegerValue() > 0)          aData->mPositionData->mHeight.SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);        // else 0 implies auto for compatibility.      }      else if (value && value->Type() == nsAttrValue::ePercent) {        if (value->GetPercentValue() > 0.0f)          aData->mPositionData->mHeight.SetPercentValue(value->GetPercentValue());        // else 0 implies auto for compatibility      }    }  }  else if (aData->mSID == eStyleStruct_Text) {    if (aData->mTextData->mTextAlign.GetUnit() == eCSSUnit_Null) {      // align: enum      const nsAttrValue* value = aAttributes->GetAttr(nsHTMLAtoms::align);      if (value && value->Type() == nsAttrValue::eEnum)        aData->mTextData->mTextAlign.SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);    }    if (aData->mTextData->mWhiteSpace.GetUnit() == eCSSUnit_Null) {      // nowrap: enum      if (aAttributes->GetAttr(nsHTMLAtoms::nowrap)) {        // See if our width is not a integer width.        const nsAttrValue* value = aAttributes->GetAttr(nsHTMLAtoms::width);        if (!value || value->Type() != nsAttrValue::eInteger)          aData->mTextData->mWhiteSpace.SetIntValue(NS_STYLE_WHITESPACE_NOWRAP, eCSSUnit_Enumerated);      }    }  }  else if (aData->mSID == eStyleStruct_TextReset) {    if (aData->mTextData->mVerticalAlign.GetUnit() == eCSSUnit_Null) {      // valign: enum      const nsAttrValue* value = aAttributes->GetAttr(nsHTMLAtoms::valign);      if (value && value->Type() == nsAttrValue::eEnum)        aData->mTextData->mVerticalAlign.SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);    }  }    nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);  nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);}