Bug 1246128: F11 displays the audio container in fullscreen instead of the browser. r?bz
MozReview-Commit-ID: IWKJvwDaFsG
--- 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,