Bug 743198 part 8 - Use unprefixed Fullscreen API in chrome code. r=smaug
authorXidorn Quan <quanxunzhen@gmail.com>
Wed, 17 Feb 2016 08:47:11 +0800
changeset 322683 55ecf767b62d74c1337d3209e9df13aed1205c92
parent 322682 a72b6cfcb2e1e07dfcb80a7c4928fa15a8bb22c2
child 322684 9508a74b97eeae06d3a38470d1a1e2438399a5f2
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs743198
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 743198 part 8 - Use unprefixed Fullscreen API in chrome code. r=smaug
browser/base/content/browser-fullScreen.js
browser/base/content/browser-social.js
browser/base/content/content.js
browser/base/content/nsContextMenu.js
browser/base/content/tab-content.js
browser/components/nsBrowserGlue.js
dom/browser-element/BrowserElementChildPreload.js
dom/browser-element/BrowserElementParent.js
mobile/android/chrome/content/browser.js
toolkit/content/TopLevelVideoDocument.js
toolkit/content/widgets/videocontrols.xml
webapprt/Startup.jsm
webapprt/content/webapp.js
--- a/browser/base/content/browser-fullScreen.js
+++ b/browser/base/content/browser-fullScreen.js
@@ -59,62 +59,62 @@ var FullScreen = {
       this._fullScrToggler = document.getElementById("fullscr-toggler");
       this._fullScrToggler.addEventListener("mouseover", this._expandCallback, false);
       this._fullScrToggler.addEventListener("dragenter", this._expandCallback, false);
     }
 
     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");
       document.documentElement.removeAttribute("inFullscreen");
       document.documentElement.removeAttribute("OSXLionFullscreen");
     }
 
-    if (!document.mozFullScreen)
+    if (!document.fullscreenElement)
       this._updateToolbars(enterFS);
 
     if (enterFS) {
       document.addEventListener("keypress", this._keyToggleCallback, false);
       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 {
       this.showNavToolbox(false);
       // This is needed if they use the context menu to quit fullscreen
       this._isPopupOpen = false;
       this.cleanup();
       // In TabsInTitlebar._update(), we cancel the appearance update on
       // resize event for exiting fullscreen, since that happens before we
       // change the UI here in the "fullscreen" event. Hence we need to
       // call it here to ensure the appearance is properly updated. See
       // TabsInTitlebar._update() and bug 1173768.
       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;
       case "fullscreen":
         this.toggle();
         break;
       case "MozDOMFullscreen:Entered": {
         // The event target is the element which requested the DOM
@@ -127,21 +127,21 @@ var FullScreen = {
         let browser;
         if (event.target == gBrowser) {
           browser = event.originalTarget;
         } else {
           let topWin = event.target.ownerDocument.defaultView.top;
           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;
         }
         // If it is a remote browser, send a message to ask the content
         // to enter fullscreen state. We don't need to do so if it is an
         // in-process browser, since all related document should have
         // entered fullscreen state at this point.
         if (this._isRemoteBrowser(browser)) {
@@ -173,17 +173,17 @@ var FullScreen = {
       case "DOMFullscreen:Painted": {
         Services.obs.notifyObservers(window, "fullscreen-painted", "");
         break;
       }
     }
   },
 
   enterDomFullscreen : function(aBrowser) {
-    if (!document.mozFullScreen)
+    if (!document.fullscreenElement)
       return false;
 
     // If we've received a fullscreen notification, we have to ensure that the
     // element that's requesting fullscreen belongs to the browser that's currently
     // active. If not, we exit fullscreen since the "full-screen document" isn't
     // actually visible now.
     if (gBrowser.selectedBrowser != aBrowser) {
       return false;
@@ -360,17 +360,17 @@ var FullScreen = {
         get delay() {
           return this._delay;
         }
       };
     },
 
     // Shows a warning that the site has entered fullscreen for a short duration.
     show: function(aOrigin) {
-      if (!document.mozFullScreen) {
+      if (!document.fullscreenElement) {
         return;
       }
 
       if (!this._element) {
         this._element = document.getElementById("fullscreen-warning");
         // Setup event listeners
         this._element.addEventListener("transitionend", this);
         window.addEventListener("mousemove", this, true);
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -758,17 +758,17 @@ SocialShare = {
   }
 };
 
 SocialSidebar = {
   _openStartTime: 0,
 
   // 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);
   },
 
   // Whether the user has toggled the sidebar on (for windows where it can appear)
   get opened() {
     let broadcaster = document.getElementById("socialSidebarBroadcaster");
     return !broadcaster.hidden;
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -714,18 +714,18 @@ addMessageListener("ContextMenu:MediaCom
     case "hidestats":
     case "showstats":
       let event = media.ownerDocument.createEvent("CustomEvent");
       event.initCustomEvent("media-showStatistics", false, true,
                             message.data.command == "showstats");
       media.dispatchEvent(event);
       break;
     case "fullscreen":
-      if (content.document.mozFullScreenEnabled)
-        media.mozRequestFullScreen();
+      if (content.document.fullscreenEnabled)
+        media.requestFullscreen();
       break;
   }
 });
 
 addMessageListener("ContextMenu:Canvas:ToDataURL", (message) => {
   let dataURL = message.objects.target.toDataURL();
   sendAsyncMessage("ContextMenu:Canvas:ToDataURL:Result", { dataURL });
 });
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -171,17 +171,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.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
     if (shouldShow)
         this.showItem("context-media-sep-commands", true);
   },
 
   initSaveItems: function CM_initSaveItems() {
@@ -467,17 +467,17 @@ nsContextMenu.prototype = {
     // Several mutually exclusive items... play/pause, mute/unmute, show/hide
     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.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);
     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) {
@@ -1160,17 +1160,17 @@ nsContextMenu.prototype = {
       saveImageURL(dataURL, name, "SaveImageTitle", true, false,
                    document.documentURIObject, null, null, null,
                    isPrivate);
     };
     mm.addMessageListener("ContextMenu:SaveVideoFrameAsImage:Result", onMessage);
   },
 
   leaveDOMFullScreen: function() {
-    document.mozCancelFullScreen();
+    document.exitFullscreen();
   },
 
   // Change current window to the URL of the background image.
   viewBGImage: function(e) {
     urlSecurityCheck(this.bgImageURL,
                      this.browser.contentPrincipal,
                      Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
     openUILink(this.bgImageURL, e, { disallowInheritPrincipal: true,
--- a/browser/base/content/tab-content.js
+++ b/browser/base/content/tab-content.js
@@ -627,17 +627,17 @@ var DOMFullscreenHandler = {
     return content.QueryInterface(Ci.nsIInterfaceRequestor)
                   .getInterface(Ci.nsIDOMWindowUtils);
   },
 
   receiveMessage: function(aMessage) {
     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.
           sendAsyncMessage("DOMFullscreen:Exit");
         }
         break;
       }
       case "DOMFullscreen:CleanUp": {
@@ -665,17 +665,17 @@ var DOMFullscreenHandler = {
       }
       case "MozDOMFullscreen:Exit": {
         sendAsyncMessage("DOMFullscreen:Exit");
         break;
       }
       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.
           sendAsyncMessage("DOMFullscreen:Exit");
         }
         break;
       }
       case "MozAfterPaint": {
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2674,32 +2674,32 @@ ContentPermissionPrompt.prototype = {
     function onFullScreen() {
       notification.remove();
     }
 
     let options = {};
     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();
         }
       }
     }
 
     let notification =
       this._showPrompt(aRequest, message, "pointerLock", actions, "pointerLock",
                        "pointerLock-notification-icon", options);
 
     // pointerLock is automatically allowed in fullscreen mode (and revoked
     // 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) {
     // Only allow exactly one permission request here.
     let types = request.types.QueryInterface(Ci.nsIArray);
     if (types.length != 1) {
       request.cancel();
       return;
--- a/dom/browser-element/BrowserElementChildPreload.js
+++ b/dom/browser-element/BrowserElementChildPreload.js
@@ -525,17 +525,17 @@ BrowserElementChild.prototype = {
 
     debug("recvStopWaiting " + win);
     win.modalReturnValue = returnValue;
     win.modalDepth--;
   },
 
   _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.
       sendAsyncMsg("exit-dom-fullscreen");
     }
   },
 
   _recvExitFullscreen: function() {
--- a/dom/browser-element/BrowserElementParent.js
+++ b/dom/browser-element/BrowserElementParent.js
@@ -281,17 +281,17 @@ BrowserElementParent.prototype = {
     // To accomplish this, we register just one listener on the window, and have
     // it reference a WeakMap whose keys are all the BrowserElementParent objects
     // on the window.  Then when the listener fires, we iterate over the
     // WeakMap's keys (which we can do, because we're chrome) to notify the
     // BrowserElementParents.
     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) {
         els.addSystemEventListener(this._window, event, handler,
                                    /* useCapture = */ true);
       }
     }
 
@@ -1248,18 +1248,18 @@ BrowserElementParent.prototype = {
     this._windowUtils.remoteFrameFullscreenReverted();
   },
 
   _handleOwnerEvent: function(evt) {
     switch (evt.type) {
       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;
           this._sendAsyncMsg('entered-fullscreen');
         }
         break;
     }
   },
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -466,29 +466,29 @@ var BrowserApp = {
     }
 
     window.addEventListener("fullscreen", function() {
       Messaging.sendRequest({
         type: window.fullScreen ? "ToggleChrome:Hide" : "ToggleChrome:Show"
       });
     }, 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);
 
     // When a restricted key is pressed in DOM full-screen mode, we should display
     // the "Press ESC to exit" warning message.
     window.addEventListener("MozShowFullScreenWarning", showFullScreenWarning, true);
 
     NativeWindow.init();
@@ -898,20 +898,20 @@ var BrowserApp = {
       icon: "drawable://ic_menu_share",
       callback: function(aTarget) {
         // share.1 telemetry is handled in Java via PromptList
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_share_media");
       }
     });
 
     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"),
       NativeWindow.contextmenus.mediaContext("media-unmuted"),
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_mute");
         aTarget.muted = true;
       });
@@ -1349,17 +1349,17 @@ var BrowserApp = {
       Cu.reportError("Error trying to select tab (tab doesn't exist)");
       return;
     }
 
     // There's nothing to do if the tab is already selected
     if (aTab == this.selectedTab)
       return;
 
-    this.selectedBrowser.contentDocument.mozCancelFullScreen();
+    this.selectedBrowser.contentDocument.exitFullscreen();
 
     let message = {
       type: "Tab:Select",
       tabID: aTab.id
     };
     Messaging.sendRequest(message);
   },
 
@@ -1804,17 +1804,17 @@ var BrowserApp = {
         this.scrollToFocusedInput(browser, false);
         break;
 
       case "Sanitize:ClearData":
         this.sanitize(JSON.parse(aData));
         break;
 
       case "FullScreen:Exit":
-        browser.contentDocument.mozCancelFullScreen();
+        browser.contentDocument.exitFullscreen();
         break;
 
       case "Viewport:Change":
         if (this.isBrowserContentDocumentDisplayed())
           this.selectedTab.setViewport(JSON.parse(aData));
         break;
 
       case "Viewport:Flush":
@@ -6799,18 +6799,18 @@ var ActivityObserver = {
 
   observe: function ao_observe(aSubject, aTopic, aData) {
     let isForeground = false;
     let tab = BrowserApp.selectedTab;
 
     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;
       case "application-foreground" :
         isForeground = true;
         break;
     }
 
--- a/toolkit/content/TopLevelVideoDocument.js
+++ b/toolkit/content/TopLevelVideoDocument.js
@@ -24,20 +24,20 @@ document.addEventListener("keypress", ev
       return;
     }
 
     // If we're not in broser fullscreen mode, prevent entering into that,
     // so we don't end up there after pressing Esc.
     ev.preventDefault();
     ev.stopPropagation();
 
-    if (!document.mozFullScreenElement) {
-      videoElement.mozRequestFullScreen();
+    if (!document.fullscreenElement) {
+      videoElement.requestFullscreen();
     } else {
-      document.mozCancelFullScreen();
+      document.exitFullscreen();
     }
     return;
   }
 
   // Check if the video element is focused, so it already receives
   // keystrokes, and don't send it another one from here.
   if (document.activeElement == videoElement)
     return;
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -991,17 +991,17 @@
                         // when we remove the attribute.
                         element.clientTop;
                         element.removeAttribute("fadeout");
                         if (element.classList.contains("controlBar"))
                             this.controlsSpacer.removeAttribute("hideCursor");
                     } 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);
 
                     }
                 },
 
                 onTransitionEnd : function (event) {
                     // Ignore events for things other than opacity changes.
                     if (event.propertyName != "opacity")
@@ -1050,27 +1050,27 @@
                     }
 
                     // We'll handle style changes in the event listener for
                     // the "volumechange" event, same as if content script was
                     // controlling volume.
                 },
 
                 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;
                     }
                     this.controlBar.removeAttribute("fullscreen-unavailable");
                     this.adjustControlSize();
 
                     var attrName = this.isVideoInFullScreen() ? "exitfullscreenlabel" : "enterfullscreenlabel";
@@ -1510,17 +1510,17 @@
                     addListener(this.playButton, "command", this.togglePause);
                     addListener(this.fullscreenButton, "command", this.toggleFullscreen);
                     addListener(this.clickToPlay, "click", this.clickToPlayClickHandler);
                     addListener(this.controlsSpacer, "click", this.clickToPlayClickHandler);
                     addListener(this.controlsSpacer, "dblclick", this.toggleFullscreen);
 
                     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) {
                         event.preventDefault(); //prevent dragging of controls image (bug 517114)
                     });
 
                     this.log("--- videocontrols initialized ---");
                 }
--- a/webapprt/Startup.jsm
+++ b/webapprt/Startup.jsm
@@ -155,15 +155,15 @@ this.startup = function(window) {
     // Set the principal to the correct appID and launch the application.
     appBrowser.docShell.setIsApp(WebappRT.appID);
     appBrowser.setAttribute("src", WebappRT.launchURI);
 
     if (appData.manifest.fullscreen) {
       appBrowser.addEventListener("load", function onLoad() {
         appBrowser.removeEventListener("load", onLoad, true);
         appBrowser.contentDocument.
-          documentElement.mozRequestFullScreen();
+          documentElement.requestFullscreen();
       }, true);
     }
 
     WebappRT.startUpdateService();
   });
 }
--- a/webapprt/content/webapp.js
+++ b/webapprt/content/webapp.js
@@ -59,17 +59,17 @@ var progressListener = {
     document.documentElement.setAttribute("title", title);
 
 #ifndef XP_WIN
 #ifndef XP_MACOSX
     if (isSameOrigin) {
       // 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";
       }
     }
 #endif
 #endif
   },
 
   onStateChange: function onStateChange(aProgress, aRequest, aFlags, aStatus) {
@@ -132,18 +132,18 @@ function onUnload() {
   gAppBrowser.removeProgressListener(progressListener);
   gAppBrowser.removeEventListener("mozbrowseropenwindow", onOpenWindow);
 }
 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 = "";
   }
 }, false);
 #endif
 
 // On Mac, we dynamically create the label for the Quit menuitem, using