diff --git a/layout/style/nsRuleNode.h b/layout/style/nsRuleNode.h index d87cda72a21..7398fa2fc0e 100644 --- a/layout/style/nsRuleNode.h +++ b/layout/style/nsRuleNode.h @@ -55,7 +55,7 @@ struct nsInheritedStyleData return aContext->AllocateFromShell(sz); } - void DestroyStructs(uint32_t aBits, nsPresContext* aContext) { + void DestroyStructs(uint64_t aBits, nsPresContext* aContext) { #define STYLE_STRUCT_INHERITED(name, checkdata_cb) \ void *name##Data = mStyleStructs[eStyleStruct_##name]; \ if (name##Data && !(aBits & NS_STYLE_INHERIT_BIT(name))) \ @@ -68,7 +68,7 @@ struct nsInheritedStyleData #undef STYLE_STRUCT_RESET } - void Destroy(uint32_t aBits, nsPresContext* aContext) { + void Destroy(uint64_t aBits, nsPresContext* aContext) { DestroyStructs(aBits, aContext); aContext->FreeToShell(sizeof(nsInheritedStyleData), this); } @@ -100,7 +100,7 @@ struct nsResetStyleData return aContext->AllocateFromShell(sz); } - void Destroy(uint32_t aBits, nsPresContext* aContext) { + void Destroy(uint64_t aBits, nsPresContext* aContext) { #define STYLE_STRUCT_RESET(name, checkdata_cb) \ void *name##Data = mStyleStructs[eStyleStruct_##name]; \ if (name##Data && !(aBits & NS_STYLE_INHERIT_BIT(name))) \ @@ -178,7 +178,7 @@ struct nsCachedStyleData #undef STYLE_STRUCT_RESET #undef STYLE_STRUCT_INHERITED - void Destroy(uint32_t aBits, nsPresContext* aContext) { + void Destroy(uint64_t aBits, nsPresContext* aContext) { if (mResetData) mResetData->Destroy(aBits, aContext); if (mInheritedData) diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index df8bc327675..ed1ef013476 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -43,14 +43,14 @@ nsStyleContext::nsStyleContext(nsStyleContext* aParent, mRuleNode(aRuleNode), mAllocations(nullptr), mCachedResetData(nullptr), - mBits(((uint32_t)aPseudoType) << NS_STYLE_CONTEXT_TYPE_SHIFT), + mBits(((uint64_t)aPseudoType) << NS_STYLE_CONTEXT_TYPE_SHIFT), mRefCnt(0) { // This check has to be done "backward", because if it were written the // more natural way it wouldn't fail even when it needed to. - static_assert((UINT32_MAX >> NS_STYLE_CONTEXT_TYPE_SHIFT) >= + static_assert((UINT64_MAX >> NS_STYLE_CONTEXT_TYPE_SHIFT) >= nsCSSPseudoElements::ePseudo_MAX, - "pseudo element bits no longer fit in a uint32_t"); + "pseudo element bits no longer fit in a uint64_t"); MOZ_ASSERT(aRuleNode); mNextSibling = this; @@ -262,7 +262,7 @@ nsStyleContext::GetUniqueStyleData(const nsStyleStructID& aSID) } SetStyle(aSID, result); - mBits &= ~nsCachedStyleData::GetBitForSID(aSID); + mBits &= ~static_cast(nsCachedStyleData::GetBitForSID(aSID)); return result; } diff --git a/layout/style/nsStyleContext.h b/layout/style/nsStyleContext.h index da20c04f895..d0b94ee61c5 100644 --- a/layout/style/nsStyleContext.h +++ b/layout/style/nsStyleContext.h @@ -211,7 +211,7 @@ public: #undef STYLE_STRUCT_INHERITED nsRuleNode* RuleNode() { return mRuleNode; } - void AddStyleBit(const uint32_t& aBit) { mBits |= aBit; } + void AddStyleBit(const uint64_t& aBit) { mBits |= aBit; } /* * Mark this style context's rule node (and its ancestors) to prevent @@ -430,7 +430,7 @@ protected: // sometimes allocate the mCachedResetData. nsResetStyleData* mCachedResetData; // Cached reset style data. nsInheritedStyleData mCachedInheritedData; // Cached inherited style data - uint32_t mBits; // Which structs are inherited from the + uint64_t mBits; // Which structs are inherited from the // parent context or owned by mRuleNode. uint32_t mRefCnt; }; diff --git a/layout/style/nsStyleStructFwd.h b/layout/style/nsStyleStructFwd.h index d6e845da94d..ee5087358e5 100644 --- a/layout/style/nsStyleStructFwd.h +++ b/layout/style/nsStyleStructFwd.h @@ -62,6 +62,6 @@ eStyleStruct_BackendOnly = nsStyleStructID_Length }; // A bit corresponding to each struct ID -#define NS_STYLE_INHERIT_BIT(sid_) (1 << int32_t(eStyleStruct_##sid_)) +#define NS_STYLE_INHERIT_BIT(sid_) (1 << uint64_t(eStyleStruct_##sid_)) #endif /* nsStyleStructFwd_h_ */