Bug 1457802 part 1 - Remove nsCSSProps::GetColorName which is unused. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Mon, 30 Apr 2018 09:20:53 +1000
changeset 789584 a82b0fe31e3e520270b58f623c6d8507ab58847f
parent 789583 a2f31605181857f20a6ce9d22439a590b0c17626
child 789585 7e0d22a1ecc3dec560d35f3f7aed9124ab253fa3
child 789587 e9efc3b61fb1422cbefd64514083528f3735ef8b
push id108290
push userxquan@mozilla.com
push dateSun, 29 Apr 2018 23:56:58 +0000
reviewersheycam
bugs1457802
milestone61.0a1
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|.