diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp
index c3b016d9f..09120da85 100644
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -1609,9 +1609,10 @@ nsRuleNode::ConvertChildrenToHash(int32_t aNumKids)
   if (!hash)
     return;
   for (nsRuleNode* curr = ChildrenList(); curr; curr = curr->mNextSibling) {
+    Key key = curr->GetKey();
     // This will never fail because of the initial size we gave the table.
     ChildrenHashEntry *entry = static_cast<ChildrenHashEntry*>(
-      PL_DHashTableAdd(hash, curr->mRule, fallible));
+      PL_DHashTableAdd(hash, &key, fallible));
     NS_ASSERTION(!entry->mRuleNode, "duplicate entries in list");
     entry->mRuleNode = curr;
   }
