NS_ADDREF(mMedia); }  if (mMedia) { mMedia->AppendElement(aMedium); } return result;
END_MEDIA_CHANGE(mStyleSheet, doc)  return rv;
CSSStyleSheetImpl::AppendMedium(nsIAtom* aMedium){  nsresult result = NS_OK;  if (!mMedia) {    nsCOMPtr<nsISupportsArray> tmp;    result = NS_NewISupportsArray(getter_AddRefs(tmp));    NS_ENSURE_SUCCESS(result, result);    mMedia = new DOMMediaListImpl(tmp, this);    NS_ENSURE_TRUE(mMedia, NS_ERROR_OUT_OF_MEMORY);    NS_ADDREF(mMedia);  }  if (mMedia) {    mMedia->AppendElement(aMedium);  }  return result;}