Bug 1261754 - Part 1: Improve static assertions for style struct bits. r=dholbert
MozReview-Commit-ID: HNgFdERsBNV
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -93,17 +93,20 @@ struct nsStyleVisibility;
// Additional bits for nsRuleNode's mNoneBits:
#define NS_RULE_NODE_HAS_ANIMATION_DATA 0x80000000
static_assert(int(mozilla::SheetType::Count) - 1 <=
(NS_RULE_NODE_LEVEL_MASK >> NS_RULE_NODE_LEVEL_SHIFT),
"NS_RULE_NODE_LEVEL_MASK cannot fit SheetType");
-static_assert(NS_RULE_NODE_IS_ANIMATION_RULE == (1 << nsStyleStructID_Length),
+static_assert(NS_STYLE_INHERIT_MASK == (1 << nsStyleStructID_Length) - 1,
+ "NS_STYLE_INHERIT_MASK is not correct");
+
+static_assert((NS_RULE_NODE_IS_ANIMATION_RULE & NS_STYLE_INHERIT_MASK) == 0,
"NS_RULE_NODE_IS_ANIMATION_RULE must not overlap the style struct bits.");
/**
* These *_Simple types are used to map Gecko types to layout-equivalent but
* simpler Rust types, to aid Rust binding generation.
*
* If something in this types or the assertions below needs to change, ask
* bholley, heycam or emilio before!