зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1573268 - Convert font.size.inflation.lineThreshold to a static pref. r=njn
Converts font.size.inflation.lineThreshold varcache pref to a static pref. Like previous revisions, this retains the member variable in PresShell. Differential Revision: https://phabricator.services.mozilla.com/D41662 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
6a396a8167
Коммит
1774881905
|
@ -1036,7 +1036,7 @@ void PresShell::Init(Document* aDocument, nsPresContext* aPresContext,
|
|||
mFontSizeInflationEmPerLine = StaticPrefs::font_size_inflation_emPerLine();
|
||||
mFontSizeInflationMinTwips = StaticPrefs::font_size_inflation_minTwips();
|
||||
mFontSizeInflationLineThreshold =
|
||||
nsLayoutUtils::FontSizeInflationLineThreshold();
|
||||
StaticPrefs::font_size_inflation_lineThreshold();
|
||||
mFontSizeInflationForceEnabled =
|
||||
nsLayoutUtils::FontSizeInflationForceEnabled();
|
||||
mFontSizeInflationDisabledInMasterProcess =
|
||||
|
|
|
@ -183,8 +183,6 @@ bool nsLayoutUtils::gPreventAssertInCompareTreePosition = false;
|
|||
typedef ScrollableLayerGuid::ViewID ViewID;
|
||||
typedef nsStyleTransformMatrix::TransformReferenceBox TransformReferenceBox;
|
||||
|
||||
/* static */
|
||||
uint32_t nsLayoutUtils::sFontSizeInflationLineThreshold;
|
||||
/* static */
|
||||
bool nsLayoutUtils::sFontSizeInflationForceEnabled;
|
||||
/* static */
|
||||
|
@ -7979,8 +7977,6 @@ size_t nsLayoutUtils::SizeOfTextRunsForFrames(nsIFrame* aFrame,
|
|||
|
||||
/* static */
|
||||
void nsLayoutUtils::Initialize() {
|
||||
Preferences::AddUintVarCache(&sFontSizeInflationLineThreshold,
|
||||
"font.size.inflation.lineThreshold");
|
||||
Preferences::AddBoolVarCache(&sFontSizeInflationForceEnabled,
|
||||
"font.size.inflation.forceEnabled");
|
||||
Preferences::AddBoolVarCache(&sFontSizeInflationDisabledInMasterProcess,
|
||||
|
|
|
@ -2445,14 +2445,6 @@ class nsLayoutUtils {
|
|||
|
||||
static bool FontSizeInflationEnabled(nsPresContext* aPresContext);
|
||||
|
||||
/**
|
||||
* See comment above "font.size.inflation.lineThreshold" in
|
||||
* modules/libpref/src/init/all.js .
|
||||
*/
|
||||
static uint32_t FontSizeInflationLineThreshold() {
|
||||
return sFontSizeInflationLineThreshold;
|
||||
}
|
||||
|
||||
static bool FontSizeInflationForceEnabled() {
|
||||
return sFontSizeInflationForceEnabled;
|
||||
}
|
||||
|
@ -3025,7 +3017,6 @@ class nsLayoutUtils {
|
|||
const nsIFrame* aFrame);
|
||||
|
||||
private:
|
||||
static uint32_t sFontSizeInflationLineThreshold;
|
||||
static bool sFontSizeInflationForceEnabled;
|
||||
static bool sFontSizeInflationDisabledInMasterProcess;
|
||||
static uint32_t sSystemFontScale;
|
||||
|
|
|
@ -194,7 +194,7 @@ void nsFontInflationData::UpdateISize(const ReflowInput& aReflowInput) {
|
|||
nscoord newNCAISize = ComputeDescendantISize(aReflowInput, nca);
|
||||
|
||||
// See comment above "font.size.inflation.lineThreshold" in
|
||||
// modules/libpref/src/init/all.js .
|
||||
// modules/libpref/src/init/StaticPrefList.yaml .
|
||||
PresShell* presShell = bfc->PresShell();
|
||||
uint32_t lineThreshold = presShell->FontSizeInflationLineThreshold();
|
||||
nscoord newTextThreshold = (newNCAISize * lineThreshold) / 100;
|
||||
|
|
|
@ -2579,6 +2579,30 @@
|
|||
value: 1
|
||||
mirror: always
|
||||
|
||||
# Since the goal of font size inflation is to avoid having to
|
||||
# repeatedly scroll side to side to read a block of text, and there are
|
||||
# a number of page layouts where a relatively small chunk of text is
|
||||
# better off not being inflated according to the same algorithm we use
|
||||
# for larger chunks of text, we want a threshold for an amount of text
|
||||
# that triggers font size inflation. This preference controls that
|
||||
# threshold.
|
||||
#
|
||||
# It controls the threshold used within an *approximation* of the
|
||||
# number of lines of text we use. In particular, if we assume that
|
||||
# each character (collapsing collapsible whitespace) has a width the
|
||||
# same as the em-size of the font (when, normally, it's actually quite
|
||||
# a bit smaller on average), this preference gives the percentage of a
|
||||
# number of lines of text we'd need to trigger inflation. This means
|
||||
# that a percentage of 100 means that we'd need a number of characters
|
||||
# (we know the font size and the width) equivalent to one line of
|
||||
# square text (which is actually a lot less than a real line of text).
|
||||
#
|
||||
# A value of 0 means there's no character length threshold.
|
||||
- name: font.size.inflation.lineThreshold
|
||||
type: uint32_t
|
||||
value: 400
|
||||
mirror: always
|
||||
|
||||
# This controls the percentage that fonts will be inflated, if font
|
||||
# size inflation is enabled. Essentially, if we have a specified font
|
||||
# size, s, and an inflated font size, i, this specifies that the ratio
|
||||
|
|
|
@ -3378,28 +3378,6 @@ pref("font.size.inflation.forceEnabled", false);
|
|||
* this pref.
|
||||
*/
|
||||
pref("font.size.inflation.disabledInMasterProcess", false);
|
||||
/*
|
||||
* Since the goal of font size inflation is to avoid having to
|
||||
* repeatedly scroll side to side to read a block of text, and there are
|
||||
* a number of page layouts where a relatively small chunk of text is
|
||||
* better of not being inflated according to the same algorithm we use
|
||||
* for larger chunks of text, we want a threshold for an amount of text
|
||||
* that triggers font size inflation. This preference controls that
|
||||
* threshold.
|
||||
*
|
||||
* It controls the threshold used within an *approximation* of the
|
||||
* number of lines of text we use. In particular, if we assume that
|
||||
* each character (collapsing collapsible whitespace) has a width the
|
||||
* same as the em-size of the font (when, normally, it's actually quite
|
||||
* a bit smaller on average), this preference gives the percentage of a
|
||||
* number of lines of text we'd need to trigger inflation. This means
|
||||
* that a percentage of 100 means that we'd need a number of characters
|
||||
* (we know the font size and the width) equivalent to one line of
|
||||
* square text (which is actually a lot less than a real line of text).
|
||||
*
|
||||
* A value of 0 means there's no character length threshold.
|
||||
*/
|
||||
pref("font.size.inflation.lineThreshold", 400);
|
||||
|
||||
/**
|
||||
* This setting corresponds to a global text zoom setting affecting
|
||||
|
|
Загрузка…
Ссылка в новой задаче