mProcessedEndDocumentLoad = PR_FALSE;
nsWebShell::DoLoadURL(const nsString& aUrlSpec,                      const char* aCommand,                      nsIPostData* aPostData,                      nsURLReloadType aType,                      const PRUint32 aLocalIP){  // If it's a normal reload that uses the cache, look at the destination anchor  // and see if it's an element within the current document  if ((aType == nsURLReload) && (nsnull != mContentViewer)) {    nsCOMPtr<nsIDocumentViewer> docViewer;    if (NS_SUCCEEDED(mContentViewer->QueryInterface(kIDocumentViewerIID,                                                    getter_AddRefs(docViewer)))) {      // Get the document object      nsCOMPtr<nsIDocument> doc;      docViewer->GetDocument(*getter_AddRefs(doc));      // Get the URL for the document      nsCOMPtr<nsIURL>  docURL = nsDontAddRef<nsIURL>(doc->GetDocumentURL());      // See if they're the same      nsCOMPtr<nsIURL>  url;      NS_NewURL(getter_AddRefs(url), aUrlSpec);      if ((PRBool)docURL->Equals(url)) {        // See if there's a destination anchor        const char* ref;        url->GetRef(&ref);        if (nsnull != ref) {          // Get the pres shell object          nsCOMPtr<nsIPresShell> presShell;          docViewer->GetPresShell(*getter_AddRefs(presShell));          presShell->GoToAnchor(nsAutoString(ref));          return NS_OK;        }      }    }  }  // Stop loading the current document (if any...).  This call may result in  // firing an EndLoadURL notification for the old document...  Stop();  // Tell web-shell-container we are loading a new url  if (nsnull != mContainer) {    nsresult rv = mContainer->BeginLoadURL(this, aUrlSpec.GetUnicode());    if (NS_FAILED(rv)) {      return rv;    }  } /* WebShell was primarily passing the buck when it came to streamObserver.  * So, pass on the observer which is already a streamObserver to DocLoder.  *  - Radha  */    return mDocLoader->LoadDocument(aUrlSpec,       // URL string                                  aCommand,       // Command                                  this,           // Container                                  aPostData,      // Post Data                                  nsnull,         // Extra Info...                                  mObserver,      // Observer                                  aType,          // reload type                                  aLocalIP);      // load attributes.}