mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 99e6a5b3b079 (bug 933483) for mochitest-bc leaks.
CLOSED TREE
This commit is contained in:
parent
3cae916dff
commit
7f28d9919b
@ -8565,17 +8565,11 @@ FireOrClearDelayedEvents(nsTArray<nsCOMPtr<nsIDocument> >& aDocuments,
|
||||
return;
|
||||
|
||||
for (uint32_t i = 0; i < aDocuments.Length(); ++i) {
|
||||
// NB: Don't bother trying to fire delayed events on documents that were
|
||||
// closed before this event ran.
|
||||
if (!aDocuments[i]->EventHandlingSuppressed()) {
|
||||
fm->FireDelayedEvents(aDocuments[i]);
|
||||
nsCOMPtr<nsIPresShell> shell = aDocuments[i]->GetShell();
|
||||
if (shell) {
|
||||
// Only fire events for active documents.
|
||||
bool fire = aFireEvents &&
|
||||
aDocuments[i]->GetInnerWindow() &&
|
||||
aDocuments[i]->GetInnerWindow()->IsCurrentInnerWindow();
|
||||
shell->FireOrClearDelayedEvents(fire);
|
||||
shell->FireOrClearDelayedEvents(aFireEvents);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -992,23 +992,16 @@ nsFocusManager::FireDelayedEvents(nsIDocument* aDocument)
|
||||
NS_ENSURE_ARG(aDocument);
|
||||
|
||||
// fire any delayed focus and blur events in the same order that they were added
|
||||
for (uint32_t i = 0; i < mDelayedBlurFocusEvents.Length(); i++) {
|
||||
if (mDelayedBlurFocusEvents[i].mDocument == aDocument) {
|
||||
if (!aDocument->GetInnerWindow() ||
|
||||
!aDocument->GetInnerWindow()->IsCurrentInnerWindow()) {
|
||||
// If the document was navigated away from or is defunct, don't bother
|
||||
// firing events on it. Note the symmetry between this condition and
|
||||
// the similar one in nsDocument.cpp:FireOrClearDelayedEvents.
|
||||
mDelayedBlurFocusEvents.RemoveElementAt(i);
|
||||
--i;
|
||||
} else if (!aDocument->EventHandlingSuppressed()) {
|
||||
uint32_t type = mDelayedBlurFocusEvents[i].mType;
|
||||
nsCOMPtr<EventTarget> target = mDelayedBlurFocusEvents[i].mTarget;
|
||||
nsCOMPtr<nsIPresShell> presShell = mDelayedBlurFocusEvents[i].mPresShell;
|
||||
mDelayedBlurFocusEvents.RemoveElementAt(i);
|
||||
SendFocusOrBlurEvent(type, presShell, aDocument, target, 0, false);
|
||||
--i;
|
||||
}
|
||||
for (uint32_t i = 0; i < mDelayedBlurFocusEvents.Length(); i++)
|
||||
{
|
||||
if (mDelayedBlurFocusEvents[i].mDocument == aDocument &&
|
||||
!aDocument->EventHandlingSuppressed()) {
|
||||
uint32_t type = mDelayedBlurFocusEvents[i].mType;
|
||||
nsCOMPtr<EventTarget> target = mDelayedBlurFocusEvents[i].mTarget;
|
||||
nsCOMPtr<nsIPresShell> presShell = mDelayedBlurFocusEvents[i].mPresShell;
|
||||
mDelayedBlurFocusEvents.RemoveElementAt(i);
|
||||
SendFocusOrBlurEvent(type, presShell, aDocument, target, 0, false);
|
||||
--i;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1545,10 +1545,6 @@ nsGlobalWindow::FreeInnerObjects()
|
||||
mDocumentPrincipal = mDoc->NodePrincipal();
|
||||
mDocumentURI = mDoc->GetDocumentURI();
|
||||
mDocBaseURI = mDoc->GetDocBaseURI();
|
||||
|
||||
if (mDoc->EventHandlingSuppressed()) {
|
||||
mDoc->UnsuppressEventHandlingAndFireEvents(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove our reference to the document and the document principal.
|
||||
@ -8208,8 +8204,10 @@ nsGlobalWindow::EnterModalState()
|
||||
NS_ASSERTION(!mSuspendedDoc, "Shouldn't have mSuspendedDoc here!");
|
||||
|
||||
mSuspendedDoc = topWin->GetExtantDoc();
|
||||
if (mSuspendedDoc) {
|
||||
if (mSuspendedDoc && mSuspendedDoc->EventHandlingSuppressed()) {
|
||||
mSuspendedDoc->SuppressEventHandling();
|
||||
} else {
|
||||
mSuspendedDoc = nullptr;
|
||||
}
|
||||
}
|
||||
topWin->mModalStateDepth++;
|
||||
|
Loading…
Reference in New Issue
Block a user