nsCOMPtr<nsICSSRule> rule;  result = mStyleSheet->GetStyleRuleAt(aIndex, *getter_AddRefs(rule)); if (rule) { result = CallQueryInterface(rule, aReturn); mRulesAccessed = PR_TRUE; } else if (result == NS_ERROR_ILLEGAL_VALUE) { result = NS_OK; }
result = CallQueryInterface(sheet, aReturn);
CSSRuleListImpl::Item(PRUint32 aIndex, nsIDOMCSSRule** aReturn){  nsresult result = NS_OK;  *aReturn = nsnull;  if (mStyleSheet) {    result = mStyleSheet->EnsureUniqueInner(); // needed to ensure rules have correct parent    if (NS_SUCCEEDED(result)) {      nsCOMPtr<nsICSSRule> rule;      result = mStyleSheet->GetStyleRuleAt(aIndex, *getter_AddRefs(rule));      if (rule) {        result = CallQueryInterface(rule, aReturn);        mRulesAccessed = PR_TRUE; // signal to never share rules again      } else if (result == NS_ERROR_ILLEGAL_VALUE) {        result = NS_OK; // per spec: "Return Value ... null if ... not a valid index."      }    }  }    return result;}