mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
32063: <font size=""> makes font tiny
This commit is contained in:
parent
27688a0fad
commit
94bc484b60
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user