Bug 1274098 - Use unprefixed Fullscreen API in video document / widgets. r=jaws
authorXidorn Quan <me@upsuper.org>
Mon, 30 Sep 2019 15:49:44 +0000
changeset 495754 cda5a7a2655ca029e6b42eb500544b9d48199f0e
parent 495753 6fdd9ba4d2ae4d7d9c0015a94417238fb01530fc
child 495755 1c4e8032c1a4349a7d0d1f4db870a961bc1a4dc5
push id114140
push userdvarga@mozilla.com
push dateWed, 02 Oct 2019 18:04:51 +0000
treeherdermozilla-inbound@32eb0ea893f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1274098
milestone71.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 1274098 - Use unprefixed Fullscreen API in video document / widgets. r=jaws Differential Revision: https://phabricator.services.mozilla.com/D47526
toolkit/content/TopLevelVideoDocument.js
toolkit/content/widgets/videocontrols.js
--- a/toolkit/content/TopLevelVideoDocument.js
+++ b/toolkit/content/TopLevelVideoDocument.js
@@ -54,16 +54,16 @@
         return;
       }
 
       // If we're not in browser 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();
       }
     }
   });
 }
--- a/toolkit/content/widgets/videocontrols.js
+++ b/toolkit/content/widgets/videocontrols.js
@@ -1522,28 +1522,28 @@ this.VideoControlsImplWidget = class {
 
         // We'll handle style changes in the event listener for
         // the "volumechange" event, same as if content script was
         // controlling volume.
       },
 
       get isVideoInFullScreen() {
         return this.video.isSameNode(
-          this.video.getRootNode().mozFullScreenElement
+          this.video.getRootNode().fullscreenElement
         );
       },
 
       toggleFullscreen() {
         this.isVideoInFullScreen
-          ? this.document.mozCancelFullScreen()
-          : this.video.mozRequestFullScreen();
+          ? this.document.exitFullscreen()
+          : this.video.requestFullscreen();
       },
 
       setFullscreenButtonState() {
-        if (this.isAudioOnly || !this.document.mozFullScreenEnabled) {
+        if (this.isAudioOnly || !this.document.fullscreenEnabled) {
           this.controlBar.setAttribute("fullscreen-unavailable", true);
           this.adjustControlSize();
           return;
         }
         this.controlBar.removeAttribute("fullscreen-unavailable");
         this.adjustControlSize();
 
         var attrName = this.isVideoInFullScreen