Bug 1261754 - Part 1: Improve static assertions for style struct bits. r=dholbert
authorCameron McCormack <cam@mcc.id.au>
Tue, 12 Apr 2016 15:52:39 +1000
changeset 330630 03f2fa739af3868ed423dca1d6f6f950aab99ba9
parent 330629 12f6413904b1a3e16e3dcebb58546b54b79a42f5
child 330631 c01a5b49b4b713c1fb0e9fbb4b5686a0fc754443
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1261754
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1261754 - Part 1: Improve static assertions for style struct bits. r=dholbert
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!