mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 959585, clear capturing content before entering modal state, r=mrbkap, f=enn
--HG-- extra : rebase_source : 31d6fa26fbabd6cdded638fa24d946f9f9d97a13
This commit is contained in:
parent
bf5779d924
commit
d8fb2aa926
@ -8225,10 +8225,20 @@ nsGlobalWindow::EnterModalState()
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the capturing content if it is under topDoc.
|
||||
// Usually the activeESM check above does that, but there are cases when
|
||||
// we don't have activeESM, or it is for different document.
|
||||
nsIDocument* topDoc = topWin->GetExtantDoc();
|
||||
nsIContent* capturingContent = nsIPresShell::GetCapturingContent();
|
||||
if (capturingContent && topDoc &&
|
||||
nsContentUtils::ContentIsCrossDocDescendantOf(capturingContent, topDoc)) {
|
||||
nsIPresShell::SetCapturingContent(nullptr, 0);
|
||||
}
|
||||
|
||||
if (topWin->mModalStateDepth == 0) {
|
||||
NS_ASSERTION(!mSuspendedDoc, "Shouldn't have mSuspendedDoc here!");
|
||||
|
||||
mSuspendedDoc = topWin->GetExtantDoc();
|
||||
mSuspendedDoc = topDoc;
|
||||
if (mSuspendedDoc) {
|
||||
mSuspendedDoc->SuppressEventHandling();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user