Bug 956704 - Only suppress animation frames when entering a modal state. r=smaug

This commit is contained in:
Blake Kaplan 2014-02-26 15:59:03 -08:00
parent 5acd3527ae
commit dff9fc45ba

View File

@ -1570,6 +1570,9 @@ nsGlobalWindow::FreeInnerObjects()
while (mDoc->EventHandlingSuppressed()) {
mDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eEvents, false);
}
// Note: we don't have to worry about eAnimationsOnly suppressions because
// they won't leak.
}
// Remove our reference to the document and the document principal.
@ -8282,7 +8285,7 @@ nsGlobalWindow::EnterModalState()
mSuspendedDoc = topDoc;
if (mSuspendedDoc) {
mSuspendedDoc->SuppressEventHandling(nsIDocument::eEvents);
mSuspendedDoc->SuppressEventHandling(nsIDocument::eAnimationsOnly);
}
}
topWin->mModalStateDepth++;
@ -8379,7 +8382,7 @@ nsGlobalWindow::LeaveModalState()
if (mSuspendedDoc) {
nsCOMPtr<nsIDocument> currentDoc = topWin->GetExtantDoc();
mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eEvents,
mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eAnimationsOnly,
currentDoc == mSuspendedDoc);
mSuspendedDoc = nullptr;
}