diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 7ca49bbd645..a917d9e2934 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -3115,6 +3115,10 @@ nsDocShell::Stop(PRUint32 aStopFlags) if (nsIWebNavigation::STOP_CONTENT & aStopFlags) { if (mContentViewer) mContentViewer->Stop(); + nsCOMPtr ourWindow = do_QueryInterface(mScriptGlobal); + if (ourWindow) { + ourWindow->ClearAllTimeouts(); + } } if (nsIWebNavigation::STOP_NETWORK & aStopFlags) { diff --git a/mozilla/dom/public/base/nsPIDOMWindow.h b/mozilla/dom/public/base/nsPIDOMWindow.h index ddc7e7e0ea2..6448e8f5eef 100644 --- a/mozilla/dom/public/base/nsPIDOMWindow.h +++ b/mozilla/dom/public/base/nsPIDOMWindow.h @@ -75,8 +75,8 @@ class nsIFocusController; struct nsTimeout; #define NS_PIDOMWINDOW_IID \ -{ 0x7e12a2d6, 0x9a2a, 0x4907, \ - { 0xab, 0x85, 0x01, 0x34, 0xe3, 0xa8, 0x1a, 0x3f } } +{ 0x91671056, 0xa8ed, 0x4ad3, \ + { 0x8f, 0x19, 0x69, 0xf5, 0x48, 0xbb, 0x9c, 0x4a } } class nsPIDOMWindow : public nsIDOMWindowInternal { @@ -136,6 +136,9 @@ public: virtual PopupControlState GetPopupControlState() const = 0; virtual OpenAllowValue GetOpenAllow(const nsAString &aName) = 0; + // Clear all pending timeouts and intervals. + virtual void ClearAllTimeouts() = 0; + protected: nsPIDOMWindow() : mRunningTimeout(nsnull), mMutationBits(0), mIsDocumentLoaded(PR_FALSE), diff --git a/mozilla/dom/src/base/nsGlobalWindow.h b/mozilla/dom/src/base/nsGlobalWindow.h index ff84e0445e6..ad8443eb34f 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.h +++ b/mozilla/dom/src/base/nsGlobalWindow.h @@ -198,6 +198,8 @@ public: virtual NS_HIDDEN_(PopupControlState) GetPopupControlState() const; virtual NS_HIDDEN_(OpenAllowValue) GetOpenAllow(const nsAString &aName); + virtual NS_HIDDEN_(void) ClearAllTimeouts(); + // nsIDOMViewCSS NS_DECL_NSIDOMVIEWCSS @@ -238,7 +240,6 @@ protected: nsresult SetTimeoutOrInterval(PRBool aIsInterval, PRInt32* aReturn); void RunTimeout(nsTimeout *aTimeout); nsresult ClearTimeoutOrInterval(); - void ClearAllTimeouts(); void InsertTimeoutIntoList(nsTimeout **aInsertionPoint, nsTimeout *aTimeout); static void TimerCallback(nsITimer *aTimer, void *aClosure);