Bug 1261754 - Part 1: Improve static assertions for style struct bits. r=dholbert draft
authorCameron McCormack <cam@mcc.id.au>
Tue, 12 Apr 2016 11:35:26 +1000
changeset 349670 8a0c1afec0a4ea5c378c00d844f9995b2a3619ab
parent 349571 21bf1af375c1fa8565ae3bb2e89bd1a0809363d4
child 349671 67e34ee48f8398804bb850b88a24464a9be90b8c
push id15154
push usercmccormack@mozilla.com
push dateTue, 12 Apr 2016 01:46:39 +0000
reviewersdholbert
bugs1261754
milestone48.0a1
Bug 1261754 - Part 1: Improve static assertions for style struct bits. r=dholbert MozReview-Commit-ID: HNgFdERsBNV
layout/style/nsStyleStruct.h
--- 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!