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:
L. David Baron 2016-02-23 09:41:48 -08:00
parent 44d6843d2e
commit ec4c382804
7 changed files with 28 additions and 28 deletions

View File

@ -139,7 +139,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
@ -281,20 +281,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.
@ -312,10 +312,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
@ -659,19 +659,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
@ -7538,14 +7538,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,

View File

@ -2291,7 +2291,7 @@ public:
* Checks whether support for the CSS text-align (and -moz-text-align-last)
* 'true' value is enabled.
*/
static bool IsTextAlignTrueValueEnabled();
static bool IsTextAlignUnsafeValueEnabled();
/**
* Checks if CSS variables are currently enabled.

View File

@ -307,7 +307,7 @@ fails-if(!cocoaWidget||OSX==1006||OSX==1007) != osx-font-smoothing.html osx-font
fails-if(!cocoaWidget||OSX==1006||OSX==1007) != osx-font-smoothing-2.html osx-font-smoothing-2-notref.html
== osx-font-smoothing-2.html osx-font-smoothing-2-ref.html
pref(layout.css.text-align-true-value.enabled,true) == text-align-true.html text-align-true-ref.html
pref(layout.css.text-align-unsafe-value.enabled,true) == text-align-true.html text-align-true-ref.html
# stray control chars should be visible by default, bug 1099557
!= control-chars-01a.html control-chars-01-notref.html

View File

@ -14887,7 +14887,7 @@ CSSParserImpl::ParseTextAlign(nsCSSValue& aValue, const KTableEntry aTable[])
return false;
}
if (!nsLayoutUtils::IsTextAlignTrueValueEnabled()) {
if (!nsLayoutUtils::IsTextAlignUnsafeValueEnabled()) {
aValue = left;
return true;
}

View File

@ -813,7 +813,7 @@ public:
static const KTableEntry kStackSizingKTable[];
static const KTableEntry kTableLayoutKTable[];
// Not const because we modify its entries when the pref
// "layout.css.text-align-true-value.enabled" changes:
// "layout.css.text-align-unsafe-value.enabled" changes:
static KTableEntry kTextAlignKTable[];
static KTableEntry kTextAlignLastKTable[];
static const KTableEntry kTextCombineUprightKTable[];

View File

@ -7300,7 +7300,7 @@ if (IsCSSPropertyPrefEnabled("layout.css.unset-value.enabled")) {
if (IsCSSPropertyPrefEnabled("layout.css.filters.enabled")) {
gCSSProperties["filter"].invalid_values.push("drop-shadow(unset, 2px 2px)", "drop-shadow(2px 2px, unset)");
}
if (IsCSSPropertyPrefEnabled("layout.css.text-align-true-value.enabled")) {
if (IsCSSPropertyPrefEnabled("layout.css.text-align-unsafe-value.enabled")) {
gCSSProperties["text-align"].other_values.push("true left");
} else {
gCSSProperties["text-align"].invalid_values.push("true left");

View File

@ -2346,8 +2346,8 @@ pref("layout.css.convertFromNode.enabled", false);
pref("layout.css.convertFromNode.enabled", true);
#endif
// Is support for CSS "text-align: true X" enabled?
pref("layout.css.text-align-true-value.enabled", false);
// Is support for CSS "text-align: unsafe X" enabled?
pref("layout.css.text-align-unsafe-value.enabled", false);
// Is support for CSS "float: inline-{start,end}" and
// "clear: inline-{start,end}" enabled?