Bug 1838415 - Introduce RFPTarget::FontVisibilityBaseSystem + LangPack. r=tjr

Differential Revision: https://phabricator.services.mozilla.com/D181235
This commit is contained in:
Tom Schuster 2023-06-26 07:17:38 +00:00
parent b374d67adf
commit 14d55c325c
3 changed files with 9 additions and 8 deletions

View file

@ -764,8 +764,12 @@ bool nsPresContext::UpdateFontVisibility() {
// Read the relevant pref depending on RFP/trackingProtection state
// to determine the visibility level to use.
int32_t level;
if (mDocument->ShouldResistFingerprinting(RFPTarget::Unknown)) {
level = StaticPrefs::layout_css_font_visibility_resistFingerprinting();
if (mDocument->ShouldResistFingerprinting(
RFPTarget::FontVisibilityBaseSystem)) {
level = int32_t(FontVisibility::Base);
} else if (mDocument->ShouldResistFingerprinting(
RFPTarget::FontVisibilityLangPack)) {
level = int32_t(FontVisibility::LangPack);
} else if (StaticPrefs::privacy_trackingprotection_enabled() ||
(isPrivate &&
StaticPrefs::privacy_trackingprotection_pbmode_enabled())) {

View file

@ -8562,12 +8562,6 @@
value: 3
mirror: always
# font-visibility setting when Resist Fingerprinting is enabled
- name: layout.css.font-visibility.resistFingerprinting
type: int32_t
value: 1
mirror: always
# Max font-visibility setting for Private Browsing contexts
# (The actual value used in a private-browsing context will be the lesser of
# the appropriate standard/trackingprotection/RFP value from above, and the

View file

@ -62,6 +62,9 @@ ITEM_VALUE(AudioSampleRate, 1llu << 38)
ITEM_VALUE(NavigatorConnection, 1llu << 39)
ITEM_VALUE(WindowDevicePixelRatio, 1llu << 40)
ITEM_VALUE(MouseEventScreenPoint, 1llu << 41)
// Visibility level of font families available to CSS font-matching
ITEM_VALUE(FontVisibilityBaseSystem, 1llu << 42)
ITEM_VALUE(FontVisibilityLangPack, 1llu << 43)
// !!! Don't forget to update kDefaultFingerintingProtections in nsRFPService.cpp
// if necessary.