Bug 1448526 part 1 - Remove ComputedStyle::sDependencyTable. r?emilio
MozReview-Commit-ID: Jh7Z4Rg354I
--- 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