initial 116 changes firefox116
authorWolfgang Rosenauer <wr@rosenauer.org>
Fri, 04 Aug 2023 12:30:24 +0200
branchfirefox116
changeset 1191 37e065158be7
parent 1190 2a24a948b5cf
child 1192 7612b8d8c46f
initial 116 changes
MozillaFirefox/MozillaFirefox.changes
MozillaFirefox/MozillaFirefox.spec
MozillaFirefox/mozilla-bmo1005535.patch
MozillaFirefox/mozilla-s390x-skia-gradient.patch
MozillaFirefox/tar_stamps
mozilla-bmo1005535.patch
mozilla-bmo1775202.patch
mozilla-fix-top-level-asm.patch
mozilla-kde.patch
mozilla-s390x-skia-gradient.patch
--- a/MozillaFirefox/MozillaFirefox.changes	Sat Jul 29 14:34:45 2023 +0200
+++ b/MozillaFirefox/MozillaFirefox.changes	Fri Aug 04 12:30:24 2023 +0200
@@ -1,4 +1,12 @@
 -------------------------------------------------------------------
+Sun Jul 30 19:55:49 UTC 2023 - Wolfgang Rosenauer <wr@rosenauer.org>
+
+- Mozilla Firefox 116.0
+- require NSS 3.91
+- remove obsolete mozilla-fix-top-level-asm.patch
+- re-enable LTO
+
+-------------------------------------------------------------------
 Fri Jul 28 20:56:00 UTC 2023 - Andreas Stieger <andreas.stieger@gmx.de>
 
 - Mozilla Firefox 115.0.3
--- a/MozillaFirefox/MozillaFirefox.spec	Sat Jul 29 14:34:45 2023 +0200
+++ b/MozillaFirefox/MozillaFirefox.spec	Fri Aug 04 12:30:24 2023 +0200
@@ -28,9 +28,9 @@
 # orig_suffix b3
 # major 69
 # mainver %%major.99
-%define major          115
-%define mainver        %major.0.3
-%define orig_version   115.0.3
+%define major          116
+%define mainver        %major.0
+%define orig_version   116.0
 %define orig_suffix    %{nil}
 %define update_channel release
 %define branding       1
@@ -61,7 +61,7 @@
 %{expand:%%global optflags %(echo "%optflags"|sed -e s/i586/i686/) -march=i686 -mtune=generic -msse2}
 %endif
 %endif
-%{expand:%%global optflags %(echo "%optflags"|sed -e s/-flto=auto//) }
+#%%{expand:%%global optflags %(echo "%optflags"|sed -e s/-flto=auto//) }
 
 # general build definitions
 %define progname firefox
@@ -219,7 +219,7 @@
 Patch10:        mozilla-bmo1504834-part1.patch
 Patch11:        mozilla-bmo1504834-part3.patch
 Patch12:        mozilla-bmo1512162.patch
-Patch13:        mozilla-fix-top-level-asm.patch
+#Patch13:        mozilla-fix-top-level-asm.patch
 Patch14:        mozilla-bmo849632.patch
 Patch15:        mozilla-bmo998749.patch
 Patch17:        mozilla-libavcodec58_91.patch
@@ -493,7 +493,7 @@
 %ifarch x86_64
 # LTO needs newer toolchain stack only (at least GCC 8.2.1 (r268506)
 %if 0%{?suse_version} > 1500
-#ac_add_options --enable-lto
+ac_add_options --enable-lto
 %if 0%{?do_profiling}
 ac_add_options MOZ_PGO=1
 %endif
--- a/MozillaFirefox/mozilla-bmo1005535.patch	Sat Jul 29 14:34:45 2023 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../mozilla-bmo1005535.patch
\ No newline at end of file
--- a/MozillaFirefox/mozilla-s390x-skia-gradient.patch	Sat Jul 29 14:34:45 2023 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../mozilla-s390x-skia-gradient.patch
\ No newline at end of file
--- a/MozillaFirefox/tar_stamps	Sat Jul 29 14:34:45 2023 +0200
+++ b/MozillaFirefox/tar_stamps	Fri Aug 04 12:30:24 2023 +0200
@@ -1,10 +1,10 @@
 PRODUCT="firefox"
 CHANNEL="release"
-VERSION="115.0.3"
+VERSION="116.0"
 VERSION_SUFFIX=""
-PREV_VERSION="115.0.2"
+PREV_VERSION="115.0.3"
 PREV_VERSION_SUFFIX=""
 #SKIP_LOCALES="" # Uncomment to skip l10n and compare-locales-generation
 RELEASE_REPO="https://hg.mozilla.org/releases/mozilla-release"
-RELEASE_TAG="326212e7271a9c9f0776153095cf48d7153260aa"
-RELEASE_TIMESTAMP="20230726201356"
+RELEASE_TAG="e98f6440351172ce5ccd0e3c690025d9e7cb35c3"
+RELEASE_TIMESTAMP="20230727152340"
--- a/mozilla-bmo1005535.patch	Sat Jul 29 14:34:45 2023 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-# HG changeset patch
-# User Steve Singer <steve@ssinger.info>
-# Date 1558451540 -7200
-#      Tue May 21 17:12:20 2019 +0200
-# Node ID 433beec63e6b5f409683af20a0c1ab137cc7bfad
-# Parent  c0fdccc716e80a6d289c94f5d507ae141c62a3bf
-Bug 1005535 - Get skia GPU building on big endian.
-
-diff --git a/gfx/skia/skia/src/gpu/GrColor.h b/gfx/skia/skia/src/gpu/GrColor.h
---- a/gfx/skia/skia/src/gpu/GrColor.h
-+++ b/gfx/skia/skia/src/gpu/GrColor.h
-@@ -59,17 +59,17 @@ static inline GrColor GrColorPackRGBA(un
- #define GrColorUnpackG(color)   (((color) >> GrColor_SHIFT_G) & 0xFF)
- #define GrColorUnpackB(color)   (((color) >> GrColor_SHIFT_B) & 0xFF)
- #define GrColorUnpackA(color)   (((color) >> GrColor_SHIFT_A) & 0xFF)
- 
- /**
-  *  Since premultiplied means that alpha >= color, we construct a color with
-  *  each component==255 and alpha == 0 to be "illegal"
-  */
--#define GrColor_ILLEGAL     (~(0xFF << GrColor_SHIFT_A))
-+#define GrColor_ILLEGAL     ((uint32_t)(~(0xFF << GrColor_SHIFT_A)))
- 
- /** Normalizes and coverts an uint8_t to a float. [0, 255] -> [0.0, 1.0] */
- static inline float GrNormalizeByteToFloat(uint8_t value) {
-     static const float ONE_OVER_255 = 1.f / 255.f;
-     return value * ONE_OVER_255;
- }
- 
- /** Used to pick vertex attribute types. */
--- a/mozilla-bmo1775202.patch	Sat Jul 29 14:34:45 2023 +0200
+++ b/mozilla-bmo1775202.patch	Fri Aug 04 12:30:24 2023 +0200
@@ -6,11 +6,51 @@
  third_party/libwebrtc/moz.build | 7 +++++++
  1 file changed, 7 insertions(+)
 
+diff --git a/third_party/libwebrtc/modules/video_capture/video_capture_internal_impl_gn/moz.build b/third_party/libwebrtc/modules/video_capture/video_capture_internal_impl_gn/moz.build
+--- a/third_party/libwebrtc/modules/video_capture/video_capture_internal_impl_gn/moz.build
++++ b/third_party/libwebrtc/modules/video_capture/video_capture_internal_impl_gn/moz.build
+@@ -318,9 +318,32 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CO
+ 
+     UNIFIED_SOURCES += [
+         "/third_party/libwebrtc/modules/video_capture/linux/camera_portal.cc",
+         "/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc",
+         "/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc",
+         "/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc"
+     ]
+ 
++if CONFIG["CPU_ARCH"] == "ppc64" and CONFIG["OS_TARGET"] == "Linux":
++
++    DEFINES["WEBRTC_ENABLE_AVX2"] = True
++    DEFINES["WEBRTC_USE_PIPEWIRE"] = True
++    DEFINES["_GNU_SOURCE"] = True
++
++    LOCAL_INCLUDES += [
++        "/gfx/angle/checkout/include/",
++        "/third_party/drm/drm/",
++        "/third_party/drm/drm/include/",
++        "/third_party/drm/drm/include/libdrm/",
++        "/third_party/gbm/gbm/",
++        "/third_party/libepoxy/libepoxy/include/",
++        "/third_party/pipewire/"
++    ]
++
++    UNIFIED_SOURCES += [
++        "/third_party/libwebrtc/modules/video_capture/linux/camera_portal.cc",
++        "/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc",
++        "/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc",
++        "/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc"
++    ]
++
+ Library("video_capture_internal_impl_gn")
 diff --git a/third_party/libwebrtc/moz.build b/third_party/libwebrtc/moz.build
-index 976cf373..311519c 100644
 --- a/third_party/libwebrtc/moz.build
 +++ b/third_party/libwebrtc/moz.build
-@@ -566,6 +566,13 @@ if CONFIG["CPU_ARCH"] == "arm" and CONFIG["OS_TARGET"] == "Linux":
+@@ -603,16 +603,28 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CO
+         "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
+         "/third_party/libwebrtc/modules/portal/portal_gn",
+         "/third_party/libwebrtc/third_party/drm/drm_gn",
+         "/third_party/libwebrtc/third_party/gbm/gbm_gn",
+         "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn",
          "/third_party/libwebrtc/third_party/pipewire/pipewire_gn"
      ]
  
@@ -19,8 +59,18 @@
 +    DIRS += [
 +        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
 +        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
++        "/third_party/libwebrtc/modules/portal/portal_gn",
++        "/third_party/libwebrtc/third_party/drm/drm_gn",
++        "/third_party/libwebrtc/third_party/gbm/gbm_gn",
++        "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn",
++        "/third_party/libwebrtc/third_party/pipewire/pipewire_gn"
 +    ]
 +
- if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux":
+ if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "OpenBSD":
  
      DIRS += [
+         "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn",
+         "/third_party/libwebrtc/common_audio/common_audio_neon_gn"
+     ]
+ 
+ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "OpenBSD":
--- a/mozilla-fix-top-level-asm.patch	Sat Jul 29 14:34:45 2023 +0200
+++ b/mozilla-fix-top-level-asm.patch	Fri Aug 04 12:30:24 2023 +0200
@@ -10,23 +10,25 @@
 diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build
 --- a/security/sandbox/linux/moz.build
 +++ b/security/sandbox/linux/moz.build
-@@ -66,32 +66,32 @@ UNIFIED_SOURCES += [
+@@ -64,17 +64,16 @@ UNIFIED_SOURCES += [
+     "../chromium/base/time/time.cc",
+     "../chromium/base/time/time_exploded_posix.cc",
      "../chromium/base/time/time_now_posix.cc",
      "../chromium/sandbox/linux/bpf_dsl/bpf_dsl.cc",
      "../chromium/sandbox/linux/bpf_dsl/codegen.cc",
      "../chromium/sandbox/linux/bpf_dsl/dump_bpf.cc",
      "../chromium/sandbox/linux/bpf_dsl/policy.cc",
      "../chromium/sandbox/linux/bpf_dsl/policy_compiler.cc",
-     "../chromium/sandbox/linux/bpf_dsl/syscall_set.cc",
+-    "../chromium/sandbox/linux/bpf_dsl/syscall_set.cc",
      "../chromium/sandbox/linux/seccomp-bpf/die.cc",
--    "../chromium/sandbox/linux/seccomp-bpf/syscall.cc",
+     "../chromium/sandbox/linux/seccomp-bpf/syscall.cc",
+     "/ipc/glue/UtilityProcessSandboxing.cpp",
      "broker/SandboxBrokerCommon.cpp",
      "Sandbox.cpp",
      "SandboxBrokerClient.cpp",
      "SandboxFilter.cpp",
      "SandboxFilterUtil.cpp",
-     "SandboxHooks.cpp",
-     "SandboxInfo.cpp",
+@@ -83,16 +82,17 @@ UNIFIED_SOURCES += [
      "SandboxLogging.cpp",
      "SandboxOpenedFiles.cpp",
      "SandboxReporterClient.cpp",
@@ -35,7 +37,7 @@
  SOURCES += [
      "../chromium/base/strings/safe_sprintf.cc",
      "../chromium/base/third_party/icu/icu_utf.cc",
-+    "../chromium/sandbox/linux/seccomp-bpf/syscall.cc",
++    "../chromium/sandbox/linux/bpf_dsl/syscall_set.cc",
      "../chromium/sandbox/linux/seccomp-bpf/trap.cc",
      "../chromium/sandbox/linux/services/syscall_wrappers.cc",
  ]
@@ -44,7 +46,7 @@
  # dependency like the one in libxul does, but this way the behavior is
  # consistent.  See also the comment in SandboxLogging.h.
  SOURCES["../chromium/base/strings/safe_sprintf.cc"].flags += ["-DNDEBUG"]
-@@ -105,16 +105,19 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc")
+@@ -106,16 +106,19 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc")
          "-Wno-unreachable-code-return"
      ]
  
--- a/mozilla-kde.patch	Sat Jul 29 14:34:45 2023 +0200
+++ b/mozilla-kde.patch	Fri Aug 04 12:30:24 2023 +0200
@@ -3,18 +3,22 @@
 # Date 1559294891 -7200
 #      Fri May 31 11:28:11 2019 +0200
 # Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112
-# Parent  0086fcc0d5c86a31cbac0a261ed7b526dd2df2e8
+# Parent  eaadcfc5cb5ee0eed248051a657a69646334aad7
 Description: Add KDE integration to Firefox (toolkit parts)
 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
 Author: Lubos Lunak <lunak@suse.com>
 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
      https://bugzilla.novell.com/show_bug.cgi?id=170055
 
-Index: firefox-115.0/modules/libpref/Preferences.cpp
-===================================================================
---- firefox-115.0.orig/modules/libpref/Preferences.cpp
-+++ firefox-115.0/modules/libpref/Preferences.cpp
-@@ -95,6 +95,7 @@
+diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
+--- a/modules/libpref/Preferences.cpp
++++ b/modules/libpref/Preferences.cpp
+@@ -90,16 +90,17 @@
+ #include "PLDHashTable.h"
+ #include "prdtoa.h"
+ #include "prlink.h"
+ #include "xpcpublic.h"
+ #include "js/RootingAPI.h"
  #ifdef MOZ_BACKGROUNDTASKS
  #  include "mozilla/BackgroundTasks.h"
  #endif
@@ -22,7 +26,17 @@
  
  #ifdef DEBUG
  #  include <map>
-@@ -4911,6 +4912,16 @@ nsresult Preferences::InitInitialObjects
+ #endif
+ 
+ #ifdef MOZ_MEMORY
+ #  include "mozmemory.h"
+ #endif
+@@ -4901,16 +4902,26 @@ nsresult Preferences::InitInitialObjects
+     "unix.js"
+ #  if defined(_AIX)
+     ,
+     "aix.js"
+ #  endif
  #endif
    };
  
@@ -39,7 +53,17 @@
    rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles,
                             ArrayLength(specialFiles));
    if (NS_FAILED(rv)) {
-@@ -4985,7 +4996,7 @@ nsresult Preferences::InitInitialObjects
+     NS_WARNING("Error parsing application default preferences.");
+   }
+ 
+   // Load jar:$app/omni.jar!/defaults/preferences/*.js
+   // or jar:$gre/omni.jar!/defaults/preferences/*.js.
+@@ -4975,17 +4986,17 @@ nsresult Preferences::InitInitialObjects
+       }
+ 
+       nsCOMPtr<nsIFile> path = do_QueryInterface(elem);
+       if (!path) {
+         continue;
        }
  
        // Do we care if a file provided by this process fails to load?
@@ -48,11 +72,20 @@
      }
    }
  
-Index: firefox-115.0/modules/libpref/moz.build
-===================================================================
---- firefox-115.0.orig/modules/libpref/moz.build
-+++ firefox-115.0/modules/libpref/moz.build
-@@ -126,6 +126,10 @@ UNIFIED_SOURCES += [
+ #if defined(MOZ_WIDGET_GTK)
+   // To ensure the system-wide preferences are not overwritten by
+   // firefox/browser/defauts/preferences/*.js we need to load
+   // the /etc/firefox/defaults/pref/*.js settings as last.
+   // Under Flatpak, the NS_OS_SYSTEM_CONFIG_DIR points to /app/etc/firefox
+diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
+--- a/modules/libpref/moz.build
++++ b/modules/libpref/moz.build
+@@ -121,16 +121,20 @@ EXPORTS.mozilla += [
+ ]
+ EXPORTS.mozilla += sorted(["!" + g for g in gen_h])
+ 
+ UNIFIED_SOURCES += [
+     "Preferences.cpp",
      "SharedPrefMap.cpp",
  ]
  
@@ -63,11 +96,20 @@
  gen_all_tuple = tuple(gen_h + gen_cpp + gen_rs)
  
  GeneratedFile(
-Index: firefox-115.0/python/mozbuild/mozpack/chrome/flags.py
-===================================================================
---- firefox-115.0.orig/python/mozbuild/mozpack/chrome/flags.py
-+++ firefox-115.0/python/mozbuild/mozpack/chrome/flags.py
-@@ -234,6 +234,7 @@ class Flags(OrderedDict):
+     *gen_all_tuple,
+     script="init/generate_static_pref_list.py",
+     entry_point="emit_code",
+     inputs=["init/StaticPrefList.yaml"]
+ )
+diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
+--- a/python/mozbuild/mozpack/chrome/flags.py
++++ b/python/mozbuild/mozpack/chrome/flags.py
+@@ -229,16 +229,17 @@ class Flags(OrderedDict):
+         "os": StringFlag,
+         "osversion": VersionFlag,
+         "abi": StringFlag,
+         "platform": Flag,
+         "xpcnativewrappers": Flag,
          "tablet": Flag,
          "process": StringFlag,
          "backgroundtask": StringFlag,
@@ -75,11 +117,20 @@
      }
      RE = re.compile(r"([!<>=]+)")
  
-Index: firefox-115.0/python/mozbuild/mozpack/chrome/manifest.py
-===================================================================
---- firefox-115.0.orig/python/mozbuild/mozpack/chrome/manifest.py
-+++ firefox-115.0/python/mozbuild/mozpack/chrome/manifest.py
-@@ -43,6 +43,7 @@ class ManifestEntry(object):
+     def __init__(self, *flags):
+         """
+         Initialize a set of flags given in string form.
+            flags = Flags('contentaccessible=yes', 'appversion>=3.5')
+         """
+diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py
+--- a/python/mozbuild/mozpack/chrome/manifest.py
++++ b/python/mozbuild/mozpack/chrome/manifest.py
+@@ -38,16 +38,17 @@ class ManifestEntry(object):
+         "os",
+         "osversion",
+         "abi",
+         "xpcnativewrappers",
+         "tablet",
          "process",
          "contentaccessible",
          "backgroundtask",
@@ -87,11 +138,20 @@
      ]
  
      def __init__(self, base, *flags):
-Index: firefox-115.0/toolkit/components/downloads/moz.build
-===================================================================
---- firefox-115.0.orig/toolkit/components/downloads/moz.build
-+++ firefox-115.0/toolkit/components/downloads/moz.build
-@@ -51,5 +51,9 @@ if CONFIG["MOZ_PLACES"]:
+         """
+         Initialize a manifest entry with the given base path and flags.
+         """
+         self.base = base
+         self.flags = Flags(*flags)
+diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
+--- a/toolkit/components/downloads/moz.build
++++ b/toolkit/components/downloads/moz.build
+@@ -46,10 +46,14 @@ XPCOM_MANIFESTS += [
+ 
+ if CONFIG["MOZ_PLACES"]:
+     EXTRA_JS_MODULES += [
+         "DownloadHistory.sys.mjs",
+     ]
  
  FINAL_LIBRARY = "xul"
  
@@ -101,11 +161,15 @@
 +
  with Files("**"):
      BUG_COMPONENT = ("Toolkit", "Downloads API")
-Index: firefox-115.0/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs
-===================================================================
---- firefox-115.0.orig/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs
-+++ firefox-115.0/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs
-@@ -1246,26 +1246,56 @@ nsUnknownContentTypeDialog.prototype = {
+diff --git a/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs b/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs
+--- a/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs
++++ b/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs
+@@ -1241,36 +1241,66 @@ nsUnknownContentTypeDialog.prototype = {
+         params.handlerApp &&
+         params.handlerApp.executable &&
+         params.handlerApp.executable.isFile()
+       ) {
+         // Remember the file they chose to run.
          this.chosenApp = params.handlerApp;
        }
      } else if ("@mozilla.org/applicationchooser;1" in Cc) {
@@ -182,11 +246,20 @@
      } else {
        var nsIFilePicker = Ci.nsIFilePicker;
        var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
-Index: firefox-115.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
-===================================================================
---- firefox-115.0.orig/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
-+++ firefox-115.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
-@@ -16,6 +16,8 @@
+       fp.init(
+         this.mDialog,
+         this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
+         nsIFilePicker.modeOpen
+       );
+diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
+--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
++++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
+@@ -11,16 +11,18 @@
+ #include "prenv.h"
+ #include "nsInterfaceHashtable.h"
+ #include "nsHashtablesFwd.h"
+ #include "nsHashKeys.h"
+ #include "nsNetUtil.h"
  #include "nsISupportsPrimitives.h"
  #include "nsIGSettingsService.h"
  #include "nsReadableUtils.h"
@@ -195,7 +268,17 @@
  
  using namespace mozilla;
  
-@@ -39,6 +41,8 @@ class nsUnixSystemProxySettings final :
+ class nsUnixSystemProxySettings final : public nsISystemProxySettings {
+  public:
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSISYSTEMPROXYSETTINGS
+ 
+@@ -34,16 +36,18 @@ class nsUnixSystemProxySettings final : 
+   nsCOMPtr<nsIGSettingsCollection> mProxySettings;
+   nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection>
+       mSchemeProxySettings;
+   nsresult GetProxyFromGSettings(const nsACString& aScheme,
+                                  const nsACString& aHost, int32_t aPort,
                                   nsACString& aResult);
    nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType,
                                         nsACString& aResult);
@@ -204,7 +287,17 @@
  };
  
  NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings)
-@@ -396,6 +400,9 @@ nsresult nsUnixSystemProxySettings::GetP
+ 
+ NS_IMETHODIMP
+ nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) {
+   // dbus prevents us from being threadsafe, but this routine should not block
+   // anyhow
+@@ -391,21 +395,46 @@ nsresult nsUnixSystemProxySettings::GetP
+   return NS_OK;
+ }
+ 
+ nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec,
+                                                    const nsACString& aScheme,
                                                     const nsACString& aHost,
                                                     const int32_t aPort,
                                                     nsACString& aResult) {
@@ -214,7 +307,8 @@
    if (mProxySettings) {
      nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult);
      if (NS_SUCCEEDED(rv)) return rv;
-@@ -404,6 +411,28 @@ nsresult nsUnixSystemProxySettings::GetP
+   }
+ 
    return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult);
  }
  
@@ -243,11 +337,17 @@
  NS_IMPL_COMPONENT_FACTORY(nsUnixSystemProxySettings) {
    auto result = MakeRefPtr<nsUnixSystemProxySettings>();
    result->Init();
-Index: firefox-115.0/toolkit/xre/moz.build
-===================================================================
---- firefox-115.0.orig/toolkit/xre/moz.build
-+++ firefox-115.0/toolkit/xre/moz.build
-@@ -96,7 +96,9 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "ui
+   return result.forget().downcast<nsISupports>();
+ }
+diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
+--- a/toolkit/xre/moz.build
++++ b/toolkit/xre/moz.build
+@@ -91,17 +91,19 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "co
+         "../components/printingui",
+     ]
+ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
+     UNIFIED_SOURCES += [
+         "nsNativeAppSupportDefault.cpp",
          "UIKitDirProvider.mm",
      ]
  elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
@@ -257,10 +357,15 @@
          "nsNativeAppSupportUnix.cpp",
      ]
      CXXFLAGS += CONFIG["MOZ_X11_SM_CFLAGS"]
-Index: firefox-115.0/toolkit/xre/nsKDEUtils.cpp
-===================================================================
+ else:
+     UNIFIED_SOURCES += [
+         "nsNativeAppSupportDefault.cpp",
+     ]
+ 
+diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
+new file mode 100644
 --- /dev/null
-+++ firefox-115.0/toolkit/xre/nsKDEUtils.cpp
++++ b/toolkit/xre/nsKDEUtils.cpp
 @@ -0,0 +1,286 @@
 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 +/* This Source Code Form is subject to the terms of the Mozilla Public
@@ -548,10 +653,10 @@
 +        commandFile);  // done as \E, so it cannot happen in normal data
 +  fflush(commandFile);
 +}
-Index: firefox-115.0/toolkit/xre/nsKDEUtils.h
-===================================================================
+diff --git a/toolkit/xre/nsKDEUtils.h b/toolkit/xre/nsKDEUtils.h
+new file mode 100644
 --- /dev/null
-+++ firefox-115.0/toolkit/xre/nsKDEUtils.h
++++ b/toolkit/xre/nsKDEUtils.h
 @@ -0,0 +1,53 @@
 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 +/* This Source Code Form is subject to the terms of the Mozilla Public
@@ -606,11 +711,15 @@
 +};
 +
 +#endif  // nsKDEUtils
-Index: firefox-115.0/uriloader/exthandler/HandlerServiceParent.cpp
-===================================================================
---- firefox-115.0.orig/uriloader/exthandler/HandlerServiceParent.cpp
-+++ firefox-115.0/uriloader/exthandler/HandlerServiceParent.cpp
-@@ -18,7 +18,7 @@
+diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandler/HandlerServiceParent.cpp
+--- a/uriloader/exthandler/HandlerServiceParent.cpp
++++ b/uriloader/exthandler/HandlerServiceParent.cpp
+@@ -13,17 +13,17 @@
+ #include "ContentHandlerService.h"
+ #include "nsIExternalProtocolService.h"
+ #include "nsStringEnumerator.h"
+ #include "nsIMutableArray.h"
+ #include "nsCExternalHandlerService.h"
  #include "nsComponentManagerUtils.h"
  #include "nsServiceManagerUtils.h"
  #ifdef MOZ_WIDGET_GTK
@@ -619,7 +728,17 @@
  #endif
  
  using mozilla::dom::ContentHandlerService;
-@@ -310,8 +310,8 @@ mozilla::ipc::IPCResult HandlerServicePa
+ using mozilla::dom::HandlerApp;
+ using mozilla::dom::HandlerInfo;
+ using mozilla::dom::RemoteHandlerApp;
+ 
+ namespace {
+@@ -305,18 +305,18 @@ mozilla::ipc::IPCResult HandlerServicePa
+ mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocolOS(
+     const nsACString& aProtocolScheme, bool* aHandlerExists) {
+   if (aProtocolScheme.Length() > MAX_SCHEME_LENGTH) {
+     *aHandlerExists = false;
+     return IPC_OK();
    }
  #ifdef MOZ_WIDGET_GTK
    // Check the GNOME registry for a protocol handler
@@ -630,11 +749,20 @@
  #else
    *aHandlerExists = false;
  #endif
-Index: firefox-115.0/uriloader/exthandler/moz.build
-===================================================================
---- firefox-115.0.orig/uriloader/exthandler/moz.build
-+++ firefox-115.0/uriloader/exthandler/moz.build
-@@ -86,7 +86,9 @@ else:
+   return IPC_OK();
+ }
+ 
+ /*
+  * Check if a handler exists for the provided protocol. Check the datastore
+diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
+--- a/uriloader/exthandler/moz.build
++++ b/uriloader/exthandler/moz.build
+@@ -81,17 +81,19 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "ui
+ else:
+     # These files can't be built in unified mode because they redefine LOG.
+     SOURCES += [
+         osdir + "/nsOSHelperAppService.cpp",
+     ]
  
  if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
      UNIFIED_SOURCES += [
@@ -644,7 +772,17 @@
          "unix/nsMIMEInfoUnix.cpp",
      ]
  elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
-@@ -134,6 +136,7 @@ LOCAL_INCLUDES += [
+     UNIFIED_SOURCES += [
+         "android/nsMIMEInfoAndroid.cpp",
+     ]
+ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
+     UNIFIED_SOURCES += [
+@@ -129,16 +131,17 @@ include("/ipc/chromium/chromium-config.m
+ FINAL_LIBRARY = "xul"
+ 
+ LOCAL_INCLUDES += [
+     "/docshell/base",
+     "/dom/base",
      "/dom/ipc",
      "/netwerk/base",
      "/netwerk/protocol/http",
@@ -652,10 +790,15 @@
  ]
  
  if CONFIG["MOZ_ENABLE_DBUS"]:
-Index: firefox-115.0/uriloader/exthandler/unix/nsCommonRegistry.cpp
-===================================================================
+     CXXFLAGS += CONFIG["MOZ_DBUS_CFLAGS"]
+ 
+ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
+     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
+     CXXFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"]
+diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
+new file mode 100644
 --- /dev/null
-+++ firefox-115.0/uriloader/exthandler/unix/nsCommonRegistry.cpp
++++ b/uriloader/exthandler/unix/nsCommonRegistry.cpp
 @@ -0,0 +1,42 @@
 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 +/* This Source Code Form is subject to the terms of the Mozilla Public
@@ -699,10 +842,10 @@
 +  if (nsKDEUtils::kdeSupport()) return nsKDERegistry::GetFromType(aMIMEType);
 +  return nsGNOMERegistry::GetFromType(aMIMEType);
 +}
-Index: firefox-115.0/uriloader/exthandler/unix/nsCommonRegistry.h
-===================================================================
+diff --git a/uriloader/exthandler/unix/nsCommonRegistry.h b/uriloader/exthandler/unix/nsCommonRegistry.h
+new file mode 100644
 --- /dev/null
-+++ firefox-115.0/uriloader/exthandler/unix/nsCommonRegistry.h
++++ b/uriloader/exthandler/unix/nsCommonRegistry.h
 @@ -0,0 +1,28 @@
 +/* This Source Code Form is subject to the terms of the Mozilla Public
 + * License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -732,10 +875,10 @@
 +};
 +
 +#endif
-Index: firefox-115.0/uriloader/exthandler/unix/nsKDERegistry.cpp
-===================================================================
+diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/unix/nsKDERegistry.cpp
+new file mode 100644
 --- /dev/null
-+++ firefox-115.0/uriloader/exthandler/unix/nsKDERegistry.cpp
++++ b/uriloader/exthandler/unix/nsKDERegistry.cpp
 @@ -0,0 +1,75 @@
 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 +/* This Source Code Form is subject to the terms of the Mozilla Public
@@ -812,10 +955,10 @@
 +  }
 +  return nullptr;
 +}
-Index: firefox-115.0/uriloader/exthandler/unix/nsKDERegistry.h
-===================================================================
+diff --git a/uriloader/exthandler/unix/nsKDERegistry.h b/uriloader/exthandler/unix/nsKDERegistry.h
+new file mode 100644
 --- /dev/null
-+++ firefox-115.0/uriloader/exthandler/unix/nsKDERegistry.h
++++ b/uriloader/exthandler/unix/nsKDERegistry.h
 @@ -0,0 +1,35 @@
 +/* This Source Code Form is subject to the terms of the Mozilla Public
 + * License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -852,11 +995,14 @@
 +};
 +
 +#endif  // nsKDERegistry_h__
-Index: firefox-115.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
-===================================================================
---- firefox-115.0.orig/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
-+++ firefox-115.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
-@@ -5,16 +5,19 @@
+diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
+--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
++++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
+@@ -1,48 +1,51 @@
+ /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+  *
+  * This Source Code Form is subject to the terms of the Mozilla Public
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
   * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  
  #include "nsMIMEInfoUnix.h"
@@ -878,7 +1024,14 @@
  }
  
  NS_IMETHODIMP
-@@ -29,15 +32,15 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo
+ nsMIMEInfoUnix::GetHasDefaultHandler(bool* _retval) {
+   // if a default app is set, it means the application has been set from
+   // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to
+   // give the GNOME answer.
+   if (GetDefaultApplication()) {
+     return nsMIMEInfoImpl::GetHasDefaultHandler(_retval);
+   }
+ 
    *_retval = false;
  
    if (mClass == eProtocolInfo) {
@@ -897,7 +1050,17 @@
        }
      }
      if (mimeInfo) *_retval = true;
-@@ -59,6 +62,21 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi
+   }
+ 
+   if (*_retval) return NS_OK;
+ 
+   return NS_OK;
+@@ -54,16 +57,31 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi
+   // give the GNOME answer.
+   if (GetDefaultApplication()) {
+     return nsMIMEInfoImpl::LaunchDefaultWithFile(aFile);
+   }
+ 
    nsAutoCString nativePath;
    aFile->GetNativePath(nativePath);
  
@@ -919,11 +1082,20 @@
    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
    if (!giovfs) {
      return NS_ERROR_FAILURE;
-Index: firefox-115.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp
-===================================================================
---- firefox-115.0.orig/uriloader/exthandler/unix/nsOSHelperAppService.cpp
-+++ firefox-115.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp
-@@ -10,7 +10,7 @@
+   }
+ 
+   // nsGIOMimeApp->Launch wants a URI string instead of local file
+   nsresult rv;
+   nsCOMPtr<nsIIOService> ioservice =
+diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
+--- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp
++++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
+@@ -5,17 +5,17 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ 
  #include "nsOSHelperAppService.h"
  #include "nsMIMEInfoUnix.h"
  #ifdef MOZ_WIDGET_GTK
@@ -932,7 +1104,17 @@
  #  ifdef MOZ_BUILD_APP_IS_BROWSER
  #    include "nsIToolkitShellService.h"
  #    include "nsIGNOMEShellService.h"
-@@ -1106,7 +1106,7 @@ nsresult nsOSHelperAppService::OSProtoco
+ #  endif
+ #endif
+ #include "nsISupports.h"
+ #include "nsString.h"
+ #include "nsReadableUtils.h"
+@@ -1101,17 +1101,17 @@ nsresult nsOSHelperAppService::GetHandle
+ 
+ nsresult nsOSHelperAppService::OSProtocolHandlerExists(
+     const char* aProtocolScheme, bool* aHandlerExists) {
+   nsresult rv = NS_OK;
+ 
    if (!XRE_IsContentProcess()) {
  #ifdef MOZ_WIDGET_GTK
      // Check the GNOME registry for a protocol handler
@@ -941,7 +1123,17 @@
  #else
      *aHandlerExists = false;
  #endif
-@@ -1126,7 +1126,7 @@ nsresult nsOSHelperAppService::OSProtoco
+   } else {
+     *aHandlerExists = false;
+     nsCOMPtr<nsIHandlerService> handlerSvc =
+         do_GetService(NS_HANDLERSERVICE_CONTRACTID, &rv);
+     if (NS_SUCCEEDED(rv) && handlerSvc) {
+@@ -1121,17 +1121,17 @@ nsresult nsOSHelperAppService::OSProtoco
+   }
+ 
+   return rv;
+ }
+ 
  NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(
      const nsACString& aScheme, nsAString& _retval) {
  #ifdef MOZ_WIDGET_GTK
@@ -950,7 +1142,17 @@
    return _retval.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK;
  #else
    return NS_ERROR_NOT_AVAILABLE;
-@@ -1231,7 +1231,7 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel
+ #endif
+ }
+ 
+ NS_IMETHODIMP nsOSHelperAppService::IsCurrentAppOSDefaultForProtocol(
+     const nsACString& aScheme, bool* _retval) {
+@@ -1226,17 +1226,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel
+   nsresult rv =
+       LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType,
+                                minorType, mime_types_description, true);
+ 
+   if (NS_FAILED(rv) || majorType.IsEmpty()) {
  #ifdef MOZ_WIDGET_GTK
      LOG("Looking in GNOME registry\n");
      RefPtr<nsMIMEInfoBase> gnomeInfo =
@@ -959,7 +1161,17 @@
      if (gnomeInfo) {
        LOG("Got MIMEInfo from GNOME registry\n");
        return gnomeInfo.forget();
-@@ -1344,7 +1344,7 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel
+     }
+ #endif
+ 
+     rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType,
+                                   minorType, mime_types_description, false);
+@@ -1339,17 +1339,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel
+ 
+   // Now look up our extensions
+   nsAutoString extensions, mime_types_description;
+   LookUpExtensionsAndDescription(majorType, minorType, extensions,
+                                  mime_types_description);
  
  #ifdef MOZ_WIDGET_GTK
    if (handler.IsEmpty()) {
@@ -968,23 +1180,40 @@
      if (gnomeInfo) {
        LOG("Got MIMEInfo from GNOME registry without extensions; setting them "
            "to %s\n",
-Index: firefox-115.0/widget/gtk/moz.build
-===================================================================
---- firefox-115.0.orig/widget/gtk/moz.build
-+++ firefox-115.0/widget/gtk/moz.build
-@@ -149,6 +149,7 @@ LOCAL_INCLUDES += [
+           NS_LossyConvertUTF16toASCII(extensions).get());
+ 
+       NS_ASSERTION(!gnomeInfo->HasExtensions(), "How'd that happen?");
+       gnomeInfo->SetFileExtensions(NS_ConvertUTF16toUTF8(extensions));
+       return gnomeInfo.forget();
+diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
+--- a/widget/gtk/moz.build
++++ b/widget/gtk/moz.build
+@@ -146,16 +146,17 @@ FINAL_LIBRARY = "xul"
+ 
+ LOCAL_INCLUDES += [
+     "/layout/base",
+     "/layout/forms",
+     "/layout/generic",
      "/layout/xul",
      "/other-licenses/atk-1.0",
      "/third_party/cups/include",
 +    "/toolkit/xre",
      "/widget",
      "/widget/headless",
+     "/widget/x11",
  ]
-Index: firefox-115.0/widget/gtk/nsFilePicker.cpp
-===================================================================
---- firefox-115.0.orig/widget/gtk/nsFilePicker.cpp
-+++ firefox-115.0/widget/gtk/nsFilePicker.cpp
-@@ -5,6 +5,7 @@
+ 
+ DEFINES["CAIRO_GFX"] = True
+ 
+ DEFINES["MOZ_APP_NAME"] = '"%s"' % CONFIG["MOZ_APP_NAME"]
+diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
+--- a/widget/gtk/nsFilePicker.cpp
++++ b/widget/gtk/nsFilePicker.cpp
+@@ -1,15 +1,16 @@
+ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+ /* This Source Code Form is subject to the terms of the Mozilla Public
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  
  #include <dlfcn.h>
  #include <gtk/gtk.h>
@@ -992,7 +1221,17 @@
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <unistd.h>
-@@ -28,6 +29,8 @@
+ 
+ #include "mozilla/Types.h"
+ #include "nsGtkUtils.h"
+ #include "nsIFileURL.h"
+ #include "nsIGIOService.h"
+@@ -23,16 +24,18 @@
+ #include "nsArrayEnumerator.h"
+ #include "nsEnumeratorUtils.h"
+ #include "nsNetUtil.h"
+ #include "nsReadableUtils.h"
+ #include "MozContainer.h"
  #include "WidgetUtilsGtk.h"
  
  #include "nsFilePicker.h"
@@ -1001,7 +1240,17 @@
  
  #undef LOG
  #ifdef MOZ_LOGGING
-@@ -242,7 +245,8 @@ NS_IMETHODIMP
+ #  include "mozilla/Logging.h"
+ #  include "nsTArray.h"
+ #  include "Units.h"
+ extern mozilla::LazyLogModule gWidgetLog;
+ #  define LOG(args) MOZ_LOG(gWidgetLog, mozilla::LogLevel::Debug, args)
+@@ -237,17 +240,18 @@ nsFilePicker::AppendFilters(int32_t aFil
+   mAllowURLs = !!(aFilterMask & filterAllowURLs);
+   return nsBaseFilePicker::AppendFilters(aFilterMask);
+ }
+ 
+ NS_IMETHODIMP
  nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) {
    if (aFilter.EqualsLiteral("..apps")) {
      // No platform specific thing we can do here, really....
@@ -1011,7 +1260,17 @@
    }
  
    nsAutoCString filter, name;
-@@ -352,6 +356,31 @@ nsFilePicker::Open(nsIFilePickerShownCal
+   CopyUTF16toUTF8(aFilter, filter);
+   CopyUTF16toUTF8(aTitle, name);
+ 
+   mFilters.AppendElement(filter);
+   mFilterNames.AppendElement(name);
+@@ -347,16 +351,41 @@ nsresult nsFilePicker::Show(nsIFilePicke
+   return NS_OK;
+ }
+ 
+ NS_IMETHODIMP
+ nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) {
    // Can't show two dialogs concurrently with the same filepicker
    if (mRunning) return NS_ERROR_NOT_AVAILABLE;
  
@@ -1043,7 +1302,17 @@
    NS_ConvertUTF16toUTF8 title(mTitle);
  
    GtkWindow* parent_widget =
-@@ -633,6 +662,205 @@ void nsFilePicker::Done(void* file_choos
+       GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
+ 
+   GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
+ 
+   const gchar* accept_button;
+@@ -628,16 +657,215 @@ void nsFilePicker::Done(void* file_choos
+     mCallback->Done(result);
+     mCallback = nullptr;
+   } else {
+     mResult = result;
+   }
    NS_RELEASE_THIS();
  }
  
@@ -1249,11 +1518,20 @@
  // All below functions available as of GTK 3.20+
  void* nsFilePicker::GtkFileChooserNew(const gchar* title, GtkWindow* parent,
                                        GtkFileChooserAction action,
-Index: firefox-115.0/widget/gtk/nsFilePicker.h
-===================================================================
---- firefox-115.0.orig/widget/gtk/nsFilePicker.h
-+++ firefox-115.0/widget/gtk/nsFilePicker.h
-@@ -74,6 +74,12 @@ class nsFilePicker : public nsBaseFilePi
+                                       const gchar* accept_label) {
+   static auto sGtkFileChooserNativeNewPtr =
+       (void* (*)(const gchar*, GtkWindow*, GtkFileChooserAction, const gchar*,
+                  const gchar*))dlsym(RTLD_DEFAULT,
+                                      "gtk_file_chooser_native_new");
+diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
+--- a/widget/gtk/nsFilePicker.h
++++ b/widget/gtk/nsFilePicker.h
+@@ -69,16 +69,22 @@ class nsFilePicker : public nsBaseFilePi
+   nsString mDefaultExtension;
+ 
+   nsTArray<nsCString> mFilters;
+   nsTArray<nsCString> mFilterNames;
+ 
   private:
    static nsIFile* mPrevDisplayDirectory;
  
@@ -1266,11 +1544,20 @@
    void* GtkFileChooserNew(const gchar* title, GtkWindow* parent,
                            GtkFileChooserAction action,
                            const gchar* accept_label);
-Index: firefox-115.0/xpcom/components/ManifestParser.cpp
-===================================================================
---- firefox-115.0.orig/xpcom/components/ManifestParser.cpp
-+++ firefox-115.0/xpcom/components/ManifestParser.cpp
-@@ -43,6 +43,7 @@
+   void GtkFileChooserShow(void* file_chooser);
+   void GtkFileChooserDestroy(void* file_chooser);
+   void GtkFileChooserSetModal(void* file_chooser, GtkWindow* parent_widget,
+                               gboolean modal);
+ 
+diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
+--- a/xpcom/components/ManifestParser.cpp
++++ b/xpcom/components/ManifestParser.cpp
+@@ -38,16 +38,17 @@
+ #include "nsTextFormatter.h"
+ #include "nsVersionComparator.h"
+ #include "nsXPCOMCIDInternal.h"
+ 
+ #include "nsIConsoleService.h"
  #include "nsIScriptError.h"
  #include "nsIXULAppInfo.h"
  #include "nsIXULRuntime.h"
@@ -1278,7 +1565,17 @@
  
  using namespace mozilla;
  
-@@ -394,6 +395,7 @@ void ParseManifest(NSLocationType aType,
+ struct ManifestDirective {
+   const char* directive;
+   int argc;
+ 
+   bool ischrome;
+@@ -389,16 +390,17 @@ void ParseManifest(NSLocationType aType,
+   constexpr auto kRemoteEnabled = u"remoteenabled"_ns;
+   constexpr auto kRemoteRequired = u"remoterequired"_ns;
+   constexpr auto kApplication = u"application"_ns;
+   constexpr auto kAppVersion = u"appversion"_ns;
+   constexpr auto kGeckoVersion = u"platformversion"_ns;
    constexpr auto kOs = u"os"_ns;
    constexpr auto kOsVersion = u"osversion"_ns;
    constexpr auto kABI = u"abi"_ns;
@@ -1286,7 +1583,17 @@
    constexpr auto kProcess = u"process"_ns;
  #if defined(MOZ_WIDGET_ANDROID)
    constexpr auto kTablet = u"tablet"_ns;
-@@ -453,6 +455,7 @@ void ParseManifest(NSLocationType aType,
+ #endif
+   // You might expect this to be guarded by MOZ_BACKGROUNDTASKS, but it's not
+   // possible to have conditional manifest contents, so we need to recognize and
+   // discard these tokens even when MOZ_BACKGROUNDTASKS is not set.
+   constexpr auto kBackgroundTask = u"backgroundtask"_ns;
+@@ -448,39 +450,44 @@ void ParseManifest(NSLocationType aType,
+         CopyUTF8toUTF16(s, abi);
+         abi.Insert(char16_t('_'), 0);
+         abi.Insert(osTarget, 0);
+       }
+     }
    }
  
    nsAutoString osVersion;
@@ -1294,7 +1601,8 @@
  #if defined(XP_WIN)
  #  pragma warning(push)
  #  pragma warning(disable : 4996)  // VC12+ deprecates GetVersionEx
-@@ -461,14 +464,17 @@ void ParseManifest(NSLocationType aType,
+   OSVERSIONINFO info = {sizeof(OSVERSIONINFO)};
+   if (GetVersionEx(&info)) {
      nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", info.dwMajorVersion,
                                info.dwMinorVersion);
    }
@@ -1312,7 +1620,7 @@
  #elif defined(MOZ_WIDGET_ANDROID)
    bool isTablet = false;
    if (jni::IsAvailable()) {
-@@ -476,6 +482,7 @@ void ParseManifest(NSLocationType aType,
+     jni::String::LocalRef release = java::sdk::Build::VERSION::RELEASE();
      osVersion.Assign(release->ToString());
      isTablet = java::GeckoAppShell::IsTablet();
    }
@@ -1320,7 +1628,17 @@
  #endif
  
    if (XRE_IsContentProcess()) {
-@@ -576,6 +583,7 @@ void ParseManifest(NSLocationType aType,
+     process = kContent;
+   } else {
+     process = kMain;
+   }
+ 
+@@ -571,25 +578,27 @@ void ParseManifest(NSLocationType aType,
+     // When in background task mode, default to not registering
+     // category directivies unless backgroundtask=1 is specified.
+     TriState stBackgroundTask = (BackgroundTasks::IsBackgroundTaskMode() &&
+                                  strcmp("category", directive->directive) == 0)
+                                     ? eBad
                                      : eUnspecified;
  #endif
      int flags = 0;
@@ -1328,7 +1646,9 @@
  
      while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) &&
             ok) {
-@@ -585,6 +593,7 @@ void ParseManifest(NSLocationType aType,
+       ToLowerCase(token);
+       NS_ConvertASCIItoUTF16 wtoken(token);
+ 
        if (CheckStringFlag(kApplication, wtoken, appID, stApp) ||
            CheckOsFlag(kOs, wtoken, osTarget, stOs) ||
            CheckStringFlag(kABI, wtoken, abi, stABI) ||
@@ -1336,7 +1656,17 @@
            CheckStringFlag(kProcess, wtoken, process, stProcess) ||
            CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) ||
            CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) ||
-@@ -644,6 +653,7 @@ void ParseManifest(NSLocationType aType,
+           CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion,
+                            stGeckoVersion)) {
+         continue;
+       }
+ 
+@@ -639,16 +648,17 @@ void ParseManifest(NSLocationType aType,
+ 
+       LogMessageWithContext(
+           aFile, line, "Unrecognized chrome manifest modifier '%s'.", token);
+       ok = false;
+     }
  
      if (!ok || stApp == eBad || stAppVersion == eBad ||
          stGeckoVersion == eBad || stOs == eBad || stOsVersion == eBad ||
@@ -1344,11 +1674,20 @@
  #ifdef MOZ_WIDGET_ANDROID
          stTablet == eBad ||
  #endif
-Index: firefox-115.0/xpcom/components/moz.build
-===================================================================
---- firefox-115.0.orig/xpcom/components/moz.build
-+++ firefox-115.0/xpcom/components/moz.build
-@@ -71,6 +71,7 @@ LOCAL_INCLUDES += [
+ #ifdef MOZ_BACKGROUNDTASKS
+         stBackgroundTask == eBad ||
+ #endif
+         stABI == eBad || stProcess == eBad) {
+       continue;
+diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
+--- a/xpcom/components/moz.build
++++ b/xpcom/components/moz.build
+@@ -66,16 +66,17 @@ LOCAL_INCLUDES += [
+     "!..",
+     "../base",
+     "../build",
+     "../ds",
+     "/chrome",
      "/js/xpconnect/loader",
      "/layout/build",
      "/modules/libjar",
@@ -1356,11 +1695,20 @@
  ]
  
  if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
-Index: firefox-115.0/xpcom/io/nsLocalFileUnix.cpp
-===================================================================
---- firefox-115.0.orig/xpcom/io/nsLocalFileUnix.cpp
-+++ firefox-115.0/xpcom/io/nsLocalFileUnix.cpp
-@@ -51,6 +51,7 @@
+     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
+     if CONFIG["MOZ_ENABLE_DBUS"]:
+         CXXFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"]
+ 
+ include("/ipc/chromium/chromium-config.mozbuild")
+diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
+--- a/xpcom/io/nsLocalFileUnix.cpp
++++ b/xpcom/io/nsLocalFileUnix.cpp
+@@ -46,16 +46,17 @@
+ #include "nsString.h"
+ #include "nsIDirectoryEnumerator.h"
+ #include "nsSimpleEnumerator.h"
+ #include "private/pprio.h"
+ #include "prlink.h"
  
  #ifdef MOZ_WIDGET_GTK
  #  include "nsIGIOService.h"
@@ -1368,7 +1716,17 @@
  #endif
  
  #ifdef MOZ_WIDGET_COCOA
-@@ -2172,10 +2173,18 @@ nsLocalFile::Reveal() {
+ #  include <Carbon/Carbon.h>
+ #  include "CocoaFileUtils.h"
+ #  include "prmem.h"
+ #  include "plbase64.h"
+ 
+@@ -2167,20 +2168,28 @@ nsLocalFile::SetPersistentDescriptor(con
+ 
+ NS_IMETHODIMP
+ nsLocalFile::Reveal() {
+   if (!FilePreferences::IsAllowedPath(mPath)) {
+     return NS_ERROR_FILE_ACCESS_DENIED;
    }
  
  #ifdef MOZ_WIDGET_GTK
@@ -1389,7 +1747,17 @@
    return giovfs->RevealFile(this);
  #elif defined(MOZ_WIDGET_COCOA)
    CFURLRef url;
-@@ -2197,6 +2206,13 @@ nsLocalFile::Launch() {
+   if (NS_SUCCEEDED(GetCFURL(&url))) {
+     nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
+     ::CFRelease(url);
+     return rv;
+   }
+@@ -2192,16 +2201,23 @@ nsLocalFile::Reveal() {
+ 
+ NS_IMETHODIMP
+ nsLocalFile::Launch() {
+   if (!FilePreferences::IsAllowedPath(mPath)) {
+     return NS_ERROR_FILE_ACCESS_DENIED;
    }
  
  #ifdef MOZ_WIDGET_GTK
@@ -1403,3 +1771,8 @@
    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
    if (!giovfs) {
      return NS_ERROR_FAILURE;
+   }
+ 
+   return giovfs->LaunchFile(mPath);
+ #elif defined(MOZ_WIDGET_ANDROID)
+   // Not supported on GeckoView
--- a/mozilla-s390x-skia-gradient.patch	Sat Jul 29 14:34:45 2023 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-# HG changeset patch
-# Parent  acf59ea86dd1d878b43920832093f082dcfc61c0
-
-diff -r acf59ea86dd1 gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp
---- a/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp	Mon Mar 09 08:26:10 2020 +0100
-+++ b/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp	Fri Mar 27 13:30:28 2020 +0100
-@@ -7,7 +7,7 @@
- 
- #include "include/core/SkPaint.h"
- #include "src/shaders/gradients/Sk4fLinearGradient.h"
--
-+#include "src/core/SkEndian.h"
- #include <cmath>
- #include <utility>
- 
-@@ -28,6 +28,9 @@
- 
-     while (n >= 4) {
-         DstTraits<premul>::store4x(c0, c1, c2, c3, dst, bias0, bias1);
-+#ifdef SK_CPU_BENDIAN
-+        SkEndianSwap32s(dst, 4);
-+#endif
-         dst += 4;
- 
-         c0 = c0 + dc4;
-@@ -37,12 +40,23 @@
-         n -= 4;
-     }
-     if (n & 2) {
--        DstTraits<premul>::store(c0, dst++, bias0);
--        DstTraits<premul>::store(c1, dst++, bias1);
-+        DstTraits<premul>::store(c0, dst, bias0);
-+#ifdef SK_CPU_BENDIAN
-+        *dst = SkEndianSwap32(*dst);
-+#endif
-+        ++dst;
-+        DstTraits<premul>::store(c1, dst, bias1);
-+#ifdef SK_CPU_BENDIAN
-+        *dst = SkEndianSwap32(*dst);
-+#endif
-+        ++dst;
-         c0 = c0 + dc2;
-     }
-     if (n & 1) {
-         DstTraits<premul>::store(c0, dst, bias0);
-+#ifdef SK_CPU_BENDIAN
-+        *dst = SkEndianSwap32(*dst);
-+#endif
-     }
- }
-