Bug 1250342 patch 1: Rename exposed keyword for text-align: true to unsafe. r?mats draft
authorL. David Baron <dbaron@dbaron.org>
Mon, 22 Feb 2016 18:24:42 -0800
changeset 333256 4e93b851a50ccafbb91e7c05326f7856b5327ced
parent 332881 789a12291942763bc1e3a89f97e0b82dc1c9d00b
child 333257 ad48f91f9131946bf1e7f1940128809cb1d78d83
push id11309
push userdbaron@mozilla.com
push dateTue, 23 Feb 2016 02:25:45 +0000
reviewersmats
bugs1250342
milestone47.0a1
Bug 1250342 patch 1: Rename exposed keyword for text-align: true to unsafe. r?mats MozReview-Commit-ID: LYR3LtMtT2Q
layout/base/nsLayoutUtils.cpp
layout/style/nsCSSKeywordList.h
layout/style/nsCSSProps.cpp
layout/style/nsComputedDOMStyle.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -294,33 +294,33 @@ TextAlignTrueEnabledPrefChangeCallback(c
   static int32_t sIndexOfTrueInTextAlignTable;
   static int32_t sIndexOfTrueInTextAlignLastTable;
   bool isTextAlignTrueEnabled =
     Preferences::GetBool(TEXT_ALIGN_TRUE_ENABLED_PREF_NAME, false);
 
   if (!sIsInitialized) {
     // First run: find the position of "true" in kTextAlignKTable.
     sIndexOfTrueInTextAlignTable =
-      nsCSSProps::FindIndexOfKeyword(eCSSKeyword_true,
+      nsCSSProps::FindIndexOfKeyword(eCSSKeyword_unsafe,
                                      nsCSSProps::kTextAlignKTable);
     // First run: find the position of "true" in kTextAlignLastKTable.
     sIndexOfTrueInTextAlignLastTable =
-      nsCSSProps::FindIndexOfKeyword(eCSSKeyword_true,
+      nsCSSProps::FindIndexOfKeyword(eCSSKeyword_unsafe,
                                      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_true : eCSSKeyword_UNKNOWN;
+    isTextAlignTrueEnabled ? eCSSKeyword_unsafe : eCSSKeyword_UNKNOWN;
   MOZ_ASSERT(sIndexOfTrueInTextAlignLastTable >= 0);
   nsCSSProps::kTextAlignLastKTable[sIndexOfTrueInTextAlignLastTable].mKeyword =
-    isTextAlignTrueEnabled ? eCSSKeyword_true : eCSSKeyword_UNKNOWN;
+    isTextAlignTrueEnabled ? 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,
--- a/layout/style/nsCSSKeywordList.h
+++ b/layout/style/nsCSSKeywordList.h
@@ -588,17 +588,16 @@ CSS_KEY(traditional, traditional)
 CSS_KEY(translate, translate)
 CSS_KEY(translate3d, translate3d)
 CSS_KEY(translatex, translatex)
 CSS_KEY(translatey, translatey)
 CSS_KEY(translatez, translatez)
 CSS_KEY(transparent, transparent) // for nsComputedDOMStyle only
 CSS_KEY(triangle, triangle)
 CSS_KEY(tri-state, tri_state)
-CSS_KEY(true, true)
 CSS_KEY(ultra-condensed, ultra_condensed)
 CSS_KEY(ultra-expanded, ultra_expanded)
 CSS_KEY(under, under)
 CSS_KEY(underline, underline)
 CSS_KEY(unicase, unicase)
 CSS_KEY(unsafe, unsafe)
 CSS_KEY(unset, unset)
 CSS_KEY(uppercase, uppercase)
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -1954,30 +1954,30 @@ KTableEntry nsCSSProps::kTextAlignKTable
   { eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT },
   { eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER },
   { eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY },
   { eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
   { eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT },
   { eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT },
   { eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT },
   { eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END },
-  { eCSSKeyword_true, NS_STYLE_TEXT_ALIGN_TRUE },
+  { eCSSKeyword_unsafe, NS_STYLE_TEXT_ALIGN_TRUE },
   { eCSSKeyword_match_parent, NS_STYLE_TEXT_ALIGN_MATCH_PARENT },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 KTableEntry nsCSSProps::kTextAlignLastKTable[] = {
   { eCSSKeyword_auto, NS_STYLE_TEXT_ALIGN_AUTO },
   { eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT },
   { eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT },
   { eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER },
   { eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY },
   { eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT },
   { eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END },
-  { eCSSKeyword_true, NS_STYLE_TEXT_ALIGN_TRUE },
+  { eCSSKeyword_unsafe, NS_STYLE_TEXT_ALIGN_TRUE },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kTextCombineUprightKTable[] = {
   { eCSSKeyword_none, NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE },
   { eCSSKeyword_all, NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL },
   { eCSSKeyword_digits, NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2 }, // w/o number ==> 2
   { eCSSKeyword_UNKNOWN, -1 }
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -3529,17 +3529,17 @@ nsComputedDOMStyle::CreateTextAlignValue
 {
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(aAlign, aTable));
   if (!aAlignTrue) {
     return val.forget();
   }
 
   RefPtr<nsROCSSPrimitiveValue> first = new nsROCSSPrimitiveValue;
-  first->SetIdent(eCSSKeyword_true);
+  first->SetIdent(eCSSKeyword_unsafe);
 
   RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(false);
   valueList->AppendCSSValue(first.forget());
   valueList->AppendCSSValue(val.forget());
   return valueList.forget();
 }
 
 already_AddRefed<CSSValue>