mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 585813 - Script timeout at tabbrowser.xml:1457 when closing tabs; r=dao
This commit is contained in:
parent
162742acd3
commit
5c9c25807a
@ -1557,15 +1557,26 @@
|
||||
<parameter name="aCloseWindowFastpath"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (aTab.closing || this._windowIsClosing)
|
||||
if (aTab.closing ||
|
||||
aTab._pendingPermitUnload ||
|
||||
this._windowIsClosing)
|
||||
return false;
|
||||
|
||||
var browser = this.getBrowserForTab(aTab);
|
||||
|
||||
if (!aTabWillBeMoved) {
|
||||
let ds = browser.docShell;
|
||||
if (ds && ds.contentViewer && !ds.contentViewer.permitUnload())
|
||||
return false;
|
||||
if (ds && ds.contentViewer) {
|
||||
// We need to block while calling permitUnload() because it
|
||||
// processes the event queue and may lead to another removeTab()
|
||||
// call before permitUnload() even returned.
|
||||
aTab._pendingPermitUnload = true;
|
||||
let permitUnload = ds.contentViewer.permitUnload();
|
||||
delete aTab._pendingPermitUnload;
|
||||
|
||||
if (!permitUnload)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var closeWindow = false;
|
||||
|
Loading…
Reference in New Issue
Block a user