nsIContent* aParentContent, nsIAtom* aPseudoTag,
nsIContent* aContent,
PRInt32 CSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,                                         nsIContent* aParentContent,                                         nsIAtom* aPseudoTag,                                         nsIStyleContext* aParentContext,                                         nsISupportsArray* aResults){  NS_PRECONDITION(nsnull != aPresContext, "null arg");  NS_PRECONDITION(nsnull != aPseudoTag, "null arg");  NS_PRECONDITION(nsnull != aResults, "null arg");  PRInt32 matchCount = 0;  nsICSSStyleSheet*  child = mFirstChild;  while (nsnull != child) {    matchCount += child->RulesMatching(aPresContext, aParentContent, aPseudoTag,                                        aParentContext, aResults);    child = ((CSSStyleSheetImpl*)child)->mNext;  }  if (mWeightedRules.IsNotNull()) {    if (nsnull == mRuleHash) {      BuildHash();    }    PseudoEnumData data(aPresContext, aParentContent, aPseudoTag, aParentContext, aResults);    mRuleHash->EnumerateTagRules(aPseudoTag, PseudoEnumFunc, &data);    matchCount += data.mCount;#ifdef DEBUG_RULES    nsISupportsArray* list1;    nsISupportsArray* list2;    NS_NewISupportsArray(&list1);    NS_NewISupportsArray(&list2);    data.mResults = list1;    mRuleHash->EnumerateTagRules(aPseudoTag, PseudoEnumFunc, &data);    data.mResults = list2;    mWeightedRules->EnumerateBackwards(PseudoEnumWrap, &data);    NS_ASSERTION(list1->Equals(list2), "lists not equal");    NS_RELEASE(list1);    NS_RELEASE(list2);#endif  }  return matchCount;}