mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 06:38:36 +00:00
Port to revised pres-context API
This commit is contained in:
parent
1ed8e1edae
commit
1b3c96e6a4
@ -477,7 +477,8 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes,
|
||||
nsStyleFont* font = (nsStyleFont*)aContext->GetMutableStyleData(eStyleStruct_Font);
|
||||
const nsFont& defaultFont = aPresContext->GetDefaultFont();
|
||||
const nsFont& defaultFixedFont = aPresContext->GetDefaultFixedFont();
|
||||
PRInt32 scaler = aPresContext->GetFontScaler();
|
||||
PRInt32 scaler;
|
||||
aPresContext->GetFontScaler(scaler);
|
||||
float scaleFactor = nsStyleUtil::GetScalingFactor(scaler);
|
||||
font->mFont.size = nsStyleUtil::CalcFontPointSize(3, (PRInt32)defaultFont.size, scaleFactor);
|
||||
font->mFixedFont.size = nsStyleUtil::CalcFontPointSize(3, (PRInt32)defaultFixedFont.size, scaleFactor);
|
||||
|
@ -261,7 +261,8 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes,
|
||||
size = 3 + size; // XXX should be BASEFONT, not three
|
||||
}
|
||||
size = ((0 < size) ? ((size < 8) ? size : 7) : 1);
|
||||
PRInt32 scaler = aPresContext->GetFontScaler();
|
||||
PRInt32 scaler;
|
||||
aPresContext->GetFontScaler(scaler);
|
||||
float scaleFactor = nsStyleUtil::GetScalingFactor(scaler);
|
||||
font->mFont.size =
|
||||
nsStyleUtil::CalcFontPointSize(size, (PRInt32)defaultFont.size,
|
||||
|
@ -976,7 +976,8 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration,
|
||||
// font-size: enum, length, percent, inherit
|
||||
if (eCSSUnit_Enumerated == ourFont->mSize.GetUnit()) {
|
||||
PRInt32 value = ourFont->mSize.GetIntValue();
|
||||
PRInt32 scaler = aPresContext->GetFontScaler();
|
||||
PRInt32 scaler;
|
||||
aPresContext->GetFontScaler(scaler);
|
||||
float scaleFactor = nsStyleUtil::GetScalingFactor(scaler);
|
||||
|
||||
if ((NS_STYLE_FONT_SIZE_XXSMALL <= value) &&
|
||||
|
@ -926,7 +926,8 @@ nsFormControlFrame::GetFont(nsIPresContext* aPresContext, nsFont& aFont)
|
||||
aFont.name = "Arial"; // XXX windows specific font
|
||||
aFont.weight = NS_FONT_WEIGHT_NORMAL;
|
||||
const nsFont& normal = aPresContext->GetDefaultFont();
|
||||
PRInt32 scaler = aPresContext->GetFontScaler();
|
||||
PRInt32 scaler;
|
||||
aPresContext->GetFontScaler(scaler);
|
||||
float scaleFactor = nsStyleUtil::GetScalingFactor(scaler);
|
||||
PRInt32 fontIndex = nsStyleUtil::FindNextSmallerFontSize(aFont.size, (PRInt32)normal.size, scaleFactor);
|
||||
aFont.size = nsStyleUtil::CalcFontPointSize(fontIndex, (PRInt32)normal.size, scaleFactor);
|
||||
|
@ -477,7 +477,8 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes,
|
||||
nsStyleFont* font = (nsStyleFont*)aContext->GetMutableStyleData(eStyleStruct_Font);
|
||||
const nsFont& defaultFont = aPresContext->GetDefaultFont();
|
||||
const nsFont& defaultFixedFont = aPresContext->GetDefaultFixedFont();
|
||||
PRInt32 scaler = aPresContext->GetFontScaler();
|
||||
PRInt32 scaler;
|
||||
aPresContext->GetFontScaler(scaler);
|
||||
float scaleFactor = nsStyleUtil::GetScalingFactor(scaler);
|
||||
font->mFont.size = nsStyleUtil::CalcFontPointSize(3, (PRInt32)defaultFont.size, scaleFactor);
|
||||
font->mFixedFont.size = nsStyleUtil::CalcFontPointSize(3, (PRInt32)defaultFixedFont.size, scaleFactor);
|
||||
|
@ -261,7 +261,8 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes,
|
||||
size = 3 + size; // XXX should be BASEFONT, not three
|
||||
}
|
||||
size = ((0 < size) ? ((size < 8) ? size : 7) : 1);
|
||||
PRInt32 scaler = aPresContext->GetFontScaler();
|
||||
PRInt32 scaler;
|
||||
aPresContext->GetFontScaler(scaler);
|
||||
float scaleFactor = nsStyleUtil::GetScalingFactor(scaler);
|
||||
font->mFont.size =
|
||||
nsStyleUtil::CalcFontPointSize(size, (PRInt32)defaultFont.size,
|
||||
|
@ -926,7 +926,8 @@ nsFormControlFrame::GetFont(nsIPresContext* aPresContext, nsFont& aFont)
|
||||
aFont.name = "Arial"; // XXX windows specific font
|
||||
aFont.weight = NS_FONT_WEIGHT_NORMAL;
|
||||
const nsFont& normal = aPresContext->GetDefaultFont();
|
||||
PRInt32 scaler = aPresContext->GetFontScaler();
|
||||
PRInt32 scaler;
|
||||
aPresContext->GetFontScaler(scaler);
|
||||
float scaleFactor = nsStyleUtil::GetScalingFactor(scaler);
|
||||
PRInt32 fontIndex = nsStyleUtil::FindNextSmallerFontSize(aFont.size, (PRInt32)normal.size, scaleFactor);
|
||||
aFont.size = nsStyleUtil::CalcFontPointSize(fontIndex, (PRInt32)normal.size, scaleFactor);
|
||||
|
@ -976,7 +976,8 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration,
|
||||
// font-size: enum, length, percent, inherit
|
||||
if (eCSSUnit_Enumerated == ourFont->mSize.GetUnit()) {
|
||||
PRInt32 value = ourFont->mSize.GetIntValue();
|
||||
PRInt32 scaler = aPresContext->GetFontScaler();
|
||||
PRInt32 scaler;
|
||||
aPresContext->GetFontScaler(scaler);
|
||||
float scaleFactor = nsStyleUtil::GetScalingFactor(scaler);
|
||||
|
||||
if ((NS_STYLE_FONT_SIZE_XXSMALL <= value) &&
|
||||
|
@ -976,7 +976,8 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration,
|
||||
// font-size: enum, length, percent, inherit
|
||||
if (eCSSUnit_Enumerated == ourFont->mSize.GetUnit()) {
|
||||
PRInt32 value = ourFont->mSize.GetIntValue();
|
||||
PRInt32 scaler = aPresContext->GetFontScaler();
|
||||
PRInt32 scaler;
|
||||
aPresContext->GetFontScaler(scaler);
|
||||
float scaleFactor = nsStyleUtil::GetScalingFactor(scaler);
|
||||
|
||||
if ((NS_STYLE_FONT_SIZE_XXSMALL <= value) &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user