Bug 485288 - Update load algorithm again (SM/TB context menu fix)
authorIan Neal <iann_cvs@blueyonder.co.uk>
Sun, 05 Sep 2010 21:42:54 +0100
changeset 6318 c7759a95da8fe4523e8b9d8f86aff0fa71acc628
parent 6317 751fccd282f65ccb8fc9ade555a481232ffcf18a
child 6319 4cc68a47917e4e1cd0a7ce80dbe811b107a9b616
push id4878
push useriann_cvs@blueyonder.co.uk
push dateSun, 05 Sep 2010 20:43:07 +0000
treeherdercomm-central@c7759a95da8f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs485288
Bug 485288 - Update load algorithm again (SM/TB context menu fix) r=neil/standard8
mail/base/content/nsContextMenu.js
suite/common/nsContextMenu.js
--- a/mail/base/content/nsContextMenu.js
+++ b/mail/base/content/nsContextMenu.js
@@ -130,17 +130,18 @@ nsContextMenu.prototype = {
   initMediaPlayerItems: function CM_initMediaPlayerItems() {
     let onMedia = this.onVideo || this.onAudio;
     // Several mutually exclusive items.... play/pause, mute/unmute, show/hide
     this.showItem("mailContext-media-play", onMedia && this.target.paused);
     this.showItem("mailContext-media-pause", onMedia && !this.target.paused);
     this.showItem("mailContext-media-mute", onMedia && !this.target.muted);
     this.showItem("mailContext-media-unmute", onMedia && this.target.muted);
     if (onMedia) {
-      let hasError = this.target.error != null;
+      let hasError = this.target.error != null ||
+                     this.target.networkState == this.target.NETWORK_NO_SOURCE;
       this.setItemAttr("mailContext-media-play", "disabled", hasError);
       this.setItemAttr("mailContext-media-pause", "disabled", hasError);
       this.setItemAttr("mailContext-media-mute", "disabled", hasError);
       this.setItemAttr("mailContext-media-unmute", "disabled", hasError);
     }
   },
   initBrowserItems: function CM_initBrowserItems() {
     // Work out if we are a context menu on a special item e.g. an image, link
--- a/suite/common/nsContextMenu.js
+++ b/suite/common/nsContextMenu.js
@@ -376,17 +376,18 @@ nsContextMenu.prototype = {
                   onMedia && !this.target.paused && !this.target.ended);
     this.showItem("context-media-mute", onMedia && !this.target.muted);
     this.showItem("context-media-unmute", onMedia && this.target.muted);
     this.showItem("context-media-showcontrols", onMedia && !this.target.controls);
     this.showItem("context-media-hidecontrols", onMedia && this.target.controls);
     this.showItem("context-video-fullscreen", this.onVideo);
     // Disable them when there isn't a valid media source loaded.
     if (onMedia) {
-      var hasError = this.target.error != null;
+      var hasError = this.target.error != null ||
+                     this.target.networkState == this.target.NETWORK_NO_SOURCE;
       this.setItemAttr("context-media-play", "disabled", hasError);
       this.setItemAttr("context-media-pause", "disabled", hasError);
       this.setItemAttr("context-media-mute", "disabled", hasError);
       this.setItemAttr("context-media-unmute", "disabled", hasError);
       this.setItemAttr("context-media-showcontrols", "disabled", hasError);
       this.setItemAttr("context-media-hidecontrols", "disabled", hasError);
       if (this.onVideo)
         this.setItemAttr("context-video-fullscreen",  "disabled", hasError);