From 353782471d094193eb8d837f4b9eed5d36da08e7 Mon Sep 17 00:00:00 2001 From: "kyle.yuan%sun.com" Date: Thu, 14 Sep 2006 06:04:59 +0000 Subject: [PATCH] 152651 Main menu items get forver disabled after the invocation of Save File dialog. r=jag, sr=bz Check in for Simford.Dong@sun.com's fix git-svn-id: svn://10.0.0.236/trunk@211203 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/suite/browser/nsBrowserStatusHandler.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mozilla/suite/browser/nsBrowserStatusHandler.js b/mozilla/suite/browser/nsBrowserStatusHandler.js index d7381971202..cc9c266a364 100644 --- a/mozilla/suite/browser/nsBrowserStatusHandler.js +++ b/mozilla/suite/browser/nsBrowserStatusHandler.js @@ -82,6 +82,8 @@ nsBrowserStatusHandler.prototype = hideAboutBlank : true, + locationChanged : false, + QueryInterface : function(aIID) { if (aIID.equals(Components.interfaces.nsIWebProgressListener) || @@ -225,6 +227,8 @@ nsBrowserStatusHandler.prototype = this.stopButton.disabled = false; this.stopMenu.removeAttribute('disabled'); this.stopContext.removeAttribute('disabled'); + + this.locationChanged = false; } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { @@ -273,7 +277,12 @@ nsBrowserStatusHandler.prototype = } this.status = ""; this.setDefaultStatus(msg); - if (channel) { + + //if the location hasn't been changed, the document may be null(eg a full-page plugin), + //we may not be able to get the correct content-type. + //so we need to skip the test and keep the menu status. + //otherwise(this.locationChanged = true), test normally. + if (channel && this.locationChanged) { try { ctype = channel.contentType; if (this.mimeTypeIsTextBased(ctype)) @@ -336,6 +345,8 @@ nsBrowserStatusHandler.prototype = SetPageProxyState("valid", aLocation); } UpdateBackForwardButtons(); + + this.locationChanged = true; }, onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage)