Bug 562901 - Synchronous XMLHttpRequests cause setInterval to stop functioning, r=jst

This commit is contained in:
Olli Pettay 2010-06-10 13:29:43 +03:00
Родитель bedc9abcaf
Коммит f54a5ea9f7
1 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@ -9262,10 +9262,18 @@ nsGlobalWindow::SuspendTimeouts(PRUint32 aIncrease,
nsGlobalWindow *win =
static_cast<nsGlobalWindow*>
(static_cast<nsPIDOMWindow*>(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<nsIContent> 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<nsIContent> frame = do_QueryInterface(pWin->GetFrameElementInternal());
if (!mDoc || !frame || mDoc != frame->GetOwnerDoc() || !inner) {
continue;
}
if (inner && aThawChildren) {
inner->Thaw();
}