Repaint(PR_TRUE);
nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader, #ifdef NECKO                              nsIChannel* channel, #else                              nsIURI* aURL, #endif                              PRInt32 aStatus,							                nsIDocumentLoaderObserver * aWebShell){  nsresult rv = NS_ERROR_FAILURE;#ifdef NECKO  nsCOMPtr<nsIURI> aURL;  rv = channel->GetURI(getter_AddRefs(aURL));  if (NS_FAILED(rv)) return rv;#endif#if DEBUG_nisheeth  const char* spec;  aURL->GetSpec(&spec);  printf("nsWebShell::OnEndDocumentLoad:%p: loader=%p url=%s status=%d\n", this, loader, spec, aStatus);#endif    if (!mProcessedEndDocumentLoad) {    mProcessedEndDocumentLoad = PR_TRUE;        if (nsnull != mScriptGlobal) {      nsIDocumentViewer* docViewer;      if (nsnull != mContentViewer &&           NS_OK == mContentViewer->QueryInterface(kIDocumentViewerIID, (void**)&docViewer)) {        nsIPresContext *presContext;        if (NS_OK == docViewer->GetPresContext(presContext)) {          nsEventStatus status = nsEventStatus_eIgnore;          nsMouseEvent event;          event.eventStructType = NS_EVENT;          event.message = NS_PAGE_LOAD;          rv = mScriptGlobal->HandleDOMEvent(*presContext, &event, nsnull, NS_EVENT_FLAG_INIT, status);          NS_RELEASE(presContext);        }        NS_RELEASE(docViewer);      }    }    // Fire the EndLoadURL of the web shell container    if (nsnull != aURL) {       nsAutoString urlString;#ifdef NECKO       char* spec;#else       const char* spec;#endif       rv = aURL->GetSpec(&spec);       if (NS_SUCCEEDED(rv)) {         urlString = spec;         if (nsnull != mContainer) {            rv = mContainer->EndLoadURL(this, urlString.GetUnicode(), 0);         }  #ifdef NECKO         nsCRT::free(spec);#endif       }    }	  nsCOMPtr<nsIDocumentLoaderObserver> dlObserver;    if (!mDocLoaderObserver && mParent) {      /* If this is a frame (in which case it would have a parent && doesn't       * have a documentloaderObserver, get it from the rootWebShell       */      nsCOMPtr<nsIWebShell> root;      nsresult res = GetRootWebShell(*getter_AddRefs(root));         if (NS_SUCCEEDED(res) && root)         root->GetDocLoaderObserver(*getter_AddRefs(dlObserver));    }    else    {	  /* Take care of the Trailing slash situation */	  if (mSHist)		CheckForTrailingSlash(aURL);      dlObserver = do_QueryInterface(mDocLoaderObserver);		// we need this to addref    }        /*     * Fire the OnEndDocumentLoad of the DocLoaderobserver     */    if (dlObserver && (nsnull != aURL)) {#ifdef NECKO       dlObserver->OnEndDocumentLoad(mDocLoader, channel, aStatus, aWebShell);#else       dlObserver->OnEndDocumentLoad(mDocLoader, aURL, aStatus, aWebShell);#endif    }  } //!mProcessedEndDocumentLoad  else {    rv = NS_OK;  }  return rv;}