CSSStyleRuleImpl* clone = new CSSStyleRuleImpl(*this, mDeclaration); if (!clone) { return nsnull;
NS_PRECONDITION(mRule, "can only be called when |GetCSSDeclaration| returned a declaration");  nsCOMPtr<nsIDocument> owningDoc; nsCOMPtr<nsIStyleSheet> sheet; mRule->GetStyleSheet(*getter_AddRefs(sheet)); if (sheet) { sheet->GetOwningDocument(*getter_AddRefs(owningDoc));
CSSStyleRuleImpl::DeclarationChanged(PRBool aHandleContainer){  CSSStyleRuleImpl* clone = new CSSStyleRuleImpl(*this, mDeclaration);  if (!clone) {    return nsnull;  }  NS_ADDREF(clone); // for return  if (aHandleContainer && mSheet) {    if (mParentRule) {      mSheet->ReplaceRuleInGroup(mParentRule, this, clone);    } else {      mSheet->ReplaceStyleRule(this, clone);    }  }  return clone;}