Bug 1448526 part 1 - Remove ComputedStyle::sDependencyTable. r?emilio draft
authorXidorn Quan <me@upsuper.org>
Mon, 26 Mar 2018 15:49:05 +1100
changeset 772428 eb04dd75e9b00636aa22f291b362e0c74eb0b77b
parent 772413 1faf8a9ac19f4bf5dcdfbe00bf97e82db3d2e928
child 772429 f1c7d19cde195fb90ac2627d16ed69d020de01b9
push id103909
push userxquan@mozilla.com
push dateMon, 26 Mar 2018 05:08:56 +0000
reviewersemilio
bugs1448526
milestone61.0a1
Bug 1448526 part 1 - Remove ComputedStyle::sDependencyTable. r?emilio MozReview-Commit-ID: Jh7Z4Rg354I
layout/style/ComputedStyle.cpp
layout/style/ComputedStyle.h
--- a/layout/style/ComputedStyle.cpp
+++ b/layout/style/ComputedStyle.cpp
@@ -58,26 +58,16 @@ enum DebugStyleStruct {
 
 #define STYLE_STRUCT(name, checkdata_cb) \
   static_assert(static_cast<int>(eDebugStyleStruct_##name) == \
                   static_cast<int>(eStyleStruct_##name), \
                 "Style struct IDs are not declared in order?");
 #include "nsStyleStructList.h"
 #undef STYLE_STRUCT
 
-const uint32_t ComputedStyle::sDependencyTable[] = {
-#define STYLE_STRUCT(name, checkdata_cb)
-#define STYLE_STRUCT_DEP(dep) NS_STYLE_INHERIT_BIT(dep) |
-#define STYLE_STRUCT_END() 0,
-#include "nsStyleStructList.h"
-#undef STYLE_STRUCT
-#undef STYLE_STRUCT_DEP
-#undef STYLE_STRUCT_END
-};
-
 #endif
 
 
 ComputedStyle::ComputedStyle(nsPresContext* aPresContext,
                              nsAtom* aPseudoTag,
                              CSSPseudoElementType aPseudoType,
                              ServoComputedDataForgotten aComputedValues)
   : mPresContext(aPresContext)
@@ -94,22 +84,16 @@ ComputedStyle::ComputedStyle(nsPresConte
                  static_cast<CSSPseudoElementTypeBase>(
                    CSSPseudoElementType::MAX),
                 "pseudo element bits no longer fit in a uint64_t");
 
 #define eStyleStruct_LastItem (nsStyleStructID_Length - 1)
   static_assert(NS_STYLE_INHERIT_MASK & NS_STYLE_INHERIT_BIT(LastItem),
                 "NS_STYLE_INHERIT_MASK must be bigger, and other bits shifted");
 #undef eStyleStruct_LastItem
-
-#ifdef DEBUG
-  static_assert(MOZ_ARRAY_LENGTH(ComputedStyle::sDependencyTable)
-                  == nsStyleStructID_Length,
-                "Number of items in dependency table doesn't match IDs");
-#endif
 }
 
 // TODO(stylo-everywhere): Remove aSamePointerStructs.
 nsChangeHint
 ComputedStyle::CalcStyleDifference(ComputedStyle* aNewContext,
                                     uint32_t* aEqualStructs,
                                     uint32_t* aSamePointerStructs,
                                     bool aIgnoreVariables)
--- a/layout/style/ComputedStyle.h
+++ b/layout/style/ComputedStyle.h
@@ -382,23 +382,13 @@ protected:
 
   // mBits stores a number of things:
   //  - It records (using the style struct bits) which structs are
   //    inherited from the parent context or owned by the rule node (i.e.,
   //    not owned by the style context).
   //  - It also stores the additional bits listed at the top of
   //    nsStyleStruct.h.
   uint64_t                mBits;
-
-#ifdef DEBUG
-  static bool DependencyAllowed(nsStyleStructID aOuterSID,
-                                nsStyleStructID aInnerSID)
-  {
-    return !!(sDependencyTable[aOuterSID] & GetBitForSID(aInnerSID));
-  }
-
-  static const uint32_t sDependencyTable[];
-#endif
 };
 
 } // namespace mozilla
 
 #endif