From 63219c0c606e82cdbc566f287424cd7fd7132f30 Mon Sep 17 00:00:00 2001 From: Pier Angelo Vendrame <pierov@torproject.org> Date: Thu, 29 Feb 2024 10:14:23 +0100 Subject: [PATCH] Bug 42377: Hidden fonts should obey the allow list. Hidden font families were automatically added to the `font.system.whitelist`, which is a behavior that conflicts with our font picking. --- gfx/thebes/gfxPlatformFontList.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp index 269f6695b9a15..1cd0d5ba47f3f 100644 --- a/gfx/thebes/gfxPlatformFontList.cpp +++ b/gfx/thebes/gfxPlatformFontList.cpp @@ -401,12 +401,6 @@ void gfxPlatformFontList::ApplyWhitelist() { AutoTArray<RefPtr<gfxFontFamily>, 128> accepted; bool whitelistedFontFound = false; for (const auto& entry : mFontFamilies) { - if (entry.GetData()->IsHidden()) { - // Hidden system fonts are exempt from whitelisting, but don't count - // towards determining whether we "kept" any (user-visible) fonts - accepted.AppendElement(entry.GetData()); - continue; - } nsAutoCString fontFamilyName(entry.GetKey()); ToLowerCase(fontFamilyName); if (familyNamesWhitelist.Contains(fontFamilyName)) { @@ -442,8 +436,7 @@ void gfxPlatformFontList::ApplyWhitelist( AutoTArray<fontlist::Family::InitData, 128> accepted; bool keptNonHidden = false; for (auto& f : aFamilies) { - if (f.mVisibility == FontVisibility::Hidden || - familyNamesWhitelist.Contains(f.mKey)) { + if (familyNamesWhitelist.Contains(f.mKey)) { accepted.AppendElement(f); if (f.mVisibility != FontVisibility::Hidden) { keptNonHidden = true; -- GitLab