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-24 10:40:30 -08:00
parent 7e36a8b6b2
commit f57b2437ab
7 changed files with 28 additions and 28 deletions

View File

@@ -142,7 +142,7 @@ using namespace mozilla::gfx;
#define GRID_TEMPLATE_SUBGRID_ENABLED_PREF_NAME "layout.css.grid-template-subgrid-value.enabled" #define GRID_TEMPLATE_SUBGRID_ENABLED_PREF_NAME "layout.css.grid-template-subgrid-value.enabled"
#define STICKY_ENABLED_PREF_NAME "layout.css.sticky.enabled" #define STICKY_ENABLED_PREF_NAME "layout.css.sticky.enabled"
#define DISPLAY_CONTENTS_ENABLED_PREF_NAME "layout.css.display-contents.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" #define FLOAT_LOGICAL_VALUES_ENABLED_PREF_NAME "layout.css.float-logical-values.enabled"
#ifdef DEBUG #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, // function is called to let us update kTextAlignKTable & kTextAlignLastKTable,
// to selectively disable or restore the entries for "true" in those tables. // to selectively disable or restore the entries for "true" in those tables.
static void 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, NS_ASSERTION(strcmp(aPrefName, TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME) == 0,
"Did you misspell " TEXT_ALIGN_TRUE_ENABLED_PREF_NAME " ?"); "Did you misspell " TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME " ?");
static bool sIsInitialized; static bool sIsInitialized;
static int32_t sIndexOfTrueInTextAlignTable; static int32_t sIndexOfTrueInTextAlignTable;
static int32_t sIndexOfTrueInTextAlignLastTable; static int32_t sIndexOfTrueInTextAlignLastTable;
bool isTextAlignTrueEnabled = bool isTextAlignUnsafeEnabled =
Preferences::GetBool(TEXT_ALIGN_TRUE_ENABLED_PREF_NAME, false); Preferences::GetBool(TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME, false);
if (!sIsInitialized) { if (!sIsInitialized) {
// First run: find the position of "true" in kTextAlignKTable. // 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. // depending on whether the pref is enabled vs. disabled.
MOZ_ASSERT(sIndexOfTrueInTextAlignTable >= 0); MOZ_ASSERT(sIndexOfTrueInTextAlignTable >= 0);
nsCSSProps::kTextAlignKTable[sIndexOfTrueInTextAlignTable].mKeyword = nsCSSProps::kTextAlignKTable[sIndexOfTrueInTextAlignTable].mKeyword =
isTextAlignTrueEnabled ? eCSSKeyword_unsafe : eCSSKeyword_UNKNOWN; isTextAlignUnsafeEnabled ? eCSSKeyword_unsafe : eCSSKeyword_UNKNOWN;
MOZ_ASSERT(sIndexOfTrueInTextAlignLastTable >= 0); MOZ_ASSERT(sIndexOfTrueInTextAlignLastTable >= 0);
nsCSSProps::kTextAlignLastKTable[sIndexOfTrueInTextAlignLastTable].mKeyword = 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 // When the pref "layout.css.float-logical-values.enabled" changes, this
@@ -662,19 +662,19 @@ nsLayoutUtils::IsGridTemplateSubgridValueEnabled()
} }
bool bool
nsLayoutUtils::IsTextAlignTrueValueEnabled() nsLayoutUtils::IsTextAlignUnsafeValueEnabled()
{ {
static bool sTextAlignTrueValueEnabled; static bool sTextAlignUnsafeValueEnabled;
static bool sTextAlignTrueValueEnabledPrefCached = false; static bool sTextAlignUnsafeValueEnabledPrefCached = false;
if (!sTextAlignTrueValueEnabledPrefCached) { if (!sTextAlignUnsafeValueEnabledPrefCached) {
sTextAlignTrueValueEnabledPrefCached = true; sTextAlignUnsafeValueEnabledPrefCached = true;
Preferences::AddBoolVarCache(&sTextAlignTrueValueEnabled, Preferences::AddBoolVarCache(&sTextAlignUnsafeValueEnabled,
TEXT_ALIGN_TRUE_ENABLED_PREF_NAME, TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME,
false); false);
} }
return sTextAlignTrueValueEnabled; return sTextAlignUnsafeValueEnabled;
} }
void void
@@ -7578,14 +7578,14 @@ nsLayoutUtils::Initialize()
Preferences::RegisterCallback(StickyEnabledPrefChangeCallback, Preferences::RegisterCallback(StickyEnabledPrefChangeCallback,
STICKY_ENABLED_PREF_NAME); STICKY_ENABLED_PREF_NAME);
StickyEnabledPrefChangeCallback(STICKY_ENABLED_PREF_NAME, nullptr); StickyEnabledPrefChangeCallback(STICKY_ENABLED_PREF_NAME, nullptr);
Preferences::RegisterCallback(TextAlignTrueEnabledPrefChangeCallback, Preferences::RegisterCallback(TextAlignUnsafeEnabledPrefChangeCallback,
TEXT_ALIGN_TRUE_ENABLED_PREF_NAME); TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME);
Preferences::RegisterCallback(DisplayContentsEnabledPrefChangeCallback, Preferences::RegisterCallback(DisplayContentsEnabledPrefChangeCallback,
DISPLAY_CONTENTS_ENABLED_PREF_NAME); DISPLAY_CONTENTS_ENABLED_PREF_NAME);
DisplayContentsEnabledPrefChangeCallback(DISPLAY_CONTENTS_ENABLED_PREF_NAME, DisplayContentsEnabledPrefChangeCallback(DISPLAY_CONTENTS_ENABLED_PREF_NAME,
nullptr); nullptr);
TextAlignTrueEnabledPrefChangeCallback(TEXT_ALIGN_TRUE_ENABLED_PREF_NAME, TextAlignUnsafeEnabledPrefChangeCallback(TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME,
nullptr); nullptr);
Preferences::RegisterCallback(FloatLogicalValuesEnabledPrefChangeCallback, Preferences::RegisterCallback(FloatLogicalValuesEnabledPrefChangeCallback,
FLOAT_LOGICAL_VALUES_ENABLED_PREF_NAME); FLOAT_LOGICAL_VALUES_ENABLED_PREF_NAME);
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) * Checks whether support for the CSS text-align (and -moz-text-align-last)
* 'true' value is enabled. * 'true' value is enabled.
*/ */
static bool IsTextAlignTrueValueEnabled(); static bool IsTextAlignUnsafeValueEnabled();
/** /**
* Checks if CSS variables are currently enabled. * 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 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 == 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 # stray control chars should be visible by default, bug 1099557
!= control-chars-01a.html control-chars-01-notref.html != control-chars-01a.html control-chars-01-notref.html

View File

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

View File

@@ -813,7 +813,7 @@ public:
static const KTableEntry kStackSizingKTable[]; static const KTableEntry kStackSizingKTable[];
static const KTableEntry kTableLayoutKTable[]; static const KTableEntry kTableLayoutKTable[];
// Not const because we modify its entries when the pref // 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 kTextAlignKTable[];
static KTableEntry kTextAlignLastKTable[]; static KTableEntry kTextAlignLastKTable[];
static const KTableEntry kTextCombineUprightKTable[]; static const KTableEntry kTextCombineUprightKTable[];

View File

@@ -7300,7 +7300,7 @@ if (IsCSSPropertyPrefEnabled("layout.css.unset-value.enabled")) {
if (IsCSSPropertyPrefEnabled("layout.css.filters.enabled")) { if (IsCSSPropertyPrefEnabled("layout.css.filters.enabled")) {
gCSSProperties["filter"].invalid_values.push("drop-shadow(unset, 2px 2px)", "drop-shadow(2px 2px, unset)"); 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"); gCSSProperties["text-align"].other_values.push("true left");
} else { } else {
gCSSProperties["text-align"].invalid_values.push("true left"); 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); pref("layout.css.convertFromNode.enabled", true);
#endif #endif
// Is support for CSS "text-align: true X" enabled? // Is support for CSS "text-align: unsafe X" enabled?
pref("layout.css.text-align-true-value.enabled", false); pref("layout.css.text-align-unsafe-value.enabled", false);
// Is support for CSS "float: inline-{start,end}" and // Is support for CSS "float: inline-{start,end}" and
// "clear: inline-{start,end}" enabled? // "clear: inline-{start,end}" enabled?