Bug 1449039 part 10 - Remove PredefinedCounterStyleTable. r?emilio draft
authorXidorn Quan <me@upsuper.org>
Tue, 27 Mar 2018 12:51:10 +1100
changeset 772903 9e2aae75638cdfa3c03696f3bd4dfacbc87da7a9
parent 772902 06afc4e5baec4b0c7560c1d6ae5175987a04c0bb
child 772904 074a00b0e4674d31dbb4559c31a35a04fb81f192
push id104082
push userxquan@mozilla.com
push dateTue, 27 Mar 2018 05:11:12 +0000
reviewersemilio
bugs1449039
milestone61.0a1
Bug 1449039 part 10 - Remove PredefinedCounterStyleTable. r?emilio MozReview-Commit-ID: AeYqai3Nr72
layout/style/nsCSSProps.cpp
layout/style/nsCSSProps.h
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -79,17 +79,16 @@ const char* const kCSSRawProperties[eCSS
 };
 
 using namespace mozilla;
 
 static int32_t gPropertyTableRefCount;
 static nsStaticCaseInsensitiveNameTable* gPropertyTable;
 static nsStaticCaseInsensitiveNameTable* gFontDescTable;
 static nsStaticCaseInsensitiveNameTable* gCounterDescTable;
-static nsStaticCaseInsensitiveNameTable* gPredefinedCounterStyleTable;
 static nsDataHashtable<nsCStringHashKey,nsCSSPropertyID>* gPropertyIDLNameTable;
 
 static const char* const kCSSRawFontDescs[] = {
 #define CSS_FONT_DESC(name_, method_) #name_,
 #include "nsCSSFontDescList.h"
 #undef CSS_FONT_DESC
 };
 
@@ -158,27 +157,23 @@ CreateStaticTable(const char* const aRaw
 
 void
 nsCSSProps::AddRefTable(void)
 {
   if (0 == gPropertyTableRefCount++) {
     MOZ_ASSERT(!gPropertyTable, "pre existing array!");
     MOZ_ASSERT(!gFontDescTable, "pre existing array!");
     MOZ_ASSERT(!gCounterDescTable, "pre existing array!");
-    MOZ_ASSERT(!gPredefinedCounterStyleTable, "pre existing array!");
     MOZ_ASSERT(!gPropertyIDLNameTable, "pre existing array!");
 
     gPropertyTable = CreateStaticTable(
         kCSSRawProperties, eCSSProperty_COUNT_with_aliases);
     gFontDescTable = CreateStaticTable(kCSSRawFontDescs, eCSSFontDesc_COUNT);
     gCounterDescTable = CreateStaticTable(
         kCSSRawCounterDescs, eCSSCounterDesc_COUNT);
-    gPredefinedCounterStyleTable = CreateStaticTable(
-        kCSSRawPredefinedCounterStyles,
-        ArrayLength(kCSSRawPredefinedCounterStyles));
 
     gPropertyIDLNameTable = new nsDataHashtable<nsCStringHashKey,nsCSSPropertyID>;
     for (nsCSSPropertyID p = nsCSSPropertyID(0);
          size_t(p) < ArrayLength(kIDLNameTable);
          p = nsCSSPropertyID(p + 1)) {
       if (kIDLNameTable[p]) {
         gPropertyIDLNameTable->Put(nsDependentCString(kIDLNameTable[p]), p);
       }
@@ -294,19 +289,16 @@ nsCSSProps::ReleaseTable(void)
     gPropertyTable = nullptr;
 
     delete gFontDescTable;
     gFontDescTable = nullptr;
 
     delete gCounterDescTable;
     gCounterDescTable = nullptr;
 
-    delete gPredefinedCounterStyleTable;
-    gPredefinedCounterStyleTable = nullptr;
-
     delete gPropertyIDLNameTable;
     gPropertyIDLNameTable = nullptr;
   }
 }
 
 /* static */ bool
 nsCSSProps::IsInherited(nsCSSPropertyID aProperty)
 {
@@ -455,34 +447,16 @@ nsCSSProps::LookupCounterDesc(const nsAS
 
 nsCSSCounterDesc
 nsCSSProps::LookupCounterDesc(const nsACString& aProperty)
 {
   MOZ_ASSERT(gCounterDescTable, "no lookup table, needs addref");
   return nsCSSCounterDesc(gCounterDescTable->Lookup(aProperty));
 }
 
-bool
-nsCSSProps::IsPredefinedCounterStyle(const nsAString& aStyle)
-{
-  MOZ_ASSERT(gPredefinedCounterStyleTable,
-             "no lookup table, needs addref");
-  return gPredefinedCounterStyleTable->Lookup(aStyle) !=
-    nsStaticCaseInsensitiveNameTable::NOT_FOUND;
-}
-
-bool
-nsCSSProps::IsPredefinedCounterStyle(const nsACString& aStyle)
-{
-  MOZ_ASSERT(gPredefinedCounterStyleTable,
-             "no lookup table, needs addref");
-  return gPredefinedCounterStyleTable->Lookup(aStyle) !=
-    nsStaticCaseInsensitiveNameTable::NOT_FOUND;
-}
-
 const nsCString&
 nsCSSProps::GetStringValue(nsCSSPropertyID aProperty)
 {
   MOZ_ASSERT(gPropertyTable, "no lookup table, needs addref");
   if (gPropertyTable) {
     return gPropertyTable->GetStringValue(int32_t(aProperty));
   } else {
     static nsDependentCString sNullStr("");
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -296,20 +296,16 @@ public:
   // Same but for @font-face descriptors
   static nsCSSFontDesc LookupFontDesc(const nsAString& aProperty);
   static nsCSSFontDesc LookupFontDesc(const nsACString& aProperty);
 
   // For @counter-style descriptors
   static nsCSSCounterDesc LookupCounterDesc(const nsAString& aProperty);
   static nsCSSCounterDesc LookupCounterDesc(const nsACString& aProperty);
 
-  // For predefined counter styles which need to be lower-cased during parse
-  static bool IsPredefinedCounterStyle(const nsAString& aStyle);
-  static bool IsPredefinedCounterStyle(const nsACString& aStyle);
-
   // 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);
 
   // Given a CSS Property and a Property Enum Value
   // Return back a const nsString& representation of the
   // value. Return back nullstr if no value is found