Capture delayed events and cancel as necessary.

Tag #1052
This commit is contained in:
wolfbeast 2019-04-26 14:13:32 +02:00 committed by Roy Tam
commit e3827df1a0
4 changed files with 20 additions and 9 deletions

View file

@ -9335,7 +9335,7 @@ nsGlobalWindow::EnterModalState()
topWin->mSuspendedDoc = topDoc;
if (topDoc) {
topDoc->SuppressEventHandling(nsIDocument::eAnimationsOnly);
topDoc->SuppressEventHandling(nsIDocument::eEvents);
}
nsGlobalWindow* inner = topWin->GetCurrentInnerWindowInternal();
@ -9372,7 +9372,7 @@ nsGlobalWindow::LeaveModalState()
if (topWin->mSuspendedDoc) {
nsCOMPtr<nsIDocument> currentDoc = topWin->GetExtantDoc();
topWin->mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eAnimationsOnly,
topWin->mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eEvents,
currentDoc == topWin->mSuspendedDoc);
topWin->mSuspendedDoc = nullptr;
}