mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1106075 - Fix for double click to try again for offline errors. r=Dao
This commit is contained in:
parent
f2389f4bbb
commit
55c70f3624
@ -2562,7 +2562,7 @@ let BrowserOnClick = {
|
||||
let mm = window.messageManager;
|
||||
mm.addMessageListener("Browser:CertExceptionError", this);
|
||||
mm.addMessageListener("Browser:SiteBlockedError", this);
|
||||
mm.addMessageListener("Browser:NetworkError", this);
|
||||
mm.addMessageListener("Browser:EnableOnlineMode", this);
|
||||
mm.addMessageListener("Browser:SendSSLErrorReport", this);
|
||||
mm.addMessageListener("Browser:SetSSLErrorReportAuto", this);
|
||||
},
|
||||
@ -2571,7 +2571,7 @@ let BrowserOnClick = {
|
||||
let mm = window.messageManager;
|
||||
mm.removeMessageListener("Browser:CertExceptionError", this);
|
||||
mm.removeMessageListener("Browser:SiteBlockedError", this);
|
||||
mm.removeMessageListener("Browser:NetworkError", this);
|
||||
mm.removeMessageListener("Browser:EnableOnlineMode", this);
|
||||
mm.removeMessageListener("Browser:SendSSLErrorReport", this);
|
||||
mm.removeMessageListener("Browser:SetSSLErrorReportAuto", this);
|
||||
},
|
||||
@ -2605,9 +2605,12 @@ let BrowserOnClick = {
|
||||
this.onAboutBlocked(msg.data.elementId, msg.data.isMalware,
|
||||
msg.data.isTopFrame, msg.data.location);
|
||||
break;
|
||||
case "Browser:NetworkError":
|
||||
// Reset network state, the error page will refresh on its own.
|
||||
Services.io.offline = false;
|
||||
case "Browser:EnableOnlineMode":
|
||||
if (Services.io.offline) {
|
||||
// Reset network state and refresh the page.
|
||||
Services.io.offline = false;
|
||||
msg.target.reload();
|
||||
}
|
||||
break;
|
||||
case "Browser:SendSSLErrorReport":
|
||||
this.onSSLErrorReport(msg.target, msg.data.elementId,
|
||||
|
@ -568,7 +568,8 @@ let ClickEventHandler = {
|
||||
this.onAboutBlocked(originalTarget, ownerDoc);
|
||||
return;
|
||||
} else if (ownerDoc.documentURI.startsWith("about:neterror")) {
|
||||
this.onAboutNetError(originalTarget, ownerDoc);
|
||||
this.onAboutNetError(event, ownerDoc.documentURI);
|
||||
return;
|
||||
}
|
||||
|
||||
let [href, node] = this._hrefAndLinkNodeForClickEvent(event);
|
||||
@ -635,12 +636,18 @@ let ClickEventHandler = {
|
||||
});
|
||||
},
|
||||
|
||||
onAboutNetError: function (targetElement, ownerDoc) {
|
||||
let elmId = targetElement.getAttribute("id");
|
||||
if (elmId != "errorTryAgain" || !/e=netOffline/.test(ownerDoc.documentURI)) {
|
||||
onAboutNetError: function (event, documentURI) {
|
||||
let elmId = event.originalTarget.getAttribute("id");
|
||||
if (elmId != "errorTryAgain" || !/e=netOffline/.test(documentURI)) {
|
||||
return;
|
||||
}
|
||||
sendSyncMessage("Browser:NetworkError", {});
|
||||
// browser front end will handle clearing offline mode and refreshing
|
||||
// the page *if* we're in offline mode now. Otherwise let the error page
|
||||
// handle the click.
|
||||
if (Services.io.offline) {
|
||||
event.preventDefault();
|
||||
sendAsyncMessage("Browser:EnableOnlineMode", {});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -56,12 +56,12 @@ function checkPage() {
|
||||
// the actual example.com.
|
||||
Services.prefs.setIntPref("network.proxy.type", proxyPrefValue);
|
||||
|
||||
Services.obs.addObserver(function observer(aSubject, aTopic) {
|
||||
ok(!Services.io.offline, "After clicking the Try Again button, we're back " +
|
||||
"online.");
|
||||
finish();
|
||||
}, "network:offline-status-changed", false);
|
||||
gBrowser.contentDocument.getElementById("errorTryAgain").click();
|
||||
|
||||
ok(!Services.io.offline, "After clicking the Try Again button, we're back " +
|
||||
"online.");
|
||||
|
||||
finish();
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
|
Loading…
Reference in New Issue
Block a user