mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1031199 - Disallow aWeight = 0 when calling gfxUserFontSet::AddFontFace. r=jdaggett
This commit is contained in:
parent
3cc9012603
commit
10a5f23c40
@ -129,14 +129,14 @@ gfxUserFontSet::AddFontFace(const nsAString& aFamilyName,
|
||||
const nsString& aLanguageOverride,
|
||||
gfxSparseBitSet *aUnicodeRanges)
|
||||
{
|
||||
MOZ_ASSERT(aWeight != 0,
|
||||
"aWeight must not be 0; use NS_FONT_WEIGHT_NORMAL instead");
|
||||
|
||||
nsAutoString key(aFamilyName);
|
||||
ToLowerCase(key);
|
||||
|
||||
bool found;
|
||||
|
||||
if (aWeight == 0)
|
||||
aWeight = NS_FONT_WEIGHT_NORMAL;
|
||||
|
||||
// stretch, italic/oblique ==> zero implies normal
|
||||
|
||||
gfxMixedFontFamily *family = mFontFamilies.GetWeak(key, &found);
|
||||
|
@ -167,7 +167,7 @@ public:
|
||||
|
||||
|
||||
// add in a font face
|
||||
// weight - 0 == unknown, [100, 900] otherwise (multiples of 100)
|
||||
// weight - [100, 900] (multiples of 100)
|
||||
// stretch = [NS_FONT_STRETCH_ULTRA_CONDENSED, NS_FONT_STRETCH_ULTRA_EXPANDED]
|
||||
// italic style = constants in gfxFontConstants.h, e.g. NS_FONT_STYLE_NORMAL
|
||||
// TODO: support for unicode ranges not yet implemented
|
||||
|
@ -578,6 +578,9 @@ nsUserFontSet::InsertRule(nsCSSFontFaceRule* aRule, uint8_t aSheetType,
|
||||
unit = val.GetUnit();
|
||||
if (unit == eCSSUnit_Integer || unit == eCSSUnit_Enumerated) {
|
||||
weight = val.GetIntValue();
|
||||
if (weight == 0) {
|
||||
weight = NS_STYLE_FONT_STYLE_NORMAL;
|
||||
}
|
||||
} else if (unit == eCSSUnit_Normal) {
|
||||
weight = NS_STYLE_FONT_WEIGHT_NORMAL;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user