Bug 1457802 part 1 - Remove nsCSSProps::GetColorName which is unused. r=heycam
authorXidorn Quan <me@upsuper.org>
Mon, 30 Apr 2018 09:20:53 +1000
changeset 472480 0bd3f2f95b5534428500314d70b273f2b6cb488f
parent 472479 c36098a8e83f0238196d0bfbaad1f81ae84ae28e
child 472481 3347987c7a8ac8eb9070c1a9ac88f146dd696668
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1457802
milestone61.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 1457802 part 1 - Remove nsCSSProps::GetColorName which is unused. r=heycam MozReview-Commit-ID: GybpTh6GYYx
layout/style/nsCSSProps.cpp
layout/style/nsCSSProps.h
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -2088,33 +2088,16 @@ nsCSSProps::ValueToKeyword(int32_t aValu
   if (keyword == eCSSKeyword_UNKNOWN) {
     static nsDependentCString sNullStr("");
     return sNullStr;
   } else {
     return nsCSSKeywords::GetStringValue(keyword);
   }
 }
 
-bool nsCSSProps::GetColorName(int32_t aPropValue, nsCString &aStr)
-{
-  bool rv = false;
-
-  // first get the keyword corresponding to the property Value from the color table
-  nsCSSKeyword keyword = ValueToKeywordEnum(aPropValue, kColorKTable);
-
-  // next get the name as a string from the keywords table
-  if (keyword != eCSSKeyword_UNKNOWN) {
-    nsCSSKeywords::AddRefTable();
-    aStr = nsCSSKeywords::GetStringValue(keyword);
-    nsCSSKeywords::ReleaseTable();
-    rv = true;
-  }
-  return rv;
-}
-
 const CSSPropFlags nsCSSProps::kFlagsTable[eCSSProperty_COUNT] = {
 #define CSS_PROP_LONGHAND(name_, id_, method_, flags_, ...) flags_,
 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, ...) flags_,
 #include "mozilla/ServoCSSPropList.h"
 #undef CSS_PROP_SHORTHAND
 #undef CSS_PROP_LONGHAND
 };
 
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -95,20 +95,16 @@ public:
   // Same but for @font-face descriptors
   static nsCSSFontDesc LookupFontDesc(const nsAString& aProperty);
 
   // Given a property enum, get the string value
   static const nsCString& GetStringValue(nsCSSPropertyID aProperty);
   static const nsCString& GetStringValue(nsCSSFontDesc aFontDesc);
   static const nsCString& GetStringValue(nsCSSCounterDesc aCounterDesc);
 
-  // Get a color name for a predefined color value like buttonhighlight or activeborder
-  // Sets the aStr param to the name of the propertyID
-  static bool GetColorName(int32_t aPropID, nsCString &aStr);
-
   // Returns the index of |aKeyword| in |aTable|, if it exists there;
   // otherwise, returns -1.
   // NOTE: Generally, clients should call FindKeyword() instead of this method.
   static int32_t FindIndexOfKeyword(nsCSSKeyword aKeyword,
                                     const KTableEntry aTable[]);
 
   // Find |aKeyword| in |aTable|, if found set |aValue| to its corresponding value.
   // If not found, return false and do not set |aValue|.