зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1573268 - Convert font.size.systemFontScale to static pref. r=njn
Converts font.size.systemFontScale to a static pref. Removes the function in nsLayoutUtils and does the float division directly in PresShell. Differential Revision: https://phabricator.services.mozilla.com/D41824 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
cccb97beb8
Коммит
1e91da4122
|
@ -10751,7 +10751,8 @@ nsSize PresShell::GetLayoutViewportSize() const {
|
|||
void PresShell::RecomputeFontSizeInflationEnabled() {
|
||||
mFontSizeInflationEnabled = DetermineFontSizeInflationState();
|
||||
|
||||
float fontScale = nsLayoutUtils::SystemFontScale();
|
||||
// Divide by 100 to convert the pref from a percentage to a fraction.
|
||||
float fontScale = StaticPrefs::font_size_systemFontScale() / 100.0f;
|
||||
if (fontScale == 0.0f) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -183,8 +183,6 @@ bool nsLayoutUtils::gPreventAssertInCompareTreePosition = false;
|
|||
typedef ScrollableLayerGuid::ViewID ViewID;
|
||||
typedef nsStyleTransformMatrix::TransformReferenceBox TransformReferenceBox;
|
||||
|
||||
/* static */
|
||||
uint32_t nsLayoutUtils::sSystemFontScale;
|
||||
/* static */
|
||||
uint32_t nsLayoutUtils::sZoomMaxPercent;
|
||||
/* static */
|
||||
|
@ -7973,8 +7971,6 @@ size_t nsLayoutUtils::SizeOfTextRunsForFrames(nsIFrame* aFrame,
|
|||
|
||||
/* static */
|
||||
void nsLayoutUtils::Initialize() {
|
||||
Preferences::AddUintVarCache(&sSystemFontScale, "font.size.systemFontScale",
|
||||
100);
|
||||
Preferences::AddUintVarCache(&sZoomMaxPercent, "zoom.maxPercent", 300);
|
||||
Preferences::AddUintVarCache(&sZoomMinPercent, "zoom.minPercent", 30);
|
||||
Preferences::AddBoolVarCache(&sInvalidationDebuggingIsEnabled,
|
||||
|
|
|
@ -2445,12 +2445,6 @@ class nsLayoutUtils {
|
|||
|
||||
static bool FontSizeInflationEnabled(nsPresContext* aPresContext);
|
||||
|
||||
/**
|
||||
* See comment above "font.size.systemFontScale" in
|
||||
* modules/libpref/init/all.js.
|
||||
*/
|
||||
static float SystemFontScale() { return sSystemFontScale / 100.0f; }
|
||||
|
||||
static float MaxZoom() { return sZoomMaxPercent / 100.0f; }
|
||||
|
||||
static float MinZoom() { return sZoomMinPercent / 100.0f; }
|
||||
|
@ -3009,7 +3003,6 @@ class nsLayoutUtils {
|
|||
const nsIFrame* aFrame);
|
||||
|
||||
private:
|
||||
static uint32_t sSystemFontScale;
|
||||
static uint32_t sZoomMaxPercent;
|
||||
static uint32_t sZoomMinPercent;
|
||||
static bool sInvalidationDebuggingIsEnabled;
|
||||
|
|
|
@ -2639,6 +2639,18 @@
|
|||
value: 0
|
||||
mirror: always
|
||||
|
||||
# This setting corresponds to a global text zoom setting affecting
|
||||
# all content that is not already subject to font size inflation.
|
||||
# It is interpreted as a percentage value that is applied on top
|
||||
# of the document's current text zoom setting.
|
||||
#
|
||||
# The resulting total zoom factor (text zoom * system font scale)
|
||||
# will be limited by zoom.minPercent and maxPercent.
|
||||
- name: font.size.systemFontScale
|
||||
type: uint32_t
|
||||
value: 100
|
||||
mirror: always
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Prefs starting with "full-screen-api."
|
||||
#---------------------------------------------------------------------------
|
||||
|
|
|
@ -3357,17 +3357,6 @@ pref("font.minimum-size.x-math", 0);
|
|||
pref("font.size.variable.x-math", 16);
|
||||
pref("font.size.monospace.x-math", 13);
|
||||
|
||||
/**
|
||||
* This setting corresponds to a global text zoom setting affecting
|
||||
* all content that is not already subject to font size inflation.
|
||||
* It is interpreted as a percentage value that is applied on top
|
||||
* of the document's current text zoom setting.
|
||||
*
|
||||
* The resulting total zoom factor (text zoom * system font scale)
|
||||
* will be limited by zoom.minPercent and maxPercent.
|
||||
*/
|
||||
pref("font.size.systemFontScale", 100);
|
||||
|
||||
/*
|
||||
* When enabled, the touch.radius and mouse.radius prefs allow events to be dispatched
|
||||
* to nearby elements that are sensitive to the event. See PositionedEventTargeting.cpp.
|
||||
|
|
Загрузка…
Ссылка в новой задаче