diff --git a/content/html/content/src/nsHTMLFontElement.cpp b/content/html/content/src/nsHTMLFontElement.cpp index f5bf19e28155..403fd9d8cd18 100644 --- a/content/html/content/src/nsHTMLFontElement.cpp +++ b/content/html/content/src/nsHTMLFontElement.cpp @@ -279,20 +279,22 @@ MapFontAttributesInto(const nsIHTMLMappedAttributes* aAttributes, (value.GetUnit() == eHTMLUnit_Enumerated)) { PRInt32 size = value.GetIntValue(); - if (value.GetUnit() == eHTMLUnit_Integer) { // int (+/-) - size = 3 + size; // XXX should be BASEFONT, not three - } - size = ((0 < size) ? ((size < 8) ? size : 7) : 1); - PRInt32 scaler; - aPresContext->GetFontScaler(&scaler); - float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); - font->mFont.size = - nsStyleUtil::CalcFontPointSize(size, (PRInt32)defaultFont.size, - scaleFactor, aPresContext); - font->mFixedFont.size = - nsStyleUtil::CalcFontPointSize(size, - (PRInt32)defaultFixedFont.size, - scaleFactor, aPresContext); + if (size != 0) { // bug 32063: ignore + if (value.GetUnit() == eHTMLUnit_Integer) { // int (+/-) + size = 3 + size; // XXX should be BASEFONT, not three + } + size = ((0 < size) ? ((size < 8) ? size : 7) : 1); + PRInt32 scaler; + aPresContext->GetFontScaler(&scaler); + float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); + font->mFont.size = + nsStyleUtil::CalcFontPointSize(size, (PRInt32)defaultFont.size, + scaleFactor, aPresContext); + font->mFixedFont.size = + nsStyleUtil::CalcFontPointSize(size, + (PRInt32)defaultFixedFont.size, + scaleFactor, aPresContext); + } } } } diff --git a/layout/html/content/src/nsHTMLFontElement.cpp b/layout/html/content/src/nsHTMLFontElement.cpp index f5bf19e28155..403fd9d8cd18 100644 --- a/layout/html/content/src/nsHTMLFontElement.cpp +++ b/layout/html/content/src/nsHTMLFontElement.cpp @@ -279,20 +279,22 @@ MapFontAttributesInto(const nsIHTMLMappedAttributes* aAttributes, (value.GetUnit() == eHTMLUnit_Enumerated)) { PRInt32 size = value.GetIntValue(); - if (value.GetUnit() == eHTMLUnit_Integer) { // int (+/-) - size = 3 + size; // XXX should be BASEFONT, not three - } - size = ((0 < size) ? ((size < 8) ? size : 7) : 1); - PRInt32 scaler; - aPresContext->GetFontScaler(&scaler); - float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); - font->mFont.size = - nsStyleUtil::CalcFontPointSize(size, (PRInt32)defaultFont.size, - scaleFactor, aPresContext); - font->mFixedFont.size = - nsStyleUtil::CalcFontPointSize(size, - (PRInt32)defaultFixedFont.size, - scaleFactor, aPresContext); + if (size != 0) { // bug 32063: ignore + if (value.GetUnit() == eHTMLUnit_Integer) { // int (+/-) + size = 3 + size; // XXX should be BASEFONT, not three + } + size = ((0 < size) ? ((size < 8) ? size : 7) : 1); + PRInt32 scaler; + aPresContext->GetFontScaler(&scaler); + float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); + font->mFont.size = + nsStyleUtil::CalcFontPointSize(size, (PRInt32)defaultFont.size, + scaleFactor, aPresContext); + font->mFixedFont.size = + nsStyleUtil::CalcFontPointSize(size, + (PRInt32)defaultFixedFont.size, + scaleFactor, aPresContext); + } } } }