nsresult rv = ((nsISupportsArray*)aRules)->Count(&cnt);
nsresult rv = aRules->Count(&cnt);
StyleContextImpl::FindChildWithRules(const nsIAtom* aPseudoTag,                                      const nsISupportsArray* aRules,                                     nsIStyleContext*& aResult){  aResult = nsnull;  if ((nsnull != mChild) || (nsnull != mEmptyChild)) {    StyleContextImpl* child;    PRInt32 ruleCount;    if (aRules) {      PRUint32 cnt;      nsresult rv = ((nsISupportsArray*)aRules)->Count(&cnt);       // XXX bogus cast -- aRules should not be const      if (NS_FAILED(rv)) return rv;      ruleCount = cnt;    }    else      ruleCount = 0;    if (0 == ruleCount) {      if (nsnull != mEmptyChild) {        child = mEmptyChild;        do {          if ((0 == child->mDataCode) &&  // only look at children with un-twiddled data              (aPseudoTag == child->mPseudoTag)) {            aResult = child;            break;          }          child = child->mNextSibling;        } while (child != mEmptyChild);      }    }    else if (nsnull != mChild) {      PRUint32 hash = 0;      aRules->EnumerateForwards(HashStyleRule, &hash);      child = mChild;      do {        PRUint32 cnt;        if ((0 == child->mDataCode) &&  // only look at children with un-twiddled data            (child->mRuleHash == hash) &&            (child->mPseudoTag == aPseudoTag) &&            (nsnull != child->mRules) &&            NS_SUCCEEDED(child->mRules->Count(&cnt)) &&             (PRInt32)cnt == ruleCount) {          if (child->mRules->Equals(aRules)) {            aResult = child;            break;          }        }        child = child->mNextSibling;      } while (child != mChild);    }  }  NS_IF_ADDREF(aResult);  return NS_OK;}