diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index 3a7fe155dca..ad59bd11944 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -2070,7 +2070,8 @@ nsHTMLDocument::OpenCommon(nsIURI* aSourceURL) mScriptGlobalObject->GetDocShell(getter_AddRefs(docshell)); if (docshell) { - docshell->StopLoad(); + nsCOMPtr webnav(do_QueryInterface(docshell)); + webnav->Stop(nsIWebNavigation::STOP_NETWORK); } } diff --git a/mozilla/docshell/base/nsDSURIContentListener.cpp b/mozilla/docshell/base/nsDSURIContentListener.cpp index dcc37dfd65c..eba7abfc27a 100644 --- a/mozilla/docshell/base/nsDSURIContentListener.cpp +++ b/mozilla/docshell/base/nsDSURIContentListener.cpp @@ -114,7 +114,8 @@ nsDSURIContentListener::DoContent(const char* aContentType, if(loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI) { - mDocShell->StopLoad(); + // XXX: Why does this not stop the content too? + mDocShell->Stop(nsIWebNavigation::STOP_NETWORK); } rv = mDocShell->CreateContentViewer(aContentType, request, aContentHandler); diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 8ce772ee491..0d0a4365001 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -454,7 +454,6 @@ nsDocShell::LoadURI(nsIURI * aURI, nsCOMPtr postStream; nsCOMPtr owner; PRBool inheritOwner = PR_FALSE; - PRBool stopActiveDoc = PR_FALSE; nsCOMPtr shEntry; nsXPIDLCString target; PRUint32 loadType = MAKE_LOAD_TYPE(LOAD_NORMAL, aLoadFlags); @@ -502,7 +501,6 @@ nsDocShell::LoadURI(nsIURI * aURI, aLoadInfo->GetOwner(getter_AddRefs(owner)); aLoadInfo->GetInheritOwner(&inheritOwner); - aLoadInfo->GetStopActiveDocument(&stopActiveDoc); aLoadInfo->GetSHEntry(getter_AddRefs(shEntry)); aLoadInfo->GetTarget(getter_Copies(target)); aLoadInfo->GetPostDataStream(getter_AddRefs(postStream)); @@ -594,7 +592,6 @@ nsDocShell::LoadURI(nsIURI * aURI, referrer, owner, inheritOwner, - stopActiveDoc, windowTarget.get(), postStream, nsnull, // No headers stream @@ -669,9 +666,7 @@ nsDocShell::LoadStream(nsIInputStream * aStream, nsIURI * aURI, } } - NS_ENSURE_SUCCESS(StopLoad(), NS_ERROR_FAILURE); - // Cancel any timers that were set for this loader. - (void) CancelRefreshURITimers(); + NS_ENSURE_SUCCESS(Stop(nsIWebNavigation::STOP_NETWORK), NS_ERROR_FAILURE); mLoadType = loadType; @@ -703,32 +698,6 @@ nsDocShell::CreateLoadInfo(nsIDocShellLoadInfo ** aLoadInfo) return NS_OK; } -NS_IMETHODIMP -nsDocShell::StopLoad() -{ - // Cancel any timers that were set for this loader. - CancelRefreshURITimers(); - - if (mLoadCookie) { - nsCOMPtr uriLoader = - do_GetService(NS_URI_LOADER_CONTRACTID); - if (uriLoader) - uriLoader->Stop(mLoadCookie); - } - - PRInt32 n; - PRInt32 count = mChildren.Count(); - for (n = 0; n < count; n++) { - nsIDocShellTreeItem *shellItem = - (nsIDocShellTreeItem *) mChildren.ElementAt(n); - nsCOMPtr shell(do_QueryInterface(shellItem)); - if (shell) - shell->StopLoad(); - } - - return NS_OK; -} - /* * Reset state to a new content model within the current document and the document @@ -2286,7 +2255,6 @@ nsDocShell::Reload(PRUint32 aReloadFlags) mReferrerURI, nsnull, // No owner PR_TRUE, // Inherit owner from document - PR_FALSE, // Do not stop active document nsnull, // No window target nsnull, // No post data nsnull, // No headers data @@ -2296,19 +2264,25 @@ nsDocShell::Reload(PRUint32 aReloadFlags) } NS_IMETHODIMP -nsDocShell::Stop() +nsDocShell::Stop(PRUint32 aStopFlags) { - // Cancel any timers that were set for this loader. - CancelRefreshURITimers(); + if (nsIWebNavigation::STOP_CONTENT & aStopFlags) { + if (mContentViewer) + mContentViewer->Stop(); - if (mContentViewer) - mContentViewer->Stop(); + } - if (mLoadCookie) { - nsCOMPtr uriLoader = - do_GetService(NS_URI_LOADER_CONTRACTID); - if (uriLoader) - uriLoader->Stop(mLoadCookie); + if (nsIWebNavigation::STOP_NETWORK & aStopFlags) { + // Cancel any timers that were set for this loader. + CancelRefreshURITimers(); + + if (mLoadCookie) { + nsCOMPtr uriLoader; + + uriLoader = do_GetService(NS_URI_LOADER_CONTRACTID); + if (uriLoader) + uriLoader->Stop(mLoadCookie); + } } PRInt32 n; @@ -2318,7 +2292,7 @@ nsDocShell::Stop() (nsIDocShellTreeItem *) mChildren.ElementAt(n); nsCOMPtr shellAsNav(do_QueryInterface(shell)); if (shellAsNav) - shellAsNav->Stop(); + shellAsNav->Stop(aStopFlags); } return NS_OK; @@ -2442,7 +2416,7 @@ nsDocShell::Destroy() mIsBeingDestroyed = PR_TRUE; // Stop any URLs that are currently being loaded... - Stop(); + Stop(nsIWebNavigation::STOP_ALL); if (mDocLoader) { mDocLoader->Destroy(); mDocLoader->SetContainer(nsnull); @@ -4196,7 +4170,6 @@ nsDocShell::InternalLoad(nsIURI * aURI, nsIURI * aReferrer, nsISupports * aOwner, PRBool aInheritOwner, - PRBool aStopActiveDoc, const PRUnichar *aWindowTarget, nsIInputStream * aPostData, nsIInputStream * aHeadersData, @@ -4307,7 +4280,6 @@ nsDocShell::InternalLoad(nsIURI * aURI, aReferrer, owner, aInheritOwner, - aStopActiveDoc, nsnull, // No window target aPostData, aHeadersData, @@ -4400,14 +4372,12 @@ nsDocShell::InternalLoad(nsIURI * aURI, return NS_OK; } } - - NS_ENSURE_SUCCESS(StopLoad(), NS_ERROR_FAILURE); - // Cancel any timers that were set for this loader. - CancelRefreshURITimers(); - - if (aStopActiveDoc && mContentViewer) { - mContentViewer->Stop(); - } + // + // Stop any current network activity. Do not stop the content until + // data starts arriving from the new URI... + // + rv = Stop(nsIWebNavigation::STOP_NETWORK); + if (NS_FAILED(rv)) return rv; mLoadType = aLoadType; @@ -5540,7 +5510,6 @@ nsDocShell::LoadHistoryEntry(nsISHEntry * aEntry, PRUint32 aLoadType) referrerURI, nsnull, // No owner PR_FALSE, // Do not inherit owner from document (security-critical!) - PR_FALSE, // Do not stop active document nsnull, // No window target postData, // Post data stream nsnull, // No headers stream diff --git a/mozilla/docshell/base/nsDocShellLoadInfo.cpp b/mozilla/docshell/base/nsDocShellLoadInfo.cpp index 3cbb2ba2b45..a8319aef410 100644 --- a/mozilla/docshell/base/nsDocShellLoadInfo.cpp +++ b/mozilla/docshell/base/nsDocShellLoadInfo.cpp @@ -34,7 +34,6 @@ nsDocShellLoadInfo::nsDocShellLoadInfo() mLoadType = nsIDocShellLoadInfo::loadNormal; mInheritOwner = PR_FALSE; mTarget.Assign(""); - mStopActiveDocument = PR_FALSE; } nsDocShellLoadInfo::~nsDocShellLoadInfo() @@ -101,20 +100,6 @@ NS_IMETHODIMP nsDocShellLoadInfo::SetInheritOwner(PRBool aInheritOwner) return NS_OK; } -NS_IMETHODIMP nsDocShellLoadInfo::GetStopActiveDocument(PRBool* aStopDocument) -{ - NS_ENSURE_ARG_POINTER(aStopDocument); - - *aStopDocument = mStopActiveDocument; - return NS_OK; -} - -NS_IMETHODIMP nsDocShellLoadInfo::SetStopActiveDocument(PRBool aStopDocument) -{ - mStopActiveDocument = aStopDocument; - return NS_OK; -} - NS_IMETHODIMP nsDocShellLoadInfo::GetLoadType(nsDocShellInfoLoadType * aLoadType) { NS_ENSURE_ARG_POINTER(aLoadType); diff --git a/mozilla/docshell/base/nsDocShellLoadInfo.h b/mozilla/docshell/base/nsDocShellLoadInfo.h index 00be69e3593..81634d81949 100644 --- a/mozilla/docshell/base/nsDocShellLoadInfo.h +++ b/mozilla/docshell/base/nsDocShellLoadInfo.h @@ -49,7 +49,6 @@ protected: nsCOMPtr mReferrer; nsCOMPtr mOwner; PRBool mInheritOwner; - PRBool mStopActiveDocument; nsDocShellInfoLoadType mLoadType; nsCOMPtr mSHEntry; nsCString mTarget; diff --git a/mozilla/docshell/base/nsIDocShell.idl b/mozilla/docshell/base/nsIDocShell.idl index a2954db7952..e4c68f8dfa2 100644 --- a/mozilla/docshell/base/nsIDocShell.idl +++ b/mozilla/docshell/base/nsIDocShell.idl @@ -118,7 +118,6 @@ interface nsIDocShell : nsISupports in nsIURI aReferrer, in nsISupports aOwner, in boolean aInheritOwner, - in boolean aStopActiveDoc, in wstring aWindowTarget, in nsIInputStream aPostDataStream, in nsIInputStream aHeadersStream, @@ -131,13 +130,6 @@ interface nsIDocShell : nsISupports */ void createLoadInfo(out nsIDocShellLoadInfo loadInfo); - /** - * Stops a current load. This simply stops the network portion of the load. - * If you wish to do a complete stop, then you should us the - * nsIWebNavigation::Stop() method. - */ - void stopLoad(); - /** * Reset state to a new content model within the current document and the document * viewer. Called by the document before initiating an out of band document.write(). diff --git a/mozilla/docshell/base/nsIDocShellLoadInfo.idl b/mozilla/docshell/base/nsIDocShellLoadInfo.idl index eeb314d2e65..edce61c9fd3 100644 --- a/mozilla/docshell/base/nsIDocShellLoadInfo.idl +++ b/mozilla/docshell/base/nsIDocShellLoadInfo.idl @@ -54,8 +54,6 @@ interface nsIDocShellLoadInfo : nsISupports */ attribute boolean inheritOwner; - attribute boolean stopActiveDocument; - /* these are load type enums... */ const long loadNormal = 0; // Normal Load const long loadNormalReplace = 1; // Normal Load but replaces current history slot diff --git a/mozilla/docshell/base/nsIWebNavigation.idl b/mozilla/docshell/base/nsIWebNavigation.idl index 81d23d1b24e..5028dcd637b 100644 --- a/mozilla/docshell/base/nsIWebNavigation.idl +++ b/mozilla/docshell/base/nsIWebNavigation.idl @@ -19,11 +19,8 @@ * Contributor(s): * Travis Bogard */ - #include "nsISupports.idl" -interface nsIDOMDocument; - /** * The nsIWebNavigation interface defines an interface for navigating the web. @@ -33,103 +30,164 @@ interface nsIDOMDocument; * * @status UNDER_REVIEW */ - -interface nsISHistory; + +interface nsIDOMDocument; +interface nsIInputStream; +interface nsISHistory; interface nsISHEntry; interface nsIURI; [scriptable, uuid(F5D9E7B0-D930-11d3-B057-00A024FFC08C)] interface nsIWebNavigation : nsISupports { - /* - Indicates if the object can go back. If true this indicates that - there is back session history available to navigate to. - */ - readonly attribute boolean canGoBack; + /** + * Indicates if the object can go back. If true this indicates that + * there is back session history available for navigation. + */ + readonly attribute boolean canGoBack; - /* - Indicates if the object can go forward. If true this indicates that - there is forward session history available to navigate to. - */ - readonly attribute boolean canGoForward; + /** + * Indicates if the object can go forward. If true this indicates that + * there is forward session history available for navigation + */ + readonly attribute boolean canGoForward; - /* - Tells the object to navigate to the next Back session history item. - @return NS_OK - Back was successfull - NS_ERROR_UNEXPECTED - This call was unexpected at this time. Most - likely you can't go back right now. - */ - void goBack(); + /** + * Tells the object to navigate to the previous session history item. When + * a page is loaded from session history, all content is loaded from the + * cache (if available) and page state (such as form values, scroll position) + * is restored. + * + * @return NS_OK - Backward navigation was successful. + * NS_ERROR_UNEXPECTED - This call was unexpected at this time. Most + * likely you can't go back right now. + */ + void goBack(); - /* - Tells the object to navigate to the next Forward session history item. - @return NS_OK - Forward was successfull - NS_ERROR_UNEXPECTED - This call was unexpected at this time. Most - likely you can't go forward right now. - */ - void goForward(); + /** + * Tells the object to navigate to the next Forward session history item. + * When a page is loaded from session history, all content is loaded from + * the cache (if available) and page state (such as form values, scroll + * position) is restored. + * + * @return NS_OK - Forward was successful. + * NS_ERROR_UNEXPECTED - This call was unexpected at this time. Most + * likely you can't go forward right now. + */ + void goForward(); - /* - Tells the object to navigate to the session history item at index. - @return NS_OK - Gotoindex was successfull - NS_ERROR_UNEXPECTED - This call was unexpected at this time. Most - likely you can't goto that index - */ - void gotoIndex(in long index); + /** + * Tells the object to navigate to the session history item at index. + * + * @return NS_OK - GotoIndex was successful. + * NS_ERROR_UNEXPECTED - This call was unexpected at this time. Most + * likely you can't goto that index + */ + void gotoIndex(in long index); - /* - Load flags for use with loadURI() and reload() - */ - const unsigned long LOAD_FLAGS_NONE = 0x0000; - const unsigned long LOAD_FLAGS_MASK = 0xffff; + /** + * Load flags for use with loadURI() and reload() + */ + const unsigned long LOAD_FLAGS_MASK = 0xffff; - /* loadURI() specific flags */ - const unsigned long LOAD_FLAGS_IS_REFRESH = 0x0010; // Refresh timer - const unsigned long LOAD_FLAGS_IS_LINK = 0x0020; // Link click - const unsigned long LOAD_FLAGS_BYPASS_HISTORY = 0x0040; // Bypass the history - const unsigned long LOAD_FLAGS_REPLACE_HISTORY = 0x0080; // Replace the history entry + /** + * loadURI() specific flags + */ - /* loadURI() & reload() specific flags */ - const unsigned long LOAD_FLAGS_BYPASS_CACHE = 0x0100; // Bypass the cache - const unsigned long LOAD_FLAGS_BYPASS_PROXY = 0x0200; // Bypass the proxy - const unsigned long LOAD_FLAGS_CHARSET_CHANGE = 0x0400; // Reload because of charset change, - /* - Loads a given URI. This will give priority to loading the requested URI - in the object implementing this interface. If it can't be loaded here - however, the URL dispatcher will go through its normal process of content - loading. + /** + * Normal load flag. + */ + const unsigned long LOAD_FLAGS_NONE = 0x0000; - @param uri - The URI to load. - @param loadFlags - Flags modifying load behaviour. Generally you will pass - LOAD_FLAGS_NONE for this parameter. - */ - void loadURI(in wstring uri, in unsigned long loadFlags); + /** + * Meta-refresh flag. The cache is bypassed. This type of load is + * usually the result of a meta-refresh tag, or a HTTP + * 'refresh' header. + */ + const unsigned long LOAD_FLAGS_IS_REFRESH = 0x0010; - /* - Tells the Object to reload the current location. - @param reloadFlags - Flags modifying reload behaviour. Generally you will - pass LOAD_FLAGS_NONE for this parameter. - */ - void reload(in unsigned long reloadFlags); + /** + * Link-click flag. + */ + const unsigned long LOAD_FLAGS_IS_LINK = 0x0020; - /* - Stops a load of a URI. - */ - void stop(); + /** + * Bypass history flag. + */ + const unsigned long LOAD_FLAGS_BYPASS_HISTORY = 0x0040; - /* - Retrieves the current Document for the WebBrowser. When setting - this will simulate the normal load process. - */ - readonly attribute nsIDOMDocument document; - - /* - The current URI that is loaded. - */ - readonly attribute nsIURI currentURI; - - /* - The session history object used to store the session history for the session. - */ - attribute nsISHistory sessionHistory; + /** + * Replace history entry flag. + */ + const unsigned long LOAD_FLAGS_REPLACE_HISTORY = 0x0080; + + /* loadURI() & reload() specific flags */ + const unsigned long LOAD_FLAGS_BYPASS_CACHE = 0x0100; // Bypass the cache + const unsigned long LOAD_FLAGS_BYPASS_PROXY = 0x0200; // Bypass the proxy + const unsigned long LOAD_FLAGS_CHARSET_CHANGE = 0x0400; // Reload because of charset change, + + /** + * Loads a given URI. This will give priority to loading the requested URI + * in the object implementing this interface. If it can't be loaded here + * however, the URL dispatcher will go through its normal process of content + * loading. + * + * @param uri - The URI string to load. + * @param loadFlags - Flags modifying load behaviour. Generally you will pass + * LOAD_FLAGS_NONE for this parameter. + * @param postData - nsIInputStream containing POST data for the request. + */ + void loadURI(in wstring uri, in unsigned long loadFlags); + + /** + * Tells the Object to reload the current page. + * + * @param reloadFlags - Flags modifying reload behaviour. Generally you will + * pass LOAD_FLAGS_NONE for this parameter. + */ + void reload(in unsigned long reloadFlags); + + /** + * Stop() flags: + */ + + /** + * Stop all network activity. This includes both active network loads and + * pending meta-refreshes. + */ + const unsigned long STOP_NETWORK = 0x01; + + /** + * Stop all content activity. This includes animated images, plugins and + * pending Javascript timeouts. + */ + const unsigned long STOP_CONTENT = 0x02; + + /** + * Stop all activity. + */ + const unsigned long STOP_ALL = 0x03; + + /** + * Stops a load of a URI. + * + * @param stopFlags - Flags indicating the stop behavior. + */ + void stop(in unsigned long stopFlags); + + /** + * Retrieves the current DOM document for the WebBrowser. + */ + readonly attribute nsIDOMDocument document; + + /** + * The current URI that is loaded. + */ + readonly attribute nsIURI currentURI; + + /** + * The session history object used to store the session history for the + * session. + */ + attribute nsISHistory sessionHistory; }; diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index f3b00d4174f..2ee63c22da2 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -597,7 +597,7 @@ nsWebShell::StopDocumentLoad(void) { if(eCharsetReloadRequested != mCharsetReloadState) { - Stop(); + Stop(nsIWebNavigation::STOP_ALL); } return NS_OK; } @@ -777,7 +777,6 @@ nsWebShell::HandleLinkClickEvent(nsIContent *aContent, mCurrentURI, // Referer URI nsnull, // No onwer PR_TRUE, // Inherit owner from document - PR_FALSE, // Do not stop active document target.get(), // Window target aPostDataStream, // Post data stream aHeadersDataStream, // Headers stream @@ -1123,7 +1122,6 @@ nsresult nsWebShell::EndPageLoad(nsIWebProgress *aProgress, referrer, // Refering URI nsnull, // Owner PR_TRUE, // Inherit owner - PR_FALSE, // Do not stop active Doc nsnull, // No window target inputStream, // Post data stream nsnull, // No headers stream diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 54c4d60eafb..0f5432e968b 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -1848,7 +1848,7 @@ NS_IMETHODIMP GlobalWindowImpl::Home() NS_IMETHODIMP GlobalWindowImpl::Stop() { nsCOMPtr webNav(do_QueryInterface(mDocShell)); - return webNav->Stop(); + return webNav->Stop(nsIWebNavigation::STOP_ALL); } NS_IMETHODIMP GlobalWindowImpl::Print() diff --git a/mozilla/dom/src/base/nsLocation.cpp b/mozilla/dom/src/base/nsLocation.cpp index 10ea925ff94..29964a3b764 100644 --- a/mozilla/dom/src/base/nsLocation.cpp +++ b/mozilla/dom/src/base/nsLocation.cpp @@ -128,12 +128,12 @@ LocationImpl::SetURL(nsIURI* aURI) { if (mDocShell) { nsCOMPtr loadInfo; + nsCOMPtr webNav(do_QueryInterface(mDocShell)); if(NS_FAILED(CheckURL(aURI, getter_AddRefs(loadInfo)))) return NS_ERROR_FAILURE; - loadInfo->SetStopActiveDocument(PR_TRUE); - + webNav->Stop(nsIWebNavigation::STOP_CONTENT); return mDocShell->LoadURI(aURI, loadInfo, nsIWebNavigation::LOAD_FLAGS_NONE); } @@ -404,6 +404,7 @@ LocationImpl::SetHrefWithBase(const nsAReadableString& aHref, if (newUri && mDocShell) { nsCOMPtr loadInfo; + nsCOMPtr webNav(do_QueryInterface(mDocShell)); nsresult rv = CheckURL(newUri, getter_AddRefs(loadInfo)); @@ -441,8 +442,7 @@ LocationImpl::SetHrefWithBase(const nsAReadableString& aHref, loadInfo->SetLoadType(nsIDocShellLoadInfo::loadNormalReplace); } - loadInfo->SetStopActiveDocument(PR_TRUE); - + webNav->Stop(nsIWebNavigation::STOP_CONTENT); return mDocShell->LoadURI(newUri, loadInfo, nsIWebNavigation::LOAD_FLAGS_NONE); } diff --git a/mozilla/embedding/browser/activex/src/control/MozillaBrowser.cpp b/mozilla/embedding/browser/activex/src/control/MozillaBrowser.cpp index aae7f898e4b..b313f34b710 100644 --- a/mozilla/embedding/browser/activex/src/control/MozillaBrowser.cpp +++ b/mozilla/embedding/browser/activex/src/control/MozillaBrowser.cpp @@ -1853,7 +1853,7 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::Stop() nsCOMPtr spIWebNavigation = do_QueryInterface(mWebBrowser); if (spIWebNavigation) { - spIWebNavigation->Stop(); + spIWebNavigation->Stop(nsIWebNavigation::STOP_ALL); } return S_OK; diff --git a/mozilla/embedding/browser/chrome/content/mini-nav.js b/mozilla/embedding/browser/chrome/content/mini-nav.js index a5a94fa2da2..10a1260314d 100644 --- a/mozilla/embedding/browser/chrome/content/mini-nav.js +++ b/mozilla/embedding/browser/chrome/content/mini-nav.js @@ -230,7 +230,7 @@ function BrowserForward() function BrowserStop() { - getWebNavigation().stop(); + getWebNavigation().stop(nsIWebNavigation.STOP_ALL); } function BrowserReload() diff --git a/mozilla/embedding/browser/gtk/src/gtkmozembed2.cpp b/mozilla/embedding/browser/gtk/src/gtkmozembed2.cpp index baaec506a03..8378171d0bc 100644 --- a/mozilla/embedding/browser/gtk/src/gtkmozembed2.cpp +++ b/mozilla/embedding/browser/gtk/src/gtkmozembed2.cpp @@ -734,7 +734,7 @@ gtk_moz_embed_stop_load(GtkMozEmbed *embed) embedPrivate = (EmbedPrivate *)embed->data; if (embedPrivate->mNavigation) - embedPrivate->mNavigation->Stop(); + embedPrivate->mNavigation->Stop(nsIWebNavigation::STOP_ALL); } gboolean diff --git a/mozilla/embedding/browser/photon/src/PtMozilla.cpp b/mozilla/embedding/browser/photon/src/PtMozilla.cpp index 0be9194dad5..3efe129333e 100644 --- a/mozilla/embedding/browser/photon/src/PtMozilla.cpp +++ b/mozilla/embedding/browser/photon/src/PtMozilla.cpp @@ -511,7 +511,7 @@ static void mozilla_modify( PtWidget_t *widget, PtArg_t const *argt ) { case Pt_ARG_MOZ_STOP: if (moz->MyBrowser->WebNavigation) - moz->MyBrowser->WebNavigation->Stop(); + moz->MyBrowser->WebNavigation->Stop(nsIWebNavigation::STOP_ALL); break; case Pt_ARG_MOZ_RELOAD: diff --git a/mozilla/embedding/browser/powerplant/source/CBrowserShell.cpp b/mozilla/embedding/browser/powerplant/source/CBrowserShell.cpp index fe399102dc6..d9241aa6756 100644 --- a/mozilla/embedding/browser/powerplant/source/CBrowserShell.cpp +++ b/mozilla/embedding/browser/powerplant/source/CBrowserShell.cpp @@ -564,7 +564,7 @@ NS_METHOD CBrowserShell::Forward() NS_METHOD CBrowserShell::Stop() { - return mWebBrowserAsWebNav->Stop(); + return mWebBrowserAsWebNav->Stop(nsIWebNavigation::STOP_ALL); } //***************************************************************************** diff --git a/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp b/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp index 9be8d4ab31b..94b756121ff 100644 --- a/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp +++ b/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp @@ -577,11 +577,11 @@ NS_IMETHODIMP nsWebBrowser::GotoIndex(PRInt32 aIndex) return mDocShellAsNav->GotoIndex(aIndex); } -NS_IMETHODIMP nsWebBrowser::Stop() +NS_IMETHODIMP nsWebBrowser::Stop(PRUint32 aStopFlags) { NS_ENSURE_STATE(mDocShell); - return mDocShellAsNav->Stop(); + return mDocShellAsNav->Stop(aStopFlags); } NS_IMETHODIMP nsWebBrowser::GetCurrentURI(nsIURI** aURI) diff --git a/mozilla/embedding/qa/testembed/BrowserView.cpp b/mozilla/embedding/qa/testembed/BrowserView.cpp index cb82e92eb6b..d4b2ed0dc0f 100644 --- a/mozilla/embedding/qa/testembed/BrowserView.cpp +++ b/mozilla/embedding/qa/testembed/BrowserView.cpp @@ -466,9 +466,9 @@ void CBrowserView::OnNavReload() } void CBrowserView::OnNavStop() -{ - if(mWebNav) - mWebNav->Stop(); +{ + if(mWebNav) + mWebNav->Stop(nsIWebNavigation::STOP_ALL); } void CBrowserView::OnUpdateNavStop(CCmdUI* pCmdUI) diff --git a/mozilla/embedding/qa/testembed/Tests.cpp b/mozilla/embedding/qa/testembed/Tests.cpp index ca40fd621ff..edc0253515c 100644 --- a/mozilla/embedding/qa/testembed/Tests.cpp +++ b/mozilla/embedding/qa/testembed/Tests.cpp @@ -957,7 +957,7 @@ void CTests::StopUriTest(char *theUrl) qaWebNav->LoadURI(NS_ConvertASCIItoUCS2(theUrl).get(), nsIWebNavigation::LOAD_FLAGS_NONE); - rv = qaWebNav->Stop(); + rv = qaWebNav->Stop(nsIWebNavigation::STOP_ALL); sprintf(theTotalString, "%s%s%s", "Stop(): ", theUrl, " test"); CQaUtils::RvTestResult(rv, theTotalString, 2); } diff --git a/mozilla/embedding/tests/mfcembed/BrowserView.cpp b/mozilla/embedding/tests/mfcembed/BrowserView.cpp index 60db28c2630..6c8019e9fe5 100644 --- a/mozilla/embedding/tests/mfcembed/BrowserView.cpp +++ b/mozilla/embedding/tests/mfcembed/BrowserView.cpp @@ -436,9 +436,9 @@ void CBrowserView::OnNavReload() } void CBrowserView::OnNavStop() -{ - if(mWebNav) - mWebNav->Stop(); +{ + if(mWebNav) + mWebNav->Stop(nsIWebNavigation::STOP_ALL); } void CBrowserView::OnUpdateNavStop(CCmdUI* pCmdUI) diff --git a/mozilla/embedding/tests/winEmbed/winEmbed.cpp b/mozilla/embedding/tests/winEmbed/winEmbed.cpp index 60e261b59e7..f8bd71babc3 100644 --- a/mozilla/embedding/tests/winEmbed/winEmbed.cpp +++ b/mozilla/embedding/tests/winEmbed/winEmbed.cpp @@ -623,7 +623,7 @@ BOOL CALLBACK BrowserDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar break; case IDC_STOP: - webNavigation->Stop(); + webNavigation->Stop(nsIWebNavigation::STOP_ALL); UpdateUI(chrome); break; @@ -1064,7 +1064,7 @@ void WebBrowserChromeUI::Destroy(nsIWebBrowserChrome* chrome) chrome->GetWebBrowser(getter_AddRefs(webBrowser)); webNavigation = do_QueryInterface(webBrowser); if (webNavigation) - webNavigation->Stop(); + webNavigation->Stop(nsIWebNavigation::STOP_ALL); chrome->ExitModalEventLoop(NS_OK); diff --git a/mozilla/mailnews/base/src/nsMsgWindow.cpp b/mozilla/mailnews/base/src/nsMsgWindow.cpp index ba3c29fdd5b..43e9ad442ac 100644 --- a/mozilla/mailnews/base/src/nsMsgWindow.cpp +++ b/mozilla/mailnews/base/src/nsMsgWindow.cpp @@ -367,7 +367,8 @@ NS_IMETHODIMP nsMsgWindow::StopUrls() GetRootDocShell(getter_AddRefs(docShell)); if (docShell) { - return docShell->StopLoad(); + nsCOMPtr webnav(do_QueryInterface(docShell)); + return webnav->Stop(nsIWebNavigation::STOP_NETWORK); } nsCOMPtr rootShell(do_QueryReferent(mRootDocShellWeak)); diff --git a/mozilla/mailnews/news/src/nsNNTPProtocol.cpp b/mozilla/mailnews/news/src/nsNNTPProtocol.cpp index d0045e6be5e..473ee9127e7 100644 --- a/mozilla/mailnews/news/src/nsNNTPProtocol.cpp +++ b/mozilla/mailnews/news/src/nsNNTPProtocol.cpp @@ -2266,7 +2266,7 @@ PRInt32 nsNNTPProtocol::SendFirstNNTPCommandResponse() // note, this will cause us to close the connection. // this will call nsDocShell::LoadURI(), which will - // call nsDocShell::StopLoad(), which will eventually + // call nsDocShell::Stop(STOP_NETWORK), which will eventually // call nsNNTPProtocol::Cancel(), which will close the socket. // we need to fix this, since the connection is still valid. rv = m_msgWindow->DisplayHTMLInMessagePane((const PRUnichar *)titleStr, errorHtml.get()); diff --git a/mozilla/xpfe/browser/resources/content/fastnav.js b/mozilla/xpfe/browser/resources/content/fastnav.js index 66bdbadfb7b..993f66cb0db 100644 --- a/mozilla/xpfe/browser/resources/content/fastnav.js +++ b/mozilla/xpfe/browser/resources/content/fastnav.js @@ -455,7 +455,8 @@ function BrowserForwardMenu(event) function BrowserStop() { try { - getWebNavigation().stop(); + const stopFlags = nsIWebNavigation.STOP_ALL; + getWebNavigation().stop(stopFlags); } catch(ex) { } diff --git a/mozilla/xpfe/browser/resources/content/navigator.js b/mozilla/xpfe/browser/resources/content/navigator.js index 3bde55e57c3..369f93c4fbe 100644 --- a/mozilla/xpfe/browser/resources/content/navigator.js +++ b/mozilla/xpfe/browser/resources/content/navigator.js @@ -455,7 +455,8 @@ function BrowserForwardMenu(event) function BrowserStop() { try { - getWebNavigation().stop(); + const stopFlags = nsIWebNavigation.STOP_ALL; + getWebNavigation().stop(stopFlags); } catch(ex) { } diff --git a/mozilla/xpfe/browser/src/nsBrowserInstance.cpp b/mozilla/xpfe/browser/src/nsBrowserInstance.cpp index db131c70ff8..f5ac0d9f5eb 100644 --- a/mozilla/xpfe/browser/src/nsBrowserInstance.cpp +++ b/mozilla/xpfe/browser/src/nsBrowserInstance.cpp @@ -288,7 +288,7 @@ public: nsCOMPtr webNav(do_QueryInterface(docShell)); if(webNav) - webNav->Stop(); + webNav->Stop(nsIWebNavigation::STOP_ALL); } // We need to enqueue an event to load the next page, diff --git a/mozilla/xpfe/components/shistory/src/nsSHistory.cpp b/mozilla/xpfe/components/shistory/src/nsSHistory.cpp index 02e076c1cda..b51325c1ca3 100644 --- a/mozilla/xpfe/components/shistory/src/nsSHistory.cpp +++ b/mozilla/xpfe/components/shistory/src/nsSHistory.cpp @@ -509,7 +509,7 @@ nsSHistory::Reload(PRUint32 aReloadFlags) } NS_IMETHODIMP -nsSHistory::Stop() +nsSHistory::Stop(PRUint32 aStopFlags) { //Not implemented return NS_OK; diff --git a/mozilla/xpfe/global/resources/content/bindings/browser.xml b/mozilla/xpfe/global/resources/content/bindings/browser.xml index 9086d1cb44d..09b45176c6f 100644 --- a/mozilla/xpfe/global/resources/content/bindings/browser.xml +++ b/mozilla/xpfe/global/resources/content/bindings/browser.xml @@ -92,7 +92,9 @@