Bug 686281 - A static assertion to keep value correctness of NS_RULE_NODE_IS_ANIMATION_RULE; r=dbaron. draft
authorCJKu <cku@mozilla.com>
Thu, 10 Dec 2015 09:43:10 -0500
changeset 314891 d1c6e033afe631d08b9348b49e78c52aa377e8e0
parent 314890 a9ce493ee731a3ae8256094c6bb25cd802669067
child 314892 07966672ee7c2f67c43f2f643311d2dc746aedcb
push id8289
push usercku@mozilla.com
push dateThu, 10 Dec 2015 14:43:35 +0000
reviewersdbaron
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);