mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 933483 - Don't fire events (and especially request animation frame events) when we're in a modal dialog. Also protect ourselves from resuming events on a closed window. r=smaug
This commit is contained in:
parent
f577979fe4
commit
72f57b32df
@ -8490,7 +8490,10 @@ FireOrClearDelayedEvents(nsTArray<nsCOMPtr<nsIDocument> >& aDocuments,
|
||||
return;
|
||||
|
||||
for (uint32_t i = 0; i < aDocuments.Length(); ++i) {
|
||||
if (!aDocuments[i]->EventHandlingSuppressed()) {
|
||||
// NB: Don't bother trying to fire delayed events on documents that were
|
||||
// closed before this event ran.
|
||||
if (!aDocuments[i]->EventHandlingSuppressed() &&
|
||||
aDocuments[i]->IsActive()) {
|
||||
fm->FireDelayedEvents(aDocuments[i]);
|
||||
nsCOMPtr<nsIPresShell> shell = aDocuments[i]->GetShell();
|
||||
if (shell) {
|
||||
|
@ -8185,10 +8185,8 @@ nsGlobalWindow::EnterModalState()
|
||||
NS_ASSERTION(!mSuspendedDoc, "Shouldn't have mSuspendedDoc here!");
|
||||
|
||||
mSuspendedDoc = topWin->GetExtantDoc();
|
||||
if (mSuspendedDoc && mSuspendedDoc->EventHandlingSuppressed()) {
|
||||
if (mSuspendedDoc) {
|
||||
mSuspendedDoc->SuppressEventHandling();
|
||||
} else {
|
||||
mSuspendedDoc = nullptr;
|
||||
}
|
||||
}
|
||||
topWin->mModalStateDepth++;
|
||||
@ -8202,7 +8200,8 @@ nsGlobalWindow::RunPendingTimeoutsRecursive(nsGlobalWindow *aTopWindow,
|
||||
nsGlobalWindow *inner;
|
||||
|
||||
// Return early if we're frozen or have no inner window.
|
||||
if (!(inner = aWindow->GetCurrentInnerWindowInternal()) ||
|
||||
if (aWindow->IsClosedOrClosing() ||
|
||||
!(inner = aWindow->GetCurrentInnerWindowInternal()) ||
|
||||
inner->IsFrozen()) {
|
||||
return;
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=61098
|
||||
<script class="testbody" type="text/javascript">
|
||||
/** Test for Bug 61098 **/
|
||||
|
||||
SimpleTest.expectAssertions(8);
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var mockPromptServiceRegisterer, mockPromptFactoryRegisterer;
|
||||
|
Loading…
Reference in New Issue
Block a user