nsresult rv = mDocument->StyleRuleAdded(this, styleRule); NS_ENSURE_SUCCESS(rv, rv);
mDocument->StyleRuleAdded(this, styleRule);
CSSStyleSheetImpl::StyleSheetLoaded(nsICSSStyleSheet*aSheet, PRBool aNotify){#ifdef DEBUG  nsCOMPtr<nsIStyleSheet> styleSheet(do_QueryInterface(aSheet));  NS_ASSERTION(styleSheet, "Sheet not implementing nsIStyleSheet!\n");  nsCOMPtr<nsIStyleSheet> parentSheet;  aSheet->GetParentSheet(*getter_AddRefs(parentSheet));  nsCOMPtr<nsIStyleSheet> thisSheet;  QueryInterface(NS_GET_IID(nsIStyleSheet), getter_AddRefs(thisSheet));  NS_ASSERTION(thisSheet == parentSheet, "We are being notified of a sheet load for a sheet that is not our child!\n");#endif    if (mDocument && aNotify) {    nsCOMPtr<nsICSSImportRule> ownerRule;    aSheet->GetOwnerRule(getter_AddRefs(ownerRule));        mozAutoDocUpdate updateBatch(mDocument, UPDATE_STYLE, PR_TRUE);    // XXXldb @import rules shouldn't even implement nsIStyleRule (but    // they do)!    nsCOMPtr<nsIStyleRule> styleRule(do_QueryInterface(ownerRule));        nsresult rv = mDocument->StyleRuleAdded(this, styleRule);    NS_ENSURE_SUCCESS(rv, rv);  }  return NS_OK;}