Bug 686281 - A static assertion to keep value correctness of NS_RULE_NODE_IS_ANIMATION_RULE; r=:dbaron. draft
authorCJKu <cku@mozilla.com>
Thu, 12 Nov 2015 17:04:51 +0800
changeset 308392 748780499bde65fba661032d1981f84284cdafa1
parent 308391 fda93af3c68e87555913605f7cc8786cad409345
child 511156 e59cb41cd0fd5930de710619e7edc39f4b204e44
push id7465
push usercku@mozilla.com
push dateThu, 12 Nov 2015 09:05:57 +0000
bugs686281
milestone45.0a1
Bug 686281 - A static assertion to keep value correctness of NS_RULE_NODE_IS_ANIMATION_RULE; r=:dbaron.
layout/style/nsStyleStruct.h
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -90,16 +90,18 @@ 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),
+  "NS_RULE_NODE_IS_ANIMATION_RULE must not overlap the style struct bits.");
 // The lifetime of these objects is managed by the presshell's arena.
 
 struct nsStyleFont {
   nsStyleFont(const nsFont& aFont, nsPresContext *aPresContext);
   nsStyleFont(const nsStyleFont& aStyleFont);
   explicit nsStyleFont(nsPresContext *aPresContext);
   ~nsStyleFont(void) {
     MOZ_COUNT_DTOR(nsStyleFont);