if (nsnull == mDocumentColorRule) { mDocumentColorRule = new HTMLDocumentColorRule(this); if (nsnull == mDocumentColorRule) { return NS_ERROR_OUT_OF_MEMORY; } NS_ADDREF(mDocumentColorRule); }
NS_IMETHODIMP HTMLStyleSheetImpl::SetDocumentForegroundColor(nscolor aColor){  if (nsnull == mDocumentColorRule) {    mDocumentColorRule = new HTMLDocumentColorRule(this);    if (nsnull == mDocumentColorRule) {      return NS_ERROR_OUT_OF_MEMORY;    }    NS_ADDREF(mDocumentColorRule);  }  mDocumentColorRule->mColor = aColor;  mDocumentColorRule->mForegroundSet = PR_TRUE;  return NS_OK;}