mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 743198 part 8 - Use unprefixed Fullscreen API in chrome code. r=smaug
This commit is contained in:
parent
2f4b14ff27
commit
7cada478d1
@ -64,7 +64,7 @@ var FullScreen = {
|
||||
if (enterFS) {
|
||||
gNavToolbox.setAttribute("inFullscreen", true);
|
||||
document.documentElement.setAttribute("inFullscreen", true);
|
||||
if (!document.mozFullScreen && this.useLionFullScreen)
|
||||
if (!document.fullscreenElement && this.useLionFullScreen)
|
||||
document.documentElement.setAttribute("OSXLionFullscreen", true);
|
||||
} else {
|
||||
gNavToolbox.removeAttribute("inFullscreen");
|
||||
@ -72,7 +72,7 @@ var FullScreen = {
|
||||
document.documentElement.removeAttribute("OSXLionFullscreen");
|
||||
}
|
||||
|
||||
if (!document.mozFullScreen)
|
||||
if (!document.fullscreenElement)
|
||||
this._updateToolbars(enterFS);
|
||||
|
||||
if (enterFS) {
|
||||
@ -80,7 +80,7 @@ var FullScreen = {
|
||||
document.addEventListener("popupshown", this._setPopupOpen, false);
|
||||
document.addEventListener("popuphidden", this._setPopupOpen, false);
|
||||
// In DOM fullscreen mode, we hide toolbars with CSS
|
||||
if (!document.mozFullScreen)
|
||||
if (!document.fullscreenElement)
|
||||
this.hideNavToolbox(true);
|
||||
}
|
||||
else {
|
||||
@ -96,20 +96,20 @@ var FullScreen = {
|
||||
TabsInTitlebar.updateAppearance(true);
|
||||
}
|
||||
|
||||
if (enterFS && !document.mozFullScreen) {
|
||||
if (enterFS && !document.fullscreenElement) {
|
||||
Services.telemetry.getHistogramById("FX_BROWSER_FULLSCREEN_USED")
|
||||
.add(1);
|
||||
}
|
||||
},
|
||||
|
||||
exitDomFullScreen : function() {
|
||||
document.mozCancelFullScreen();
|
||||
document.exitFullscreen();
|
||||
},
|
||||
|
||||
handleEvent: function (event) {
|
||||
switch (event.type) {
|
||||
case "activate":
|
||||
if (document.mozFullScreen) {
|
||||
if (document.fullscreenElement) {
|
||||
this._WarningBox.show();
|
||||
}
|
||||
break;
|
||||
@ -132,11 +132,11 @@ var FullScreen = {
|
||||
browser = gBrowser.getBrowserForContentWindow(topWin);
|
||||
}
|
||||
if (!browser || !this.enterDomFullscreen(browser)) {
|
||||
if (document.mozFullScreen) {
|
||||
if (document.fullscreenElement) {
|
||||
// MozDOMFullscreen:Entered is dispatched synchronously in
|
||||
// fullscreen change, hence we have to avoid calling this
|
||||
// method synchronously here.
|
||||
setTimeout(() => document.mozCancelFullScreen(), 0);
|
||||
setTimeout(() => document.exitFullscreen(), 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -178,7 +178,7 @@ var FullScreen = {
|
||||
},
|
||||
|
||||
enterDomFullscreen : function(aBrowser) {
|
||||
if (!document.mozFullScreen)
|
||||
if (!document.fullscreenElement)
|
||||
return false;
|
||||
|
||||
// If we've received a fullscreen notification, we have to ensure that the
|
||||
@ -365,7 +365,7 @@ var FullScreen = {
|
||||
|
||||
// Shows a warning that the site has entered fullscreen for a short duration.
|
||||
show: function(aOrigin) {
|
||||
if (!document.mozFullScreen) {
|
||||
if (!document.fullscreenElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -763,7 +763,7 @@ SocialSidebar = {
|
||||
|
||||
// Whether the sidebar can be shown for this window.
|
||||
get canShow() {
|
||||
if (!SocialUI.enabled || document.mozFullScreen)
|
||||
if (!SocialUI.enabled || document.fullscreenElement)
|
||||
return false;
|
||||
return Social.providers.some(p => p.sidebarURL);
|
||||
},
|
||||
|
@ -719,8 +719,8 @@ addMessageListener("ContextMenu:MediaCommand", (message) => {
|
||||
media.dispatchEvent(event);
|
||||
break;
|
||||
case "fullscreen":
|
||||
if (content.document.mozFullScreenEnabled)
|
||||
media.mozRequestFullScreen();
|
||||
if (content.document.fullscreenEnabled)
|
||||
media.requestFullscreen();
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
@ -176,7 +176,7 @@ nsContextMenu.prototype = {
|
||||
|
||||
initLeaveDOMFullScreenItems: function CM_initLeaveFullScreenItem() {
|
||||
// only show the option if the user is in DOM fullscreen
|
||||
var shouldShow = (this.target.ownerDocument.mozFullScreenElement != null);
|
||||
var shouldShow = (this.target.ownerDocument.fullscreenElement != null);
|
||||
this.showItem("context-leave-dom-fullscreen", shouldShow);
|
||||
|
||||
// Explicitly show if in DOM fullscreen, but do not hide it has already been shown
|
||||
@ -472,7 +472,7 @@ nsContextMenu.prototype = {
|
||||
this.showItem("context-media-playbackrate", onMedia);
|
||||
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 && this.target.ownerDocument.mozFullScreenElement == null);
|
||||
this.showItem("context-video-fullscreen", this.onVideo && this.target.ownerDocument.fullscreenElement == null);
|
||||
var statsShowing = this.onVideo && this.target.mozMediaStatisticsShowing;
|
||||
this.showItem("context-video-showstats", this.onVideo && this.target.controls && !statsShowing);
|
||||
this.showItem("context-video-hidestats", this.onVideo && this.target.controls && statsShowing);
|
||||
@ -1165,7 +1165,7 @@ nsContextMenu.prototype = {
|
||||
},
|
||||
|
||||
leaveDOMFullScreen: function() {
|
||||
document.mozCancelFullScreen();
|
||||
document.exitFullscreen();
|
||||
},
|
||||
|
||||
// Change current window to the URL of the background image.
|
||||
|
@ -632,7 +632,7 @@ var DOMFullscreenHandler = {
|
||||
switch(aMessage.name) {
|
||||
case "DOMFullscreen:Entered": {
|
||||
if (!this._windowUtils.handleFullscreenRequests() &&
|
||||
!content.document.mozFullScreen) {
|
||||
!content.document.fullscreenElement) {
|
||||
// If we don't actually have any pending fullscreen request
|
||||
// to handle, neither we have been in fullscreen, tell the
|
||||
// parent to just exit.
|
||||
@ -670,7 +670,7 @@ var DOMFullscreenHandler = {
|
||||
case "MozDOMFullscreen:Entered":
|
||||
case "MozDOMFullscreen:Exited": {
|
||||
addEventListener("MozAfterPaint", this);
|
||||
if (!content || !content.document.mozFullScreen) {
|
||||
if (!content || !content.document.fullscreenElement) {
|
||||
// If we receive any fullscreen change event, and find we are
|
||||
// actually not in fullscreen, also ask the parent to exit to
|
||||
// ensure that the parent always exits fullscreen when we do.
|
||||
|
@ -2679,7 +2679,7 @@ ContentPermissionPrompt.prototype = {
|
||||
options.removeOnDismissal = autoAllow;
|
||||
options.eventCallback = type => {
|
||||
if (type == "removed") {
|
||||
notification.browser.removeEventListener("mozfullscreenchange", onFullScreen, true);
|
||||
notification.browser.removeEventListener("fullscreenchange", onFullScreen, true);
|
||||
if (autoAllow) {
|
||||
aRequest.allow();
|
||||
}
|
||||
@ -2694,7 +2694,7 @@ ContentPermissionPrompt.prototype = {
|
||||
// upon exit), so if the page enters fullscreen mode after requesting
|
||||
// pointerLock (but before the user has granted permission), we should
|
||||
// remove the now-impotent notification.
|
||||
notification.browser.addEventListener("mozfullscreenchange", onFullScreen, true);
|
||||
notification.browser.addEventListener("fullscreenchange", onFullScreen, true);
|
||||
},
|
||||
|
||||
prompt: function CPP_prompt(request) {
|
||||
|
@ -530,7 +530,7 @@ BrowserElementChild.prototype = {
|
||||
|
||||
_recvEnteredFullscreen: function() {
|
||||
if (!this._windowUtils.handleFullscreenRequests() &&
|
||||
!content.document.mozFullScreen) {
|
||||
!content.document.fullscreenElement) {
|
||||
// If we don't actually have any pending fullscreen request
|
||||
// to handle, neither we have been in fullscreen, tell the
|
||||
// parent to just exit.
|
||||
|
@ -286,7 +286,7 @@ BrowserElementParent.prototype = {
|
||||
if (!this._window._browserElementParents) {
|
||||
this._window._browserElementParents = new WeakMap();
|
||||
let handler = handleWindowEvent.bind(this._window);
|
||||
let windowEvents = ['visibilitychange', 'mozfullscreenchange'];
|
||||
let windowEvents = ['visibilitychange', 'fullscreenchange'];
|
||||
let els = Cc["@mozilla.org/eventlistenerservice;1"]
|
||||
.getService(Ci.nsIEventListenerService);
|
||||
for (let event of windowEvents) {
|
||||
@ -1253,8 +1253,8 @@ BrowserElementParent.prototype = {
|
||||
case 'visibilitychange':
|
||||
this._ownerVisibilityChange();
|
||||
break;
|
||||
case 'mozfullscreenchange':
|
||||
if (!this._window.document.mozFullScreen) {
|
||||
case 'fullscreenchange':
|
||||
if (!this._window.document.fullscreenElement) {
|
||||
this._sendAsyncMsg('exit-fullscreen');
|
||||
} else if (this._pendingDOMFullscreen) {
|
||||
this._pendingDOMFullscreen = false;
|
||||
|
@ -471,19 +471,19 @@ var BrowserApp = {
|
||||
});
|
||||
}, false);
|
||||
|
||||
window.addEventListener("mozfullscreenchange", function(e) {
|
||||
window.addEventListener("fullscreenchange", function(e) {
|
||||
// This event gets fired on the document and its entire ancestor chain
|
||||
// of documents. When enabling fullscreen, it is fired on the top-level
|
||||
// document first and goes down; when disabling the order is reversed
|
||||
// (per spec). This means the last event on enabling will be for the innermost
|
||||
// document, which will have mozFullScreenElement set correctly.
|
||||
// document, which will have fullscreenElement set correctly.
|
||||
let doc = e.target;
|
||||
Messaging.sendRequest({
|
||||
type: doc.mozFullScreen ? "DOMFullScreen:Start" : "DOMFullScreen:Stop",
|
||||
rootElement: (doc.mozFullScreen && doc.mozFullScreenElement == doc.documentElement)
|
||||
type: doc.fullscreenElement ? "DOMFullScreen:Start" : "DOMFullScreen:Stop",
|
||||
rootElement: doc.fullscreenElement == doc.documentElement
|
||||
});
|
||||
|
||||
if (doc.mozFullScreen)
|
||||
if (doc.fullscreenElement)
|
||||
showFullScreenWarning();
|
||||
}, false);
|
||||
|
||||
@ -903,10 +903,10 @@ var BrowserApp = {
|
||||
});
|
||||
|
||||
NativeWindow.contextmenus.add(stringGetter("contextmenu.fullScreen"),
|
||||
NativeWindow.contextmenus.SelectorContext("video:not(:-moz-full-screen)"),
|
||||
NativeWindow.contextmenus.SelectorContext("video:not(:fullscreen)"),
|
||||
function(aTarget) {
|
||||
UITelemetry.addEvent("action.1", "contextmenu", null, "web_fullscreen");
|
||||
aTarget.mozRequestFullScreen();
|
||||
aTarget.requestFullscreen();
|
||||
});
|
||||
|
||||
NativeWindow.contextmenus.add(stringGetter("contextmenu.mute"),
|
||||
@ -1354,7 +1354,7 @@ var BrowserApp = {
|
||||
if (aTab == this.selectedTab)
|
||||
return;
|
||||
|
||||
this.selectedBrowser.contentDocument.mozCancelFullScreen();
|
||||
this.selectedBrowser.contentDocument.exitFullscreen();
|
||||
|
||||
let message = {
|
||||
type: "Tab:Select",
|
||||
@ -1809,7 +1809,7 @@ var BrowserApp = {
|
||||
break;
|
||||
|
||||
case "FullScreen:Exit":
|
||||
browser.contentDocument.mozCancelFullScreen();
|
||||
browser.contentDocument.exitFullscreen();
|
||||
break;
|
||||
|
||||
case "Viewport:Change":
|
||||
@ -6804,8 +6804,8 @@ var ActivityObserver = {
|
||||
switch (aTopic) {
|
||||
case "application-background" :
|
||||
let doc = (tab ? tab.browser.contentDocument : null);
|
||||
if (doc && doc.mozFullScreen) {
|
||||
doc.mozCancelFullScreen();
|
||||
if (doc && doc.fullscreenElement) {
|
||||
doc.exitFullscreen();
|
||||
}
|
||||
isForeground = false;
|
||||
break;
|
||||
|
@ -29,10 +29,10 @@ document.addEventListener("keypress", ev => {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
|
||||
if (!document.mozFullScreenElement) {
|
||||
videoElement.mozRequestFullScreen();
|
||||
if (!document.fullscreenElement) {
|
||||
videoElement.requestFullscreen();
|
||||
} else {
|
||||
document.mozCancelFullScreen();
|
||||
document.exitFullscreen();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -996,7 +996,7 @@
|
||||
} else {
|
||||
element.setAttribute("fadeout", true);
|
||||
if (element.classList.contains("controlBar") && !this.hasError() &&
|
||||
document.mozFullScreenElement == this.video)
|
||||
document.fullscreenElement == this.video)
|
||||
this.controlsSpacer.setAttribute("hideCursor", true);
|
||||
|
||||
}
|
||||
@ -1055,17 +1055,17 @@
|
||||
},
|
||||
|
||||
isVideoInFullScreen : function () {
|
||||
return document.mozFullScreenElement == this.video;
|
||||
return document.fullscreenElement == this.video;
|
||||
},
|
||||
|
||||
toggleFullscreen : function () {
|
||||
this.isVideoInFullScreen() ?
|
||||
document.mozCancelFullScreen() :
|
||||
this.video.mozRequestFullScreen();
|
||||
document.exitFullscreen() :
|
||||
this.video.requestFullscreen();
|
||||
},
|
||||
|
||||
setFullscreenButtonState : function () {
|
||||
if (this.isAudioOnly || !document.mozFullScreenEnabled) {
|
||||
if (this.isAudioOnly || !document.fullscreenEnabled) {
|
||||
this.controlBar.setAttribute("fullscreen-unavailable", true);
|
||||
this.adjustControlSize();
|
||||
return;
|
||||
@ -1515,7 +1515,7 @@
|
||||
|
||||
addListener(this.videocontrols, "resizevideocontrols", this.adjustControlSize);
|
||||
addListener(this.videocontrols, "transitionend", this.onTransitionEnd);
|
||||
addListener(this.video.ownerDocument, "mozfullscreenchange", this.onFullscreenChange);
|
||||
addListener(this.video.ownerDocument, "fullscreenchange", this.onFullscreenChange);
|
||||
addListener(this.video, "keypress", this.keyHandler);
|
||||
|
||||
addListener(this.videocontrols, "dragstart", function(event) {
|
||||
|
@ -160,7 +160,7 @@ this.startup = function(window) {
|
||||
appBrowser.addEventListener("load", function onLoad() {
|
||||
appBrowser.removeEventListener("load", onLoad, true);
|
||||
appBrowser.contentDocument.
|
||||
documentElement.mozRequestFullScreen();
|
||||
documentElement.requestFullscreen();
|
||||
}, true);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ var progressListener = {
|
||||
// On non-Windows platforms, we open new windows in fullscreen mode
|
||||
// if the opener window is in fullscreen mode, so we hide the menubar;
|
||||
// but on Mac we don't need to hide the menubar.
|
||||
if (document.mozFullScreenElement) {
|
||||
if (document.fullscreenElement) {
|
||||
document.getElementById("main-menubar").style.display = "none";
|
||||
}
|
||||
}
|
||||
@ -137,8 +137,8 @@ window.addEventListener("unload", onUnload, false);
|
||||
// Fullscreen handling.
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
document.addEventListener('mozfullscreenchange', function() {
|
||||
if (document.mozFullScreenElement) {
|
||||
document.addEventListener('fullscreenchange', function() {
|
||||
if (document.fullscreenElement) {
|
||||
document.getElementById("main-menubar").style.display = "none";
|
||||
} else {
|
||||
document.getElementById("main-menubar").style.display = "";
|
||||
|
Loading…
Reference in New Issue
Block a user