Bug 1250342 patch 3: Rename preference layout.css.text-align-true-value.enabled to layout.css.text-align-unsafe-value.enabled . r=mats
authorL. David Baron <dbaron@dbaron.org>
Wed, 24 Feb 2016 10:40:30 -0800
changeset 321764 ae3a5d0dfc82dd0ca8b3b86fe8c7408b1c381d35
parent 321763 aef35da48cfd4e80a506a8fb1c8d432323eb2b9f
child 321765 aa5e5a12ce6376ab68e1da6fbcef1bc690b6ff76
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1250342
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/reftests/text/reftest.list
layout/style/nsCSSParser.cpp
layout/style/nsCSSProps.h
layout/style/test/property_database.js
modules/libpref/init/all.js
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -137,17 +137,17 @@ using namespace mozilla::image;
 using namespace mozilla::layers;
 using namespace mozilla::layout;
 using namespace mozilla::gfx;
 
 #define GRID_ENABLED_PREF_NAME "layout.css.grid.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 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
 // TODO: remove, see bug 598468.
 bool nsLayoutUtils::gPreventAssertInCompareTreePosition = false;
 #endif // DEBUG
 
 typedef FrameMetrics::ViewID ViewID;
@@ -279,30 +279,30 @@ DisplayContentsEnabledPrefChangeCallback
   // OK -- now, stomp on or restore the "contents" entry in kDisplayKTable,
   // depending on whether the pref is enabled vs. disabled.
   if (sIndexOfContentsInDisplayTable >= 0) {
     nsCSSProps::kDisplayKTable[sIndexOfContentsInDisplayTable].mKeyword =
       isDisplayContentsEnabled ? eCSSKeyword_contents : eCSSKeyword_UNKNOWN;
   }
 }
 
-// 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)
-{
-  NS_ASSERTION(strcmp(aPrefName, TEXT_ALIGN_TRUE_ENABLED_PREF_NAME) == 0,
-               "Did you misspell " TEXT_ALIGN_TRUE_ENABLED_PREF_NAME " ?");
+TextAlignUnsafeEnabledPrefChangeCallback(const char* aPrefName, void* aClosure)
+{
+  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.
     sIndexOfTrueInTextAlignTable =
       nsCSSProps::FindIndexOfKeyword(eCSSKeyword_unsafe,
                                      nsCSSProps::kTextAlignKTable);
     // First run: find the position of "true" in kTextAlignLastKTable.
     sIndexOfTrueInTextAlignLastTable =
@@ -310,20 +310,20 @@ TextAlignTrueEnabledPrefChangeCallback(c
                                      nsCSSProps::kTextAlignLastKTable);
     sIsInitialized = true;
   }
 
   // OK -- now, stomp on or restore the "true" entry in the keyword tables,
   // 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
 // function is called to let us update kFloatKTable & kClearKTable,
 // to selectively disable or restore the entries for logical values
 // (inline-start and inline-end) in those tables.
 static void
 FloatLogicalValuesEnabledPrefChangeCallback(const char* aPrefName,
@@ -657,29 +657,29 @@ nsLayoutUtils::IsGridTemplateSubgridValu
                                  GRID_TEMPLATE_SUBGRID_ENABLED_PREF_NAME,
                                  false);
   }
 
   return sGridTemplateSubgridValueEnabled;
 }
 
 bool
-nsLayoutUtils::IsTextAlignTrueValueEnabled()
-{
-  static bool sTextAlignTrueValueEnabled;
-  static bool sTextAlignTrueValueEnabledPrefCached = false;
-
-  if (!sTextAlignTrueValueEnabledPrefCached) {
-    sTextAlignTrueValueEnabledPrefCached = true;
-    Preferences::AddBoolVarCache(&sTextAlignTrueValueEnabled,
-                                 TEXT_ALIGN_TRUE_ENABLED_PREF_NAME,
+nsLayoutUtils::IsTextAlignUnsafeValueEnabled()
+{
+  static bool sTextAlignUnsafeValueEnabled;
+  static bool sTextAlignUnsafeValueEnabledPrefCached = false;
+
+  if (!sTextAlignUnsafeValueEnabledPrefCached) {
+    sTextAlignUnsafeValueEnabledPrefCached = true;
+    Preferences::AddBoolVarCache(&sTextAlignUnsafeValueEnabled,
+                                 TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME,
                                  false);
   }
 
-  return sTextAlignTrueValueEnabled;
+  return sTextAlignUnsafeValueEnabled;
 }
 
 void
 nsLayoutUtils::UnionChildOverflow(nsIFrame* aFrame,
                                   nsOverflowAreas& aOverflowAreas,
                                   FrameChildListIDs aSkipChildLists)
 {
   // Iterate over all children except pop-ups.
@@ -7573,24 +7573,24 @@ nsLayoutUtils::Initialize()
                                "svg.transform-box.enabled");
 
   Preferences::RegisterCallback(GridEnabledPrefChangeCallback,
                                 GRID_ENABLED_PREF_NAME);
   GridEnabledPrefChangeCallback(GRID_ENABLED_PREF_NAME, nullptr);
   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,
                                               nullptr);
 
   nsComputedDOMStyle::RegisterPrefChangeCallbacks();
 }
 
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -2286,17 +2286,17 @@ public:
    * value is enabled.
    */
   static bool IsGridTemplateSubgridValueEnabled();
 
   /**
    * 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.
    */
   static bool CSSVariablesEnabled()
   {
     return sCSSVariablesEnabled;
   }
--- a/layout/reftests/text/reftest.list
+++ b/layout/reftests/text/reftest.list
@@ -302,17 +302,17 @@ HTTP(..) == graphite-bidi-1.html graphit
 
 == auto-hyphenation-transformed-1.html auto-hyphenation-transformed-1-ref.html
 
 # osx-font-smoothing - with and without subpixel AA, only under OSX
 fails-if(!cocoaWidget||OSX==1006||OSX==1007) != osx-font-smoothing.html osx-font-smoothing-ref.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
 
-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
 != control-chars-01b.html control-chars-01-notref.html
 != control-chars-01c.html control-chars-01-notref.html
 != control-chars-01d.html control-chars-01-notref.html
 != control-chars-02.html control-chars-02-notref.html
 == control-chars-03a.html control-chars-03-ref.html
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -14882,17 +14882,17 @@ CSSParserImpl::ParseTextAlign(nsCSSValue
     return true;
   }
 
   nsCSSValue left;
   if (!ParseSingleTokenVariant(left, VARIANT_KEYWORD, aTable)) {
     return false;
   }
 
-  if (!nsLayoutUtils::IsTextAlignTrueValueEnabled()) {
+  if (!nsLayoutUtils::IsTextAlignUnsafeValueEnabled()) {
     aValue = left;
     return true;
   }
 
   nsCSSValue right;
   if (ParseSingleTokenVariant(right, VARIANT_KEYWORD, aTable)) {
     // 'true' must be combined with some other value than 'true'.
     if (left.GetIntValue() == NS_STYLE_TEXT_ALIGN_UNSAFE &&
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -808,17 +808,17 @@ public:
   static const KTableEntry kSpeakKTable[];
   static const KTableEntry kSpeakHeaderKTable[];
   static const KTableEntry kSpeakNumeralKTable[];
   static const KTableEntry kSpeakPunctuationKTable[];
   static const KTableEntry kSpeechRateKTable[];
   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[];
   static const KTableEntry kTextDecorationLineKTable[];
   static const KTableEntry kTextDecorationStyleKTable[];
   static const KTableEntry kTextEmphasisPositionKTable[];
   static const KTableEntry kTextEmphasisStyleFillKTable[];
   static const KTableEntry kTextEmphasisStyleShapeKTable[];
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -7295,17 +7295,17 @@ if (IsCSSPropertyPrefEnabled("layout.css
   gCSSProperties["box-shadow"].invalid_values.push("unset, 2px 2px", "2px 2px, unset", "inset unset");
   gCSSProperties["text-overflow"].invalid_values.push('"hello" unset', 'unset "hello"', 'clip unset', 'unset clip', 'unset inherit', 'unset none', 'initial unset');
   gCSSProperties["text-shadow"].invalid_values.push("unset, 2px 2px", "2px 2px, unset");
   gCSSProperties["transition"].invalid_values.push("2s unset");
   gCSSProperties["transition-property"].invalid_values.push("unset, color", "color, unset");
   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");
   }
 }
 
 if (IsCSSPropertyPrefEnabled("layout.css.float-logical-values.enabled")) {
   gCSSProperties["float"].other_values.push("inline-start");
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -2341,18 +2341,18 @@ pref("layout.css.getBoxQuads.enabled", t
 
 // Is support for GeometryUtils.convert*FromNode enabled?
 #ifdef RELEASE_BUILD
 pref("layout.css.convertFromNode.enabled", false);
 #else
 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?
 #if defined(MOZ_B2G) || defined(NIGHTLY_BUILD)
 pref("layout.css.float-logical-values.enabled", true);
 #else
 pref("layout.css.float-logical-values.enabled", false);
 #endif