} else if (mDocument) {   rv = mDocument->GetDocumentCharacterSet(mCharset);
NS_IMETHODIMP CSSLoaderImpl::SetCharset(/*in*/ const nsAString &aCharsetSrc)    // public method for clients to set the charset if they know it    // NOTE: the SetCharset method will always get the preferred    // charset from the charset passed in unless it is the    // emptystring, which causes the default charset (that of the    // document, falling back to ISO-8869-1) to be set{  nsresult rv = NS_ERROR_NOT_AVAILABLE;  if (! aCharsetSrc.IsEmpty()) {    nsCOMPtr<nsICharsetAlias> calias(do_GetService(kCharsetAliasCID, &rv));    NS_ASSERTION(calias, "cannot find charset alias");    if (calias)    {      PRBool same = PR_FALSE;      rv = calias->Equals(aCharsetSrc, mCharset, &same);      if(NS_SUCCEEDED(rv) && same)      {        return NS_OK; // no difference, don't change it      }      rv = calias->GetPreferred(aCharsetSrc, mCharset);    }  } else if (mDocument) {    // GetDocumentCharacterSet returns a charset which already has    // alias resolution done    rv = mDocument->GetDocumentCharacterSet(mCharset);  }  if (mCharset.IsEmpty()) {      mCharset = NS_LITERAL_STRING("ISO-8859-1");      rv = NS_ERROR_NOT_AVAILABLE;  }  return rv;}