Bug 1281965 - Sometimes we don't want to add when searching for a family. r=jfkthame

--HG--
extra : rebase_source : c1b0ecc2cc221395947326c440e01cbb6b0044fc
This commit is contained in:
Milan Sreckovic 2017-11-09 18:38:30 -05:00
parent a4ddff0ca6
commit 7d3551d146
2 changed files with 8 additions and 3 deletions

View File

@ -748,7 +748,8 @@ gfxPlatformFontList::FindAndAddFamilies(const nsAString& aFamily,
if (!familyEntry && !mOtherFamilyNamesInitialized && !IsASCII(aFamily)) {
InitOtherFamilyNames(!(aFlags & FindFamiliesFlags::eForceOtherFamilyNamesLoading));
familyEntry = mOtherFamilyNames.GetWeak(key);
if (!familyEntry && !mOtherFamilyNamesInitialized) {
if (!familyEntry && !mOtherFamilyNamesInitialized &&
!(aFlags & FindFamiliesFlags::eNoAddToNamesMissedWhenSearching)) {
// localized family names load timed out, add name to list of
// names to check after localized names are loaded
if (!mOtherNamesMissed) {
@ -1577,7 +1578,8 @@ gfxPlatformFontList::CleanupLoader()
if (mOtherNamesMissed) {
for (auto it = mOtherNamesMissed->Iter(); !it.Done(); it.Next()) {
if (FindFamily(it.Get()->GetKey(),
FindFamiliesFlags::eForceOtherFamilyNamesLoading)) {
(FindFamiliesFlags::eForceOtherFamilyNamesLoading |
FindFamiliesFlags::eNoAddToNamesMissedWhenSearching))) {
forceReflow = true;
ForceGlobalReflow();
break;

View File

@ -150,7 +150,10 @@ public:
// family" names to add to the font list. This is used to avoid
// a recursive search when using FindFamily to find a potential base
// family name for a styled variant.
eNoSearchForLegacyFamilyNames = 1 << 1
eNoSearchForLegacyFamilyNames = 1 << 1,
// If set, FindAndAddFamilies will not add a missing entry to mOtherNamesMissed
eNoAddToNamesMissedWhenSearching = 1 << 2
};
// Find family(ies) matching aFamily and append to the aOutput array