32063: <font size=""> makes font tiny

This commit is contained in:
pierre%netscape.com 2000-04-15 04:28:12 +00:00
parent 27688a0fad
commit 94bc484b60
2 changed files with 32 additions and 28 deletions

View File

@ -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 <font size="">
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);
}
}
}
}

View File

@ -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 <font size="">
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);
}
}
}
}