diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /browser/base/content/browser-fullScreenAndPointerLock.js | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/base/content/browser-fullScreenAndPointerLock.js')
-rw-r--r-- | browser/base/content/browser-fullScreenAndPointerLock.js | 43 |
1 files changed, 10 insertions, 33 deletions
diff --git a/browser/base/content/browser-fullScreenAndPointerLock.js b/browser/base/content/browser-fullScreenAndPointerLock.js index aae596a0f7..c8794c760c 100644 --- a/browser/base/content/browser-fullScreenAndPointerLock.js +++ b/browser/base/content/browser-fullScreenAndPointerLock.js @@ -365,26 +365,19 @@ var FullScreen = { passive: true, }); - if (enterFS) { - gNavToolbox.setAttribute("inFullscreen", true); - document.documentElement.setAttribute("inFullscreen", true); - let alwaysUsesNativeFullscreen = + document.documentElement.toggleAttribute("inFullscreen", enterFS); + document.documentElement.toggleAttribute( + "macOSNativeFullscreen", + enterFS && AppConstants.platform == "macosx" && - Services.prefs.getBoolPref("full-screen-api.macos-native-full-screen"); - if ( - (alwaysUsesNativeFullscreen || !document.fullscreenElement) && - AppConstants.platform == "macosx" - ) { - document.documentElement.setAttribute("macOSNativeFullscreen", true); - } - } else { - gNavToolbox.removeAttribute("inFullscreen"); - document.documentElement.removeAttribute("inFullscreen"); - document.documentElement.removeAttribute("macOSNativeFullscreen"); - } + (Services.prefs.getBoolPref( + "full-screen-api.macos-native-full-screen" + ) || + !document.fullscreenElement) + ); if (!document.fullscreenElement) { - this._updateToolbars(enterFS); + ToolbarIconColor.inferFromText("fullscreen", enterFS); } if (enterFS) { @@ -948,22 +941,6 @@ var FullScreen = { MousePosTracker.removeListener(this); }, - - _updateToolbars(aEnterFS) { - for (let el of document.querySelectorAll( - "toolbar[fullscreentoolbar=true]" - )) { - // Set the inFullscreen attribute to allow specific styling - // in fullscreen mode - if (aEnterFS) { - el.setAttribute("inFullscreen", true); - } else { - el.removeAttribute("inFullscreen"); - } - } - - ToolbarIconColor.inferFromText("fullscreen", aEnterFS); - }, }; ChromeUtils.defineLazyGetter(FullScreen, "_permissionNotificationIDs", () => { |