Bug 1403127 - Don't try to pass fullscreen element through IPC. r=jaws, a=sledru
authorXidorn Quan <me@upsuper.org>
Wed, 27 Sep 2017 16:27:36 +1000
changeset 432041 c786424818eae74178d9412cf999507be271d3cd
parent 432040 04e56dc5714e1b5d71dedc47ab372f03a2fcc19b
child 432042 1322c11127a063fc0172f8519b06e04380917163
push id7872
push userryanvm@gmail.com
push dateMon, 02 Oct 2017 15:07:52 +0000
treeherdermozilla-beta@0b50c7250aa6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, sledru
bugs1403127
milestone57.0
Bug 1403127 - Don't try to pass fullscreen element through IPC. r=jaws, a=sledru MozReview-Commit-ID: DaiBNVdqAOh
browser/base/content/nsContextMenu.js
browser/modules/ContextMenu.jsm
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -374,17 +374,17 @@ nsContextMenu.prototype = {
     this.showItem("context-stop", stopReloadItem == "stop");
 
     // XXX: Stop is determined in browser.js; the canStop broadcaster is broken
     // this.setItemAttrFromNode( "context-stop", "disabled", "canStop" );
   },
 
   initLeaveDOMFullScreenItems: function CM_initLeaveFullScreenItem() {
     // only show the option if the user is in DOM fullscreen
-    var shouldShow = (this.target.ownerDocument.fullscreenElement != null);
+    var shouldShow = this.target.ownerDocument.fullscreen;
     this.showItem("context-leave-dom-fullscreen", shouldShow);
 
     // Explicitly show if in DOM fullscreen, but do not hide it has already been shown
     if (shouldShow)
         this.showItem("context-media-sep-commands", true);
   },
 
   initSaveItems: function CM_initSaveItems() {
@@ -638,17 +638,17 @@ nsContextMenu.prototype = {
     this.showItem("context-media-play", onMedia && (this.target.paused || this.target.ended));
     this.showItem("context-media-pause", 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-playbackrate", onMedia && this.target.duration != Number.POSITIVE_INFINITY);
     this.showItem("context-media-loop", onMedia);
     this.showItem("context-media-showcontrols", onMedia && !this.target.controls);
     this.showItem("context-media-hidecontrols", this.target.controls && (this.onVideo || (this.onAudio && !this.inSyntheticDoc)));
-    this.showItem("context-video-fullscreen", this.onVideo && this.target.ownerDocument.fullscreenElement == null);
+    this.showItem("context-video-fullscreen", this.onVideo && !this.target.ownerDocument.fullscreen);
     this.showItem("context-media-eme-learnmore", this.onDRMMedia);
     this.showItem("context-media-eme-separator", this.onDRMMedia);
 
     // Disable them when there isn't a valid media source loaded.
     if (onMedia) {
       this.setItemAttr("context-media-playbackrate-050x", "checked", this.target.playbackRate == 0.5);
       this.setItemAttr("context-media-playbackrate-100x", "checked", this.target.playbackRate == 1.0);
       this.setItemAttr("context-media-playbackrate-125x", "checked", this.target.playbackRate == 1.25);
--- a/browser/modules/ContextMenu.jsm
+++ b/browser/modules/ContextMenu.jsm
@@ -643,17 +643,17 @@ class ContextMenu {
    */
   _cleanContext(aEvent) {
     const context = this.context;
     const cleanTarget = Object.create(null);
 
     cleanTarget.ownerDocument = {
       // used for nsContextMenu.initLeaveDOMFullScreenItems and
       // nsContextMenu.initMediaPlayerItems
-      fullscreenElement: context.target.ownerDocument.fullscreenElement,
+      fullscreen: context.target.ownerDocument.fullscreen,
 
       // used for nsContextMenu.initMiscItems
       contentType: context.target.ownerDocument.contentType,
 
       // used for nsContextMenu.saveLink
       isPrivate: context.target.ownerDocument.isPrivate,
     };