diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index e98491a77db..b4484cbd42b 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -9262,10 +9262,18 @@ nsGlobalWindow::SuspendTimeouts(PRUint32 aIncrease, nsGlobalWindow *win = static_cast (static_cast(pWin)); - win->SuspendTimeouts(aIncrease, aFreezeChildren); - NS_ASSERTION(win->IsOuterWindow(), "Expected outer window"); nsGlobalWindow* inner = win->GetCurrentInnerWindowInternal(); + + // This is a bit hackish. Only freeze/suspend windows which are truly our + // subwindows. + nsCOMPtr frame = do_QueryInterface(pWin->GetFrameElementInternal()); + if (!mDoc || !frame || mDoc != frame->GetOwnerDoc() || !inner) { + continue; + } + + win->SuspendTimeouts(aIncrease, aFreezeChildren); + if (inner && aFreezeChildren) { inner->Freeze(); } @@ -9359,6 +9367,14 @@ nsGlobalWindow::ResumeTimeouts(PRBool aThawChildren) NS_ASSERTION(win->IsOuterWindow(), "Expected outer window"); nsGlobalWindow* inner = win->GetCurrentInnerWindowInternal(); + + // This is a bit hackish. Only thaw/resume windows which are truly our + // subwindows. + nsCOMPtr frame = do_QueryInterface(pWin->GetFrameElementInternal()); + if (!mDoc || !frame || mDoc != frame->GetOwnerDoc() || !inner) { + continue; + } + if (inner && aThawChildren) { inner->Thaw(); }