Bug 823124: Add diagnostic (and otherwise good-to-have) assertion that non-root rule nodes must have a non-null rule (and vice-versa).

This commit is contained in:
L. David Baron 2012-12-21 14:36:53 -05:00
parent a6929b0c24
commit 58405dbcaf

View File

@ -1299,6 +1299,9 @@ nsRuleNode::nsRuleNode(nsPresContext* aContext, nsRuleNode* aParent,
mNoneBits(0),
mRefCnt(0)
{
NS_ABORT_IF_FALSE(IsRoot() == !aRule,
"non-root rule nodes must have a rule");
mChildren.asVoid = nullptr;
MOZ_COUNT_CTOR(nsRuleNode);
NS_IF_ADDREF(mRule);