Bug 479490 - 'ASSERTION: Mismatched calls to ResumeTimeouts'. r=bent, sr=jst, a=blocking1.9.1+

This commit is contained in:
Olli Pettay
2009-02-26 14:00:32 -08:00
parent 2772c8693b
commit f4e72527c6
6 changed files with 156 additions and 101 deletions

View File

@@ -6020,13 +6020,20 @@ nsDocShell::RestoreFromHistory()
}
nsCOMPtr<nsIDocument> document = do_QueryInterface(domDoc);
PRUint32 parentSuspendCount = 0;
if (document) {
nsCOMPtr<nsIDocShellTreeItem> parent;
GetParent(getter_AddRefs(parent));
nsCOMPtr<nsIDOMDocument> parentDoc = do_GetInterface(parent);
nsCOMPtr<nsIDocument> d = do_QueryInterface(parentDoc);
if (d && d->EventHandlingSuppressed()) {
document->SuppressEventHandling(d->EventHandlingSuppressed());
if (d) {
if (d->EventHandlingSuppressed()) {
document->SuppressEventHandling(d->EventHandlingSuppressed());
}
nsCOMPtr<nsPIDOMWindow> parentWindow = d->GetWindow();
if (parentWindow) {
parentSuspendCount = parentWindow->TimeoutSuspendCount();
}
}
// Use the uri from the mLSHE we had when we entered this function
@@ -6116,6 +6123,13 @@ nsDocShell::RestoreFromHistory()
}
}
// If parent is suspended, increase suspension count.
// This can't be done as early as event suppression since this
// depends on docshell tree.
if (parentSuspendCount) {
privWin->SuspendTimeouts(parentSuspendCount, PR_FALSE);
}
// Now that all of the child docshells have been put into place, we can
// restart the timers for the window and all of the child frames.
privWin->ResumeTimeouts();