mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Remove some unreachable stub code for en (half an em) and cap (cap-height metric of font) units that we never create. (Bug 458878) r+sr=bzbarsky a=blocking1.9.1+
This commit is contained in:
parent
a5129c520e
commit
3e2cdc7772
@ -489,9 +489,7 @@ nsCSSDeclaration::AppendCSSValueToString(nsCSSProperty aProperty,
|
||||
case eCSSUnit_Cicero: aResult.AppendLiteral("cc"); break;
|
||||
|
||||
case eCSSUnit_EM: aResult.AppendLiteral("em"); break;
|
||||
case eCSSUnit_EN: aResult.AppendLiteral("en"); break;
|
||||
case eCSSUnit_XHeight: aResult.AppendLiteral("ex"); break;
|
||||
case eCSSUnit_CapHeight: aResult.AppendLiteral("cap"); break;
|
||||
case eCSSUnit_Char: aResult.AppendLiteral("ch"); break;
|
||||
|
||||
case eCSSUnit_Pixel: aResult.AppendLiteral("px"); break;
|
||||
|
@ -139,10 +139,8 @@ enum nsCSSUnit {
|
||||
// Length units - relative
|
||||
// Font relative measure
|
||||
eCSSUnit_EM = 800, // (float) == current font size
|
||||
eCSSUnit_EN = 801, // (float) .5 em
|
||||
eCSSUnit_XHeight = 802, // (float) distance from top of lower case x to baseline
|
||||
eCSSUnit_CapHeight = 803, // (float) distance from top of uppercase case H to baseline
|
||||
eCSSUnit_Char = 804, // (float) number of characters, used for width with monospace font
|
||||
eCSSUnit_XHeight = 801, // (float) distance from top of lower case x to baseline
|
||||
eCSSUnit_Char = 802, // (float) number of characters, used for width with monospace font
|
||||
|
||||
// Screen relative measure
|
||||
eCSSUnit_Pixel = 900, // (float) CSS pixel unit
|
||||
|
@ -198,9 +198,6 @@ static nscoord CalcLengthWith(const nsCSSValue& aValue,
|
||||
return NSToCoordRoundWithClamp(aValue.GetFloatValue() * float(aFontSize));
|
||||
// XXX scale against font metrics height instead?
|
||||
}
|
||||
case eCSSUnit_EN: {
|
||||
return NSToCoordRoundWithClamp((aValue.GetFloatValue() * float(aFontSize)) / 2.0f);
|
||||
}
|
||||
case eCSSUnit_XHeight: {
|
||||
nsFont font = aStyleFont->mFont;
|
||||
font.size = aFontSize;
|
||||
@ -209,11 +206,6 @@ static nscoord CalcLengthWith(const nsCSSValue& aValue,
|
||||
fm->GetXHeight(xHeight);
|
||||
return NSToCoordRoundWithClamp(aValue.GetFloatValue() * float(xHeight));
|
||||
}
|
||||
case eCSSUnit_CapHeight: {
|
||||
NS_NOTYETIMPLEMENTED("cap height unit");
|
||||
nscoord capHeight = ((aFontSize / 3) * 2); // XXX HACK!
|
||||
return NSToCoordRoundWithClamp(aValue.GetFloatValue() * float(capHeight));
|
||||
}
|
||||
case eCSSUnit_Char: {
|
||||
nsFont font = aStyleFont->mFont;
|
||||
font.size = aFontSize;
|
||||
|
Loading…
Reference in New Issue
Block a user