Bug 1246128: F11 displays the audio container in fullscreen instead of the browser. r?bz draft
authorSteffen Wilberg <steffen.wilberg@web.de>
Sun, 07 Feb 2016 17:55:48 +0100
changeset 329894 69afbc27122187252e23112e5bff2d657ea5496f
parent 329876 0e2df20590bdee51dbd978b350f050459d040bb7
child 514057 e25c31ad17ca3dcaf313515e804ceb951907ab62
push id10631
push usersteffen.wilberg@web.de
push dateTue, 09 Feb 2016 21:23:17 +0000
reviewersbz
bugs1246128
milestone47.0a1
Bug 1246128: F11 displays the audio container in fullscreen instead of the browser. r?bz MozReview-Commit-ID: IWKJvwDaFsG
toolkit/content/TopLevelVideoDocument.js
--- a/toolkit/content/TopLevelVideoDocument.js
+++ b/toolkit/content/TopLevelVideoDocument.js
@@ -9,19 +9,19 @@ let videoElement = document.getElementsB
 
 // 1. Handle fullscreen mode;
 // 2. Send keystrokes to the video element if the body element is focused,
 //    to be received by the event listener in videocontrols.xml.
 document.addEventListener("keypress", ev => {
   if (ev.synthetic) // prevent recursion
     return;
 
-  // Maximize the video when pressing F11,
-  // because this is the standanlone video document.
-  if (ev.key == "F11") {
+  // Maximize the standalone video when pressing F11,
+  // but ignore audio elements
+  if (ev.key == "F11" && videoElement.videoWidth != 0 && videoElement.videoHeight != 0) {
     // If we're in browser fullscreen mode, it means the user pressed F11
     // while browser chrome or another tab had focus.
     // Don't break leaving that mode, so do nothing here.
     if (window.fullScreen) {
       return;
     }
 
     // If we're not in broser fullscreen mode, prevent entering into that,