Bug 1307122 - Introducing a timeout for sync XHR when unload events are dispatched, r=smaug
This commit is contained in:
@@ -1087,7 +1087,7 @@ nsDocumentViewer::PermitUnloadInternal(bool *aShouldPrompt,
|
||||
static bool sBeforeUnloadRequiresInteraction;
|
||||
static bool sBeforeUnloadPrefsCached = false;
|
||||
|
||||
if (!sBeforeUnloadPrefsCached ) {
|
||||
if (!sBeforeUnloadPrefsCached) {
|
||||
sBeforeUnloadPrefsCached = true;
|
||||
Preferences::AddBoolVarCache(&sIsBeforeUnloadDisabled,
|
||||
BEFOREUNLOAD_DISABLED_PREFNAME);
|
||||
@@ -1135,6 +1135,8 @@ nsDocumentViewer::PermitUnloadInternal(bool *aShouldPrompt,
|
||||
dialogsAreEnabled = globalWindow->AreDialogsEnabled();
|
||||
nsGlobalWindow::TemporarilyDisableDialogs disableDialogs(globalWindow);
|
||||
|
||||
nsIDocument::PageUnloadingEventTimeStamp timestamp(mDocument);
|
||||
|
||||
mInPermitUnload = true;
|
||||
EventDispatcher::DispatchDOMEvent(window, nullptr, event, mPresContext,
|
||||
nullptr);
|
||||
@@ -1318,6 +1320,8 @@ nsDocumentViewer::PageHide(bool aIsUnload)
|
||||
// here.
|
||||
nsAutoPopupStatePusher popupStatePusher(openAbused, true);
|
||||
|
||||
nsIDocument::PageUnloadingEventTimeStamp timestamp(mDocument);
|
||||
|
||||
EventDispatcher::Dispatch(window, mPresContext, &event, nullptr, &status);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user