Bug 863008 Dispatch content event to content so video statistics work r=Ratty a=IanN SEAMONKEY_2_18b3_BUILD1 SEAMONKEY_2_18b3_RELEASE
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Sun, 21 Apr 2013 10:33:42 +0100
changeset 18840 75c893612b002b564d8f5adf155ed493cb10a9fa
parent 18839 9a85f4353a9cbb0e9df98f4027a81d55454d04a7
child 18841 83879b0ce022c6a13df70e3b5d7fe38ff247f149
child 18843 75a68d7d3538488d5e3e3aff2bd9421f844b9bb7
push id912
push userbugzilla@standard8.plus.com
push dateThu, 08 Aug 2013 15:11:51 +0000
treeherdertry-comm-central@6c74575c00ac [default view] [failures only]
reviewersRatty, IanN
bugs863008
Bug 863008 Dispatch content event to content so video statistics work r=Ratty a=IanN
suite/common/nsContextMenu.js
--- a/suite/common/nsContextMenu.js
+++ b/suite/common/nsContextMenu.js
@@ -1383,22 +1383,21 @@ nsContextMenu.prototype = {
         break;
       case "hidecontrols":
         media.removeAttribute("controls");
         break;
       case "showcontrols":
         media.setAttribute("controls", "true");
         break;
       case "showstats":
-        media.dispatchEvent(new CustomEvent("media-showStatistics",
-          { bubbles: false, cancelable: true, detail: true }));
-        break;
       case "hidestats":
-        media.dispatchEvent(new CustomEvent("media-showStatistics",
-          { bubbles: false, cancelable: true, detail: false }));
+        var win = media.ownerDocument.defaultView;
+        var showing = aCommand == "showstats";
+        media.dispatchEvent(new win.CustomEvent("media-showStatistics",
+          { bubbles: false, cancelable: true, detail: showing }));
         break;
     }
   },
 
   copyMediaLocation: function() {
     var clipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
                     .getService(Components.interfaces.nsIClipboardHelper);
     clipboard.copyString(this.mediaURL, this.target.ownerDocument);