Bug 1250342 patch 3: Rename preference layout.css.text-align-true-value.enabled to layout.css.text-align-unsafe-value.enabled . r=mats
MozReview-Commit-ID: 6IKnuvxZQcI
This commit is contained in:
@@ -142,7 +142,7 @@ using namespace mozilla::gfx;
|
||||
#define GRID_TEMPLATE_SUBGRID_ENABLED_PREF_NAME "layout.css.grid-template-subgrid-value.enabled"
|
||||
#define STICKY_ENABLED_PREF_NAME "layout.css.sticky.enabled"
|
||||
#define DISPLAY_CONTENTS_ENABLED_PREF_NAME "layout.css.display-contents.enabled"
|
||||
#define TEXT_ALIGN_TRUE_ENABLED_PREF_NAME "layout.css.text-align-true-value.enabled"
|
||||
#define TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME "layout.css.text-align-unsafe-value.enabled"
|
||||
#define FLOAT_LOGICAL_VALUES_ENABLED_PREF_NAME "layout.css.float-logical-values.enabled"
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -284,20 +284,20 @@ DisplayContentsEnabledPrefChangeCallback(const char* aPrefName, void* aClosure)
|
||||
}
|
||||
}
|
||||
|
||||
// When the pref "layout.css.text-align-true-value.enabled" changes, this
|
||||
// When the pref "layout.css.text-align-unsafe-value.enabled" changes, this
|
||||
// function is called to let us update kTextAlignKTable & kTextAlignLastKTable,
|
||||
// to selectively disable or restore the entries for "true" in those tables.
|
||||
static void
|
||||
TextAlignTrueEnabledPrefChangeCallback(const char* aPrefName, void* aClosure)
|
||||
TextAlignUnsafeEnabledPrefChangeCallback(const char* aPrefName, void* aClosure)
|
||||
{
|
||||
NS_ASSERTION(strcmp(aPrefName, TEXT_ALIGN_TRUE_ENABLED_PREF_NAME) == 0,
|
||||
"Did you misspell " TEXT_ALIGN_TRUE_ENABLED_PREF_NAME " ?");
|
||||
NS_ASSERTION(strcmp(aPrefName, TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME) == 0,
|
||||
"Did you misspell " TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME " ?");
|
||||
|
||||
static bool sIsInitialized;
|
||||
static int32_t sIndexOfTrueInTextAlignTable;
|
||||
static int32_t sIndexOfTrueInTextAlignLastTable;
|
||||
bool isTextAlignTrueEnabled =
|
||||
Preferences::GetBool(TEXT_ALIGN_TRUE_ENABLED_PREF_NAME, false);
|
||||
bool isTextAlignUnsafeEnabled =
|
||||
Preferences::GetBool(TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME, false);
|
||||
|
||||
if (!sIsInitialized) {
|
||||
// First run: find the position of "true" in kTextAlignKTable.
|
||||
@@ -315,10 +315,10 @@ TextAlignTrueEnabledPrefChangeCallback(const char* aPrefName, void* aClosure)
|
||||
// depending on whether the pref is enabled vs. disabled.
|
||||
MOZ_ASSERT(sIndexOfTrueInTextAlignTable >= 0);
|
||||
nsCSSProps::kTextAlignKTable[sIndexOfTrueInTextAlignTable].mKeyword =
|
||||
isTextAlignTrueEnabled ? eCSSKeyword_unsafe : eCSSKeyword_UNKNOWN;
|
||||
isTextAlignUnsafeEnabled ? eCSSKeyword_unsafe : eCSSKeyword_UNKNOWN;
|
||||
MOZ_ASSERT(sIndexOfTrueInTextAlignLastTable >= 0);
|
||||
nsCSSProps::kTextAlignLastKTable[sIndexOfTrueInTextAlignLastTable].mKeyword =
|
||||
isTextAlignTrueEnabled ? eCSSKeyword_unsafe : eCSSKeyword_UNKNOWN;
|
||||
isTextAlignUnsafeEnabled ? eCSSKeyword_unsafe : eCSSKeyword_UNKNOWN;
|
||||
}
|
||||
|
||||
// When the pref "layout.css.float-logical-values.enabled" changes, this
|
||||
@@ -662,19 +662,19 @@ nsLayoutUtils::IsGridTemplateSubgridValueEnabled()
|
||||
}
|
||||
|
||||
bool
|
||||
nsLayoutUtils::IsTextAlignTrueValueEnabled()
|
||||
nsLayoutUtils::IsTextAlignUnsafeValueEnabled()
|
||||
{
|
||||
static bool sTextAlignTrueValueEnabled;
|
||||
static bool sTextAlignTrueValueEnabledPrefCached = false;
|
||||
static bool sTextAlignUnsafeValueEnabled;
|
||||
static bool sTextAlignUnsafeValueEnabledPrefCached = false;
|
||||
|
||||
if (!sTextAlignTrueValueEnabledPrefCached) {
|
||||
sTextAlignTrueValueEnabledPrefCached = true;
|
||||
Preferences::AddBoolVarCache(&sTextAlignTrueValueEnabled,
|
||||
TEXT_ALIGN_TRUE_ENABLED_PREF_NAME,
|
||||
if (!sTextAlignUnsafeValueEnabledPrefCached) {
|
||||
sTextAlignUnsafeValueEnabledPrefCached = true;
|
||||
Preferences::AddBoolVarCache(&sTextAlignUnsafeValueEnabled,
|
||||
TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME,
|
||||
false);
|
||||
}
|
||||
|
||||
return sTextAlignTrueValueEnabled;
|
||||
return sTextAlignUnsafeValueEnabled;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -7578,14 +7578,14 @@ nsLayoutUtils::Initialize()
|
||||
Preferences::RegisterCallback(StickyEnabledPrefChangeCallback,
|
||||
STICKY_ENABLED_PREF_NAME);
|
||||
StickyEnabledPrefChangeCallback(STICKY_ENABLED_PREF_NAME, nullptr);
|
||||
Preferences::RegisterCallback(TextAlignTrueEnabledPrefChangeCallback,
|
||||
TEXT_ALIGN_TRUE_ENABLED_PREF_NAME);
|
||||
Preferences::RegisterCallback(TextAlignUnsafeEnabledPrefChangeCallback,
|
||||
TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME);
|
||||
Preferences::RegisterCallback(DisplayContentsEnabledPrefChangeCallback,
|
||||
DISPLAY_CONTENTS_ENABLED_PREF_NAME);
|
||||
DisplayContentsEnabledPrefChangeCallback(DISPLAY_CONTENTS_ENABLED_PREF_NAME,
|
||||
nullptr);
|
||||
TextAlignTrueEnabledPrefChangeCallback(TEXT_ALIGN_TRUE_ENABLED_PREF_NAME,
|
||||
nullptr);
|
||||
TextAlignUnsafeEnabledPrefChangeCallback(TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME,
|
||||
nullptr);
|
||||
Preferences::RegisterCallback(FloatLogicalValuesEnabledPrefChangeCallback,
|
||||
FLOAT_LOGICAL_VALUES_ENABLED_PREF_NAME);
|
||||
FloatLogicalValuesEnabledPrefChangeCallback(FLOAT_LOGICAL_VALUES_ENABLED_PREF_NAME,
|
||||
|
||||
Reference in New Issue
Block a user