Bug 1292502 Fix mismatch between mModalStateDepth and mSuspendedDoc r=smaug

This commit is contained in:
Neil Rashbrook 2016-08-10 11:39:54 +01:00
Родитель 6497612dd6
Коммит f78b2736a5
1 изменённых файлов: 8 добавлений и 8 удалений

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

@ -8789,11 +8789,11 @@ nsGlobalWindow::EnterModalState()
}
if (topWin->mModalStateDepth == 0) {
NS_ASSERTION(!mSuspendedDoc, "Shouldn't have mSuspendedDoc here!");
NS_ASSERTION(!topWin->mSuspendedDoc, "Shouldn't have mSuspendedDoc here!");
mSuspendedDoc = topDoc;
if (mSuspendedDoc) {
mSuspendedDoc->SuppressEventHandling(nsIDocument::eAnimationsOnly);
topWin->mSuspendedDoc = topDoc;
if (topDoc) {
topDoc->SuppressEventHandling(nsIDocument::eAnimationsOnly);
}
}
topWin->mModalStateDepth++;
@ -8881,11 +8881,11 @@ nsGlobalWindow::LeaveModalState()
if (NS_FAILED(NS_DispatchToCurrentThread(runner)))
NS_WARNING("failed to dispatch pending timeout runnable");
if (mSuspendedDoc) {
if (topWin->mSuspendedDoc) {
nsCOMPtr<nsIDocument> currentDoc = topWin->GetExtantDoc();
mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eAnimationsOnly,
currentDoc == mSuspendedDoc);
mSuspendedDoc = nullptr;
topWin->mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eAnimationsOnly,
currentDoc == topWin->mSuspendedDoc);
topWin->mSuspendedDoc = nullptr;
}
}