... |
... |
@@ -38,6 +38,7 @@ |
38
|
38
|
#include "mozilla/dom/ContentChild.h"
|
39
|
39
|
#include "mozilla/dom/ContentParent.h"
|
40
|
40
|
#include "mozilla/dom/ContentProcessMessageManager.h"
|
|
41
|
+#include "mozilla/dom/Document.h"
|
41
|
42
|
#include "mozilla/gfx/2D.h"
|
42
|
43
|
#include "mozilla/ipc/FileDescriptorUtils.h"
|
43
|
44
|
#include "mozilla/ResultExtensions.h"
|
... |
... |
@@ -1964,20 +1965,27 @@ void gfxPlatformFontList::MaybeRemoveCmap(gfxCharacterMap* aCharMap) { |
1964
|
1965
|
}
|
1965
|
1966
|
}
|
1966
|
1967
|
|
1967
|
|
-static void GetSystemUIFontFamilies([[maybe_unused]] nsAtom* aLangGroup,
|
|
1968
|
+static void GetSystemUIFontFamilies(const nsPresContext* aPresContext,
|
|
1969
|
+ [[maybe_unused]] nsAtom* aLangGroup,
|
1968
|
1970
|
nsTArray<nsCString>& aFamilies) {
|
1969
|
1971
|
// TODO: On macOS, use CTCreateUIFontForLanguage or such thing (though the
|
1970
|
1972
|
// code below ends up using [NSFont systemFontOfSize: 0.0].
|
1971
|
1973
|
nsFont systemFont;
|
1972
|
1974
|
gfxFontStyle fontStyle;
|
1973
|
1975
|
nsAutoString systemFontName;
|
1974
|
|
- if (nsContentUtils::ShouldResistFingerprinting()) {
|
|
1976
|
+ if (aPresContext && aPresContext->Document()
|
|
1977
|
+ ? aPresContext->Document()->ShouldResistFingerprinting(
|
|
1978
|
+ RFPTarget::Unknown)
|
|
1979
|
+ : nsContentUtils::ShouldResistFingerprinting(
|
|
1980
|
+ "aPresContext not available", RFPTarget::Unknown)) {
|
1975
|
1981
|
#ifdef XP_MACOSX
|
1976
|
1982
|
*aFamilies.AppendElement() = "-apple-system"_ns;
|
1977
|
|
-#else
|
|
1983
|
+ return;
|
|
1984
|
+#elif !defined(MOZ_WIDGET_ANDROID)
|
1978
|
1985
|
*aFamilies.AppendElement() = "sans-serif"_ns;
|
1979
|
|
-#endif
|
1980
|
1986
|
return;
|
|
1987
|
+#endif
|
|
1988
|
+ // Android uses already fixed fonts.
|
1981
|
1989
|
}
|
1982
|
1990
|
if (!LookAndFeel::GetFont(StyleSystemFont::Menu, systemFontName, fontStyle)) {
|
1983
|
1991
|
return;
|
... |
... |
@@ -2014,7 +2022,7 @@ void gfxPlatformFontList::ResolveGenericFontNames( |
2014
|
2022
|
MOZ_ASSERT(langGroup, "null lang group for pref lang");
|
2015
|
2023
|
|
2016
|
2024
|
if (aGenericType == StyleGenericFontFamily::SystemUi) {
|
2017
|
|
- GetSystemUIFontFamilies(langGroup, genericFamilies);
|
|
2025
|
+ GetSystemUIFontFamilies(aPresContext, langGroup, genericFamilies);
|
2018
|
2026
|
}
|
2019
|
2027
|
|
2020
|
2028
|
GetFontFamiliesFromGenericFamilies(
|