Bug 1403127 - Don't try to pass fullscreen element through IPC. r?jaws
MozReview-Commit-ID: DaiBNVdqAOh
--- 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,
};