diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp index df70a0d6be7c..6a8a61f74e7c 100644 --- a/gfx/thebes/gfxPlatformFontList.cpp +++ b/gfx/thebes/gfxPlatformFontList.cpp @@ -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; diff --git a/gfx/thebes/gfxPlatformFontList.h b/gfx/thebes/gfxPlatformFontList.h index 4fef56a2df4c..9358ebd74440 100644 --- a/gfx/thebes/gfxPlatformFontList.h +++ b/gfx/thebes/gfxPlatformFontList.h @@ -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