Bug 1367860 (part 4) - Update CSS fallback font when lang changes (stylo). r=manishearth

MozReview-Commit-ID: AeBHXc0mIVn
This commit is contained in:
Nazim Can Altinova 2017-08-18 14:42:13 -07:00
Родитель 13b2e9b2ef
Коммит 9c729626a5
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -2397,7 +2397,14 @@ Gecko_nsStyleFont_PrefillDefaultForGeneric(nsStyleFont* aFont,
{
const nsFont* defaultFont = ThreadSafeGetDefaultFontHelper(aPresContext, aFont->mLanguage,
aGenericId);
aFont->mFont.fontlist = defaultFont->fontlist;
// In case of just the language changing, the parent could have had no generic,
// which Gecko just does regular cascading with. Do the same.
// This can only happen in the case where the language changed but the family did not
if (aGenericId != kGenericFont_NONE) {
aFont->mFont.fontlist = defaultFont->fontlist;
} else {
aFont->mFont.fontlist.SetDefaultFontType(defaultFont->fontlist.GetDefaultFontType());
}
}
void