mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 235825: "I'm Feeling Lucky" search from address bar doesn't activate Stop toolbar button, patch by Simon Bünzli <zeniko@gmail.com>, r=mconnor
This commit is contained in:
parent
b64425ac30
commit
bf4329a629
@ -301,6 +301,9 @@
|
||||
mMessage: "",
|
||||
mTotalProgress: 0,
|
||||
|
||||
// count of open requests (should always be 0 or 1)
|
||||
mRequestCount: 0,
|
||||
|
||||
onProgressChange : function (aWebProgress, aRequest,
|
||||
aCurSelfProgress, aMaxSelfProgress,
|
||||
aCurTotalProgress, aMaxTotalProgress)
|
||||
@ -328,6 +331,21 @@
|
||||
const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
|
||||
const nsIChannel = Components.interfaces.nsIChannel;
|
||||
|
||||
if (aStateFlags & nsIWebProgressListener.STATE_START) {
|
||||
this.mRequestCount++;
|
||||
}
|
||||
else if (aStateFlags & nsIWebProgressListener.STATE_STOP) {
|
||||
const NS_ERROR_UNKNOWN_HOST = 2152398878;
|
||||
if (--this.mRequestCount > 0 && aStatus == NS_ERROR_UNKNOWN_HOST) {
|
||||
// to prevent bug 235825: wait for the request handled
|
||||
// by the automatic keyword resolver
|
||||
return;
|
||||
}
|
||||
// since we (try to) only handle STATE_STOP of the last request,
|
||||
// the count of open requests should now be 0
|
||||
this.mRequestCount = 0;
|
||||
}
|
||||
|
||||
if (aStateFlags & nsIWebProgressListener.STATE_START &&
|
||||
aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
|
||||
// It's okay to clear what the user typed when we start
|
||||
|
Loading…
Reference in New Issue
Block a user