nsCOMPtr<nsICSSStyleRule> oldRule = mRule; mRule = oldRule->DeclarationChanged(PR_TRUE).get(); if (!mRule) return NS_ERROR_OUT_OF_MEMORY; nsrefcnt cnt = mRule->Release(); if (cnt == 0) { NS_NOTREACHED("container didn't take ownership"); mRule = nsnull; return NS_ERROR_UNEXPECTED; }  if (owningDoc) { owningDoc->StyleRuleChanged(sheet, oldRule, mRule); owningDoc->EndUpdate(UPDATE_STYLE); } return NS_OK;
return clone;
DOMCSSDeclarationImpl::DeclarationChanged(){  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));  }  if (owningDoc) {    owningDoc->BeginUpdate(UPDATE_STYLE);  }  nsCOMPtr<nsICSSStyleRule> oldRule = mRule;  mRule = oldRule->DeclarationChanged(PR_TRUE).get();  if (!mRule)    return NS_ERROR_OUT_OF_MEMORY;  nsrefcnt cnt = mRule->Release();  if (cnt == 0) {    NS_NOTREACHED("container didn't take ownership");    mRule = nsnull;    return NS_ERROR_UNEXPECTED;  }  if (owningDoc) {    owningDoc->StyleRuleChanged(sheet, oldRule, mRule);    owningDoc->EndUpdate(UPDATE_STYLE);  }  return NS_OK;}