Followup to Bug 522320 bustage fix: in modified chunk of nsCSSDeclaration, check nsCSSValue unit before querying its integer value

This commit is contained in:
Daniel Holbert 2009-10-21 17:25:30 -07:00
parent 0902ed0ee1
commit a151e00614

View File

@ -977,11 +977,13 @@ nsCSSDeclaration::GetValue(nsCSSProperty aProperty,
return NS_OK;
}
if (style.GetIntValue() != NS_FONT_STYLE_NORMAL) {
if (style.GetUnit() != eCSSUnit_Enumerated ||
style.GetIntValue() != NS_FONT_STYLE_NORMAL) {
AppendCSSValueToString(eCSSProperty_font_style, style, aValue);
aValue.Append(PRUnichar(' '));
}
if (variant.GetIntValue() != NS_FONT_VARIANT_NORMAL) {
if (variant.GetUnit() != eCSSUnit_Enumerated ||
variant.GetIntValue() != NS_FONT_VARIANT_NORMAL) {
AppendCSSValueToString(eCSSProperty_font_variant, variant, aValue);
aValue.Append(PRUnichar(' '));
}