return result;
return NS_OK;
HTMLContentSink::ProcessStyleLink(nsIHTMLContent* aElement,                                  const nsString& aHref, const nsString& aRel,                                  const nsString& aTitle, const nsString& aType,                                  const nsString& aMedia, PRBool aBlockParser){  nsresult result = NS_OK;  if (aRel.EqualsIgnoreCase("stylesheet") ||       ((aRel.EqualsIgnoreCase("alternate stylesheet") ||        aRel.EqualsIgnoreCase("stylesheet alternate")) &&        (0 < aTitle.Length()))) {    if ((0 == aType.Length()) || aType.EqualsIgnoreCase("text/css")) {      nsIURL* url = nsnull;      nsIURLGroup* urlGroup = nsnull;      mDocumentBaseURL->GetURLGroup(&urlGroup);      if (urlGroup) {        result = urlGroup->CreateURL(&url, mDocumentBaseURL, aHref, nsnull);        NS_RELEASE(urlGroup);      }      else {        result = NS_NewURL(&url, aHref, mDocumentBaseURL);      }      if (NS_OK != result) {        return result;      }      PRBool isPersistent = PR_FALSE;      PRBool isPreferred  = PR_FALSE;      PRBool isAlternate  = PR_FALSE;      if (aRel.EqualsIgnoreCase("stylesheet")) {        if (0 == aTitle.Length()) {          isPersistent = PR_TRUE;        }        else {          if (0 == mPreferredStyle.Length()) {            isPreferred = PR_TRUE;            mPreferredStyle = aTitle;            mDocument->SetHeaderData(nsHTMLAtoms::headerDefaultStyle, aTitle);          }          else {            if (aTitle.EqualsIgnoreCase(mPreferredStyle)) {              isPreferred = PR_TRUE;            }            else {              isAlternate = PR_TRUE;            }          }        }      }      else {        isAlternate = PR_TRUE;      }      nsAsyncStyleProcessingDataHTML* d = new nsAsyncStyleProcessingDataHTML;      if (nsnull == d) {        return NS_ERROR_OUT_OF_MEMORY;      }      d->mTitle.SetString(aTitle);      d->mMedia.SetString(aMedia);      d->mIsActive = isPersistent;      d->mBlocked = aBlockParser;      d->mURL = url;      NS_ADDREF(url);      d->mElement = aElement;      NS_IF_ADDREF(aElement);      d->mSink = this;      NS_ADDREF(this);      d->mIndex = mStyleSheetCount++; // preserve ordering            nsIUnicharStreamLoader* loader;      result = NS_NewUnicharStreamLoader(&loader,                                         url,                                          (nsStreamCompleteFunc)nsDoneLoadingStyle,                                          (void *)d);      NS_RELEASE(url);      if (NS_SUCCEEDED(result) && aBlockParser) {        result = NS_ERROR_HTMLPARSER_BLOCK;      }    }  }  return result;}