ESR 60.5 firefox60
authorWolfgang Rosenauer <wr@rosenauer.org>
Tue, 19 Mar 2019 09:49:20 +0100
branchfirefox60
changeset 1090 554cd9503f75
parent 1080 e8d4a33582b8
child 1091 cbed5671ff47
ESR 60.5
MozillaFirefox/MozillaFirefox.changes
MozillaFirefox/MozillaFirefox.spec
MozillaFirefox/_constraints
MozillaFirefox/create-tar.sh
MozillaFirefox/mozilla-bmo1463035.patch
MozillaFirefox/mozilla-no-stdcxx-check.patch
MozillaFirefox/source-stamp.txt
firefox-kde.patch
mozilla-aarch64-startup-crash.patch
mozilla-bmo1375074.patch
mozilla-bmo1463035.patch
mozilla-bmo256180.patch
mozilla-kde.patch
mozilla-no-stdcxx-check.patch
mozilla-nongnome-proxies.patch
mozilla-ntlm-full-path.patch
series
--- a/MozillaFirefox/MozillaFirefox.changes	Mon Dec 10 22:33:01 2018 +0100
+++ b/MozillaFirefox/MozillaFirefox.changes	Tue Mar 19 09:49:20 2019 +0100
@@ -1,8 +1,39 @@
 -------------------------------------------------------------------
+Wed Jan 23 23:17:37 UTC 2019 - Wolfgang Rosenauer <wr@rosenauer.org>
+
+- Mozilla Firefox 60.5.0esr
+- requires NSS >= 3.36.7
+- removed obsolete patch:
+  mozilla-no-stdcxx-check.patch
+
+-------------------------------------------------------------------
+Wed Jan  9 15:01:00 UTC 2019 - Guillaume GARDET <guillaume.gardet@opensuse.org>
+
+- Add patch to fix armv7 build (boo#1121255):
+  * mozilla-bmo1463035.patch
+
+-------------------------------------------------------------------
 Mon Dec 10 21:25:38 UTC 2018 - Wolfgang Rosenauer <wr@rosenauer.org>
 
 - Mozilla Firefox 60.4.0esr:
-  MFSA 2018-29
+  * Updated list of currency codes to include Unidad Previsional (UYW)
+    (bmo#1499028)
+  MFSA 2018-30 (bsc#1119105)
+  * CVE-2018-17466 bmo#1488295
+    Buffer overflow and out-of-bounds read in ANGLE library with
+    TextureStorage11
+  * CVE-2018-18492 bmo#1499861
+    Use-after-free with select element
+  * CVE-2018-18493 bmo#1504452
+    Buffer overflow in accelerated 2D canvas with Skia
+  * CVE-2018-18494 bmo#1487964
+    Same-origin policy violation using location attribute and
+    performance.getEntries to steal cross-origin URLs
+  * CVE-2018-18498 bmo#1500011
+    Integer overflow when calculating buffer sizes for images
+  * CVE-2018-12405 bmo#1494752 bmo#1503326 bmo#1505181 bmo#1500759
+    bmo#1504365 bmo#1506640 bmo#1503082 bmo#1502013 bmo#1510471
+    Memory safety bugs fixed in Firefox 64 and Firefox ESR 60.4
 - requires NSS >= 3.36.6
 
 -------------------------------------------------------------------
--- a/MozillaFirefox/MozillaFirefox.spec	Mon Dec 10 22:33:01 2018 +0100
+++ b/MozillaFirefox/MozillaFirefox.spec	Tue Mar 19 09:49:20 2019 +0100
@@ -2,7 +2,7 @@
 # spec file for package MozillaFirefox
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
-#               2006-2018 Wolfgang Rosenauer
+#               2006-2019 Wolfgang Rosenauer
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,10 +19,10 @@
 
 # changed with every update
 %define major 60
-%define mainver %major.4.0
+%define mainver %major.5.0
 %define update_channel esr
 %define branding 1
-%define releasedate 20181203164059
+%define releasedate 20190121141556
 %define source_prefix firefox-%{mainver}
 
 # PIE, full relro (x86_64 for now)
@@ -73,7 +73,7 @@
 BuildRequires:  libproxy-devel
 BuildRequires:  makeinfo
 BuildRequires:  mozilla-nspr-devel >= 4.19
-BuildRequires:  mozilla-nss-devel >= 3.36.6
+BuildRequires:  mozilla-nss-devel >= 3.36.7
 BuildRequires:  python-devel
 BuildRequires:  python2-xml
 BuildRequires:  rust >= 1.24
@@ -150,7 +150,6 @@
 Patch2:         mozilla-kde.patch
 Patch3:         mozilla-ntlm-full-path.patch
 Patch4:         mozilla-openaes-decl.patch
-Patch5:         mozilla-no-stdcxx-check.patch
 Patch6:         mozilla-reduce-files-per-UnifiedBindings.patch
 Patch7:         mozilla-aarch64-startup-crash.patch
 Patch8:         mozilla-bmo256180.patch
@@ -159,6 +158,7 @@
 Patch11:        mozilla-bmo1464766.patch
 Patch13:        mozilla-bmo1375074.patch
 Patch14:        mozilla-bmo1436242.patch
+Patch15:        mozilla-bmo1463035.patch
 # Firefox/browser
 Patch101:       firefox-kde.patch
 Patch102:       firefox-branded-icons.patch
@@ -262,7 +262,6 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
-%patch5 -p1
 %ifarch %ix86
 %patch6 -p1
 %endif
@@ -275,6 +274,7 @@
 %patch11 -p1
 %patch13 -p1
 %patch14 -p1
+%patch15 -p1
 # Firefox
 %patch101 -p1
 %patch102 -p1
--- a/MozillaFirefox/_constraints	Mon Dec 10 22:33:01 2018 +0100
+++ b/MozillaFirefox/_constraints	Tue Mar 19 09:49:20 2019 +0100
@@ -5,7 +5,7 @@
       <size unit="G">16</size>
     </disk>
     <memory>
-      <size unit="G">12</size>
+      <size unit="G">8</size>
     </memory>
   </hardware>
   <overwrite>
--- a/MozillaFirefox/create-tar.sh	Mon Dec 10 22:33:01 2018 +0100
+++ b/MozillaFirefox/create-tar.sh	Tue Mar 19 09:49:20 2019 +0100
@@ -7,8 +7,8 @@
 
 CHANNEL="esr60"
 BRANCH="releases/mozilla-$CHANNEL"
-RELEASE_TAG="6cc5fc0eaeaf9a9abcfc2722999ecdc6b539c23d"
-VERSION="60.4.0"
+RELEASE_TAG="15cf33587a608bd7ab91a3cd4ae47dea66ce73db"
+VERSION="60.5.0"
 VERSION_SUFFIX="esr"
 LOCALE_FILE="firefox-$VERSION/browser/locales/l10n-changesets.json"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MozillaFirefox/mozilla-bmo1463035.patch	Tue Mar 19 09:49:20 2019 +0100
@@ -0,0 +1,1 @@
+../mozilla-bmo1463035.patch
\ No newline at end of file
--- a/MozillaFirefox/mozilla-no-stdcxx-check.patch	Mon Dec 10 22:33:01 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../mozilla-no-stdcxx-check.patch
\ No newline at end of file
--- a/MozillaFirefox/source-stamp.txt	Mon Dec 10 22:33:01 2018 +0100
+++ b/MozillaFirefox/source-stamp.txt	Tue Mar 19 09:49:20 2019 +0100
@@ -1,2 +1,2 @@
-REV=6cc5fc0eaeaf
+REV=15cf33587a60
 REPO=http://hg.mozilla.org/releases/mozilla-esr60
--- a/firefox-kde.patch	Mon Dec 10 22:33:01 2018 +0100
+++ b/firefox-kde.patch	Tue Mar 19 09:49:20 2019 +0100
@@ -1,5 +1,5 @@
 # HG changeset patch
-# Parent  1b44c077e473c5a7d02fab26e2a220ebf219e0ab
+# Parent  9420d583bb274ee7070d3a39292ac6238062b855
 
 diff --git a/browser/base/content/browser-kde.xul b/browser/base/content/browser-kde.xul
 new file mode 100644
@@ -1349,11 +1349,11 @@
  
  NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
  
-@@ -64,17 +62,17 @@ NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID)
- NS_GENERIC_FACTORY_CONSTRUCTOR(nsSessionStoreUtils)
+@@ -65,17 +63,17 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsSession
  NS_DEFINE_NAMED_CID(NS_SESSIONSTOREUTILS_CID);
  
  static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
+     // clang-format off
      { &kNS_BROWSERDIRECTORYPROVIDER_CID, false, nullptr, DirectoryProviderConstructor },
  #if defined(XP_WIN)
      { &kNS_SHELLSERVICE_CID, false, nullptr, nsWindowsShellServiceConstructor },
--- a/mozilla-aarch64-startup-crash.patch	Mon Dec 10 22:33:01 2018 +0100
+++ b/mozilla-aarch64-startup-crash.patch	Tue Mar 19 09:49:20 2019 +0100
@@ -1,32 +1,33 @@
 # HG changeset patch
 # Parent a5cfa3aa11a9d3391df49de6fc5a0e5232c12c10
-# Parent  3005da37da3f1e2c568b1675307d10860182d214
+# Parent  85c2e07d2a9ec3e45f55d0e482c7b663626bfc8a
 Bug 991344 - Rpi3: Firefox crashes after a few seconds of usage
 
 diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp
 --- a/netwerk/base/nsIOService.cpp
 +++ b/netwerk/base/nsIOService.cpp
-@@ -887,17 +887,23 @@ nsIOService::NewChannelFromURIWithProxyF
-                     "doesn't support nsIUploadChannel2. An extension has "
-                     "supplied a non-functional http protocol handler. This will "
-                     "break behavior and in future releases not work at all.");
-             }
-             gHasWarnedUploadChannel2 = true;
-         }
+@@ -874,18 +874,23 @@ nsresult nsIOService::NewChannelFromURIW
+             u"Http channel implementation "
+             "doesn't support nsIUploadChannel2. An extension has "
+             "supplied a non-functional http protocol handler. This will "
+             "break behavior and in future releases not work at all.");
+       }
+       gHasWarnedUploadChannel2 = true;
      }
- 
+   }
+-
 +#if defined(__aarch64__)
-+    if (result) {
-+        channel.forget(result);
-+    }
++  if (result) {
++      channel.forget(result);
++  }
 +#else
-     channel.forget(result);
+   channel.forget(result);
 +#endif
-     return NS_OK;
+   return NS_OK;
  }
  
  NS_IMETHODIMP
- nsIOService::NewChannelFromURIWithProxyFlags2(nsIURI* aURI,
-                                               nsIURI* aProxyURI,
-                                               uint32_t aProxyFlags,
-                                               nsIDOMNode* aLoadingNode,
+ nsIOService::NewChannelFromURIWithProxyFlags2(
+     nsIURI *aURI, nsIURI *aProxyURI, uint32_t aProxyFlags,
+     nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal,
+     nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags,
--- a/mozilla-bmo1375074.patch	Mon Dec 10 22:33:01 2018 +0100
+++ b/mozilla-bmo1375074.patch	Tue Mar 19 09:49:20 2019 +0100
@@ -3,7 +3,7 @@
 # User Lars T Hansen <lhansen@mozilla.com>
 # Date 1519822672 -3600
 # Node ID 800abe66894d6b07b24bccecbf6a65e2261076f6
-# Parent  223c97459e96183eb616aed39147207bdb953ba8
+# Parent  13ecd3214b18e4cab73c54e12e16071d58bed11e
 Bug 1375074 - Save and restore non-volatile x28 on ARM64 for generated unboxed object constructor.  r=sstangl
 
 diff --git a/js/src/jit-test/tests/bug1375074.js b/js/src/jit-test/tests/bug1375074.js
@@ -32,64 +32,64 @@
 diff --git a/js/src/vm/UnboxedObject.cpp b/js/src/vm/UnboxedObject.cpp
 --- a/js/src/vm/UnboxedObject.cpp
 +++ b/js/src/vm/UnboxedObject.cpp
-@@ -90,17 +90,25 @@ UnboxedLayout::makeConstructorCode(JSCon
-     masm.loadPtr(Address(masm.getStackPointer(), sizeof(void*)), propertiesReg);
-     masm.loadPtr(Address(masm.getStackPointer(), 2 * sizeof(void*)), newKindReg);
+@@ -81,18 +81,25 @@ static const uintptr_t CLEAR_CONSTRUCTOR
+   masm.loadPtr(Address(masm.getStackPointer(), sizeof(void*)), propertiesReg);
+   masm.loadPtr(Address(masm.getStackPointer(), 2 * sizeof(void*)), newKindReg);
  #else
-     propertiesReg = IntArgReg0;
-     newKindReg = IntArgReg1;
+   propertiesReg = IntArgReg0;
+   newKindReg = IntArgReg1;
  #endif
  
  #ifdef JS_CODEGEN_ARM64
--    // ARM64 communicates stack address via sp, but uses a pseudo-sp for addressing.
-+    // ARM64 communicates stack address via sp, but uses a pseudo-sp (PSP) for
-+    // addressing.  The register we use for PSP may however also be used by
-+    // calling code, and it is nonvolatile, so save it.  Do this as a special
-+    // case first because the generic save/restore code needs the PSP to be
-+    // initialized already.
-+    MOZ_ASSERT(PseudoStackPointer64.Is(masm.GetStackPointer64()));
-+    masm.Str(PseudoStackPointer64, vixl::MemOperand(sp, -16, vixl::PreIndex));
+-  // ARM64 communicates stack address via sp, but uses a pseudo-sp for
+-  // addressing.
++  // ARM64 communicates stack address via sp, but uses a pseudo-sp (PSP) for
++  // addressing.  The register we use for PSP may however also be used by
++  // calling code, and it is nonvolatile, so save it.  Do this as a special
++  // case first because the generic save/restore code needs the PSP to be
++  // initialized already.
++  MOZ_ASSERT(PseudoStackPointer64.Is(masm.GetStackPointer64()));
++  masm.Str(PseudoStackPointer64, vixl::MemOperand(sp, -16, vixl::PreIndex));
 +
-+    // Initialize the PSP from the SP.
-     masm.initStackPtr();
++  // Initialize the PSP from the SP.
+   masm.initStackPtr();
  #endif
  
-     MOZ_ASSERT(propertiesReg.volatile_());
-     MOZ_ASSERT(newKindReg.volatile_());
+   MOZ_ASSERT(propertiesReg.volatile_());
+   MOZ_ASSERT(newKindReg.volatile_());
  
-     AllocatableGeneralRegisterSet regs(GeneralRegisterSet::All());
-     regs.take(propertiesReg);
-@@ -228,17 +236,32 @@ UnboxedLayout::makeConstructorCode(JSCon
-     if (object != ReturnReg)
-         masm.movePtr(object, ReturnReg);
+   AllocatableGeneralRegisterSet regs(GeneralRegisterSet::All());
+   regs.take(propertiesReg);
+@@ -234,17 +241,32 @@ static const uintptr_t CLEAR_CONSTRUCTOR
+   masm.bind(&done);
  
-     // Restore non-volatile registers which were saved on entry.
-     if (ScratchDoubleReg.volatile_())
-         masm.pop(ScratchDoubleReg);
-     masm.PopRegsInMask(savedNonVolatileRegisters);
+   if (object != ReturnReg) masm.movePtr(object, ReturnReg);
+ 
+   // Restore non-volatile registers which were saved on entry.
+   if (ScratchDoubleReg.volatile_()) masm.pop(ScratchDoubleReg);
+   masm.PopRegsInMask(savedNonVolatileRegisters);
  
 +#ifdef JS_CODEGEN_ARM64
-+    // Now restore the value that was in the PSP register on entry, and return.
++  // Now restore the value that was in the PSP register on entry, and return.
 +
-+    // Obtain the correct SP from the PSP.
-+    masm.Mov(sp, PseudoStackPointer64);
++  // Obtain the correct SP from the PSP.
++  masm.Mov(sp, PseudoStackPointer64);
 +
-+    // Restore the saved value of the PSP register, this value is whatever the
-+    // caller had saved in it, not any actual SP value, and it must not be
-+    // overwritten subsequently.
-+    masm.Ldr(PseudoStackPointer64, vixl::MemOperand(sp, 16, vixl::PostIndex));
++  // Restore the saved value of the PSP register, this value is whatever the
++  // caller had saved in it, not any actual SP value, and it must not be
++  // overwritten subsequently.
++  masm.Ldr(PseudoStackPointer64, vixl::MemOperand(sp, 16, vixl::PostIndex));
 +
-+    // Perform a plain Ret(), as abiret() will move SP <- PSP and that is wrong.
-+    masm.Ret(vixl::lr);
++  // Perform a plain Ret(), as abiret() will move SP <- PSP and that is wrong.
++  masm.Ret(vixl::lr);
 +#else
-     masm.abiret();
+   masm.abiret();
 +#endif
  
-     masm.bind(&failureStoreOther);
+   masm.bind(&failureStoreOther);
  
-     // There was a failure while storing a value which cannot be stored at all
-     // in the unboxed object. Initialize the object so it is safe for GC and
-     // return null.
-     masm.initUnboxedObjectContents(object, templateObject);
+   // There was a failure while storing a value which cannot be stored at all
+   // in the unboxed object. Initialize the object so it is safe for GC and
+   // return null.
+   masm.initUnboxedObjectContents(object, templateObject);
  
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mozilla-bmo1463035.patch	Tue Mar 19 09:49:20 2019 +0100
@@ -0,0 +1,121 @@
+
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1526871862 -32400
+# Node ID 94f21505ff13cd089f7129cd24927cf8b31a0f43
+# Parent  4a2e8085417fe782738bfd736b69806d9ed19d6a
+Bug 1463035 - Remove MOZ_SIGNAL_TRAMPOLINE. r?darchons
+
+For some reason, GNU as is not happy with the assembly generated after
+bug 1238661 anymore on Debian armel.
+
+OTOH, as mentioned in bug 1238661 comment 4, we actually don't need this
+workaround anymore, so let's just kill it.
+
+diff --git a/mfbt/LinuxSignal.h b/mfbt/LinuxSignal.h
+deleted file mode 100644
+--- a/mfbt/LinuxSignal.h
++++ /dev/null
+@@ -1,38 +0,0 @@
+-/* 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/. */
+-
+-#ifndef mozilla_LinuxSignal_h
+-#define mozilla_LinuxSignal_h
+-
+-namespace mozilla {
+-
+-#if defined(__arm__)
+-
+-// Some (old) Linux kernels on ARM have a bug where a signal handler
+-// can be called without clearing the IT bits in CPSR first. The result
+-// is that the first few instructions of the handler could be skipped,
+-// ultimately resulting in crashes. To workaround this bug, the handler
+-// on ARM is a trampoline that starts with enough NOP instructions, so
+-// that even if the IT bits are not cleared, only the NOP instructions
+-// will be skipped over.
+-
+-template <void (*H)(int, siginfo_t*, void*)>
+-__attribute__((naked)) void SignalTrampoline(int aSignal, siginfo_t* aInfo,
+-                                             void* aContext) {
+-  asm volatile("nop; nop; nop; nop" : : : "memory");
+-
+-  asm volatile("b %0" : : "X"(H) : "memory");
+-}
+-
+-#define MOZ_SIGNAL_TRAMPOLINE(h) (mozilla::SignalTrampoline<h>)
+-
+-#else  // __arm__
+-
+-#define MOZ_SIGNAL_TRAMPOLINE(h) (h)
+-
+-#endif  // __arm__
+-
+-}  // namespace mozilla
+-
+-#endif  // mozilla_LinuxSignal_h
+diff --git a/mfbt/moz.build b/mfbt/moz.build
+--- a/mfbt/moz.build
++++ b/mfbt/moz.build
+@@ -115,20 +115,16 @@ EXPORTS["double-conversion"] = [
+ LOCAL_INCLUDES += [
+     '/mfbt/double-conversion',
+ ]
+ 
+ if CONFIG['OS_ARCH'] == 'WINNT':
+     EXPORTS.mozilla += [
+         'WindowsVersion.h',
+     ]
+-elif CONFIG['OS_ARCH'] == 'Linux':
+-    EXPORTS.mozilla += [
+-        'LinuxSignal.h',
+-    ]
+ 
+ UNIFIED_SOURCES += [
+     'Assertions.cpp',
+     'ChaosMode.cpp',
+     'double-conversion/double-conversion/bignum-dtoa.cc',
+     'double-conversion/double-conversion/bignum.cc',
+     'double-conversion/double-conversion/cached-powers.cc',
+     'double-conversion/double-conversion/diy-fp.cc',
+diff --git a/tools/profiler/core/platform-linux-android.cpp b/tools/profiler/core/platform-linux-android.cpp
+--- a/tools/profiler/core/platform-linux-android.cpp
++++ b/tools/profiler/core/platform-linux-android.cpp
+@@ -55,17 +55,16 @@
+ #ifdef __GLIBC__
+ #include <execinfo.h>  // backtrace, backtrace_symbols
+ #endif                 // def __GLIBC__
+ #include <strings.h>   // index
+ #include <errno.h>
+ #include <stdarg.h>
+ 
+ #include "prenv.h"
+-#include "mozilla/LinuxSignal.h"
+ #include "mozilla/PodOperations.h"
+ #include "mozilla/DebugOnly.h"
+ 
+ #include <string.h>
+ #include <list>
+ 
+ using namespace mozilla;
+ 
+@@ -248,17 +247,17 @@ Sampler::Sampler(PSLockRef aLock)
+ 
+   // NOTE: We don't initialize LUL here, instead initializing it in
+   // SamplerThread's constructor. This is because with the
+   // profiler_suspend_and_sample_thread entry point, we want to be able to
+   // sample without waiting for LUL to be initialized.
+ 
+   // Request profiling signals.
+   struct sigaction sa;
+-  sa.sa_sigaction = MOZ_SIGNAL_TRAMPOLINE(SigprofHandler);
++  sa.sa_sigaction = SigprofHandler;
+   sigemptyset(&sa.sa_mask);
+   sa.sa_flags = SA_RESTART | SA_SIGINFO;
+   if (sigaction(SIGPROF, &sa, &mOldSigprofHandler) != 0) {
+     MOZ_CRASH("Error installing SIGPROF handler in the profiler");
+   }
+ }
+ 
+ void Sampler::Disable(PSLockRef aLock) {
--- a/mozilla-bmo256180.patch	Mon Dec 10 22:33:01 2018 +0100
+++ b/mozilla-bmo256180.patch	Tue Mar 19 09:49:20 2019 +0100
@@ -1,11 +1,25 @@
---- a/layout/generic/nsIFrame.h.old	2016-07-11 13:41:39.688276559 +0200
-+++ b/layout/generic/nsIFrame.h	2016-07-11 13:42:12.791406976 +0200
-@@ -13,7 +13,7 @@
+# HG changeset patch
+# Parent  1f4171c3a5ca8a659154b0a846f9b9158c7f7923
+
+diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h
+--- a/layout/generic/nsIFrame.h
++++ b/layout/generic/nsIFrame.h
+@@ -8,17 +8,17 @@
+ 
+ #ifndef nsIFrame_h___
+ #define nsIFrame_h___
+ 
+ #ifndef MOZILLA_INTERNAL_API
  #error This header/class should only be used within Mozilla code. It should not be used by extensions.
  #endif
  
 -#define MAX_REFLOW_DEPTH 200
 +#define MAX_REFLOW_DEPTH 1000
  
- /* nsIFrame is in the process of being deCOMtaminated, i.e., this file is eventually
-    going to be eliminated, and all callers will use nsFrame instead.  At the moment
+ /* nsIFrame is in the process of being deCOMtaminated, i.e., this file is
+    eventually going to be eliminated, and all callers will use nsFrame instead.
+    At the moment we're midway through this process, so you will see inlined
+    functions and member variables in this file.  -dwh */
+ 
+ #include <algorithm>
+ #include <stdio.h>
--- a/mozilla-kde.patch	Mon Dec 10 22:33:01 2018 +0100
+++ b/mozilla-kde.patch	Tue Mar 19 09:49:20 2019 +0100
@@ -1,16 +1,20 @@
 # HG changeset patch
-# Parent  d7a4d772ba2afb3ac43e2f2f234ffa55bcf50e70
+# Parent  58a0b60e25e7160c9877299a37a2f10660888e9a
 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-60.2.0/modules/libpref/Preferences.cpp
-===================================================================
---- firefox-60.2.0.orig/modules/libpref/Preferences.cpp	2018-09-05 21:49:23.102829401 +0200
-+++ firefox-60.2.0/modules/libpref/Preferences.cpp	2018-09-05 21:49:31.498872824 +0200
-@@ -81,6 +81,7 @@
+diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
+--- a/modules/libpref/Preferences.cpp
++++ b/modules/libpref/Preferences.cpp
+@@ -76,16 +76,17 @@
+ #include "nsXPCOMCID.h"
+ #include "nsXPCOM.h"
+ #include "nsXULAppAPI.h"
+ #include "nsZipArchive.h"
+ #include "plbase64.h"
  #include "PLDHashTable.h"
  #include "plstr.h"
  #include "prlink.h"
@@ -18,7 +22,17 @@
  
  #ifdef XP_WIN
  #include "windows.h"
-@@ -3873,6 +3874,7 @@ Preferences::InitInitialObjects()
+ #endif
+ 
+ using namespace mozilla;
+ 
+ #ifdef DEBUG
+@@ -3519,25 +3520,37 @@ static nsresult pref_ReadPrefFromJar(nsZ
+   // application pref files for backwards compatibility.
+   static const char* specialFiles[] = {
+ #if defined(XP_MACOSX)
+     "macprefs.js"
+ #elif defined(XP_WIN)
      "winpref.js"
  #elif defined(XP_UNIX)
      "unix.js"
@@ -26,7 +40,9 @@
  #if defined(_AIX)
      ,
      "aix.js"
-@@ -3882,6 +3884,17 @@ Preferences::InitInitialObjects()
+ #endif
+ #elif defined(XP_BEOS)
+     "beos.js"
  #endif
    };
  
@@ -41,10 +57,20 @@
 +    }
 +  }
 +
-   rv = pref_LoadPrefsInDir(
-     defaultPrefDir, specialFiles, ArrayLength(specialFiles));
+   rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles,
+                            ArrayLength(specialFiles));
    if (NS_FAILED(rv)) {
-@@ -3940,7 +3953,7 @@ 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.
+@@ -3585,17 +3598,17 @@ static nsresult pref_ReadPrefFromJar(nsZ
+       }
+ 
+       nsCOMPtr<nsIFile> path = do_QueryInterface(elem);
+       if (!path) {
+         continue;
        }
  
        // Do we care if a file provided by this process fails to load?
@@ -53,11 +79,20 @@
      }
    }
  
-Index: firefox-60.2.0/modules/libpref/moz.build
-===================================================================
---- firefox-60.2.0.orig/modules/libpref/moz.build	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/modules/libpref/moz.build	2018-09-05 21:49:31.498872824 +0200
-@@ -32,6 +32,10 @@ UNIFIED_SOURCES += [
+ #ifdef MOZ_WIDGET_ANDROID
+   // Set up the correct default for toolkit.telemetry.enabled. If this build
+   // has MOZ_TELEMETRY_ON_BY_DEFAULT *or* we're on the beta channel, telemetry
+   // is on by default, otherwise not. This is necessary so that beta users who
+   // are testing final release builds don't flipflop defaults.
+diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
+--- a/modules/libpref/moz.build
++++ b/modules/libpref/moz.build
+@@ -27,16 +27,20 @@ XPIDL_MODULE = 'pref'
+ EXPORTS.mozilla += [
+     'Preferences.h',
+ ]
+ 
+ UNIFIED_SOURCES += [
      'Preferences.cpp',
  ]
  
@@ -68,11 +103,20 @@
  include('/ipc/chromium/chromium-config.mozbuild')
  
  FINAL_LIBRARY = 'xul'
-Index: firefox-60.2.0/python/mozbuild/mozpack/chrome/flags.py
-===================================================================
---- firefox-60.2.0.orig/python/mozbuild/mozpack/chrome/flags.py	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/python/mozbuild/mozpack/chrome/flags.py	2018-09-05 21:49:31.498872824 +0200
-@@ -225,6 +225,7 @@ class Flags(OrderedDict):
+ 
+ DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
+ DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
+ if CONFIG['MOZ_ENABLE_WEBRENDER']:
+     DEFINES['MOZ_ENABLE_WEBRENDER'] = True
+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
+@@ -220,16 +220,17 @@ class Flags(OrderedDict):
+         'contentaccessible': Flag,
+         'os': StringFlag,
+         'osversion': VersionFlag,
+         'abi': StringFlag,
+         'platform': Flag,
          'xpcnativewrappers': Flag,
          'tablet': Flag,
          'process': StringFlag,
@@ -80,11 +124,20 @@
      }
      RE = re.compile(r'([!<>=]+)')
  
-Index: firefox-60.2.0/python/mozbuild/mozpack/chrome/manifest.py
-===================================================================
---- firefox-60.2.0.orig/python/mozbuild/mozpack/chrome/manifest.py	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/python/mozbuild/mozpack/chrome/manifest.py	2018-09-05 21:49:31.498872824 +0200
-@@ -39,6 +39,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
+@@ -34,16 +34,17 @@ class ManifestEntry(object):
+         'platformversion',
+         'os',
+         'osversion',
+         'abi',
+         'xpcnativewrappers',
          'tablet',
          'process',
          'contentaccessible',
@@ -92,11 +145,20 @@
      ]
  
      def __init__(self, base, *flags):
-Index: firefox-60.2.0/toolkit/components/downloads/moz.build
-===================================================================
---- firefox-60.2.0.orig/toolkit/components/downloads/moz.build	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/toolkit/components/downloads/moz.build	2018-09-05 21:49:31.498872824 +0200
-@@ -46,5 +46,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
+@@ -41,10 +41,14 @@ EXTRA_JS_MODULES += [
+ 
+ if CONFIG['MOZ_PLACES']:
+     EXTRA_JS_MODULES += [
+         'DownloadHistory.jsm',
+     ]
  
  FINAL_LIBRARY = 'xul'
  
@@ -106,11 +168,15 @@
 +
  with Files('**'):
      BUG_COMPONENT = ('Toolkit', 'Download Manager')
-Index: firefox-60.2.0/toolkit/content/jar.mn
-===================================================================
---- firefox-60.2.0.orig/toolkit/content/jar.mn	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/toolkit/content/jar.mn	2018-09-05 21:49:31.498872824 +0200
-@@ -74,6 +74,8 @@ toolkit.jar:
+diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
+--- a/toolkit/content/jar.mn
++++ b/toolkit/content/jar.mn
+@@ -69,16 +69,18 @@ toolkit.jar:
+    content/global/bindings/checkbox.xml        (widgets/checkbox.xml)
+    content/global/bindings/colorpicker.xml     (widgets/colorpicker.xml)
+    content/global/bindings/datekeeper.js       (widgets/datekeeper.js)
+    content/global/bindings/datepicker.js       (widgets/datepicker.js)
+    content/global/bindings/datetimepopup.xml   (widgets/datetimepopup.xml)
     content/global/bindings/datetimebox.xml     (widgets/datetimebox.xml)
     content/global/bindings/datetimebox.css     (widgets/datetimebox.css)
  *  content/global/bindings/dialog.xml          (widgets/dialog.xml)
@@ -119,10 +185,15 @@
     content/global/bindings/editor.xml          (widgets/editor.xml)
     content/global/bindings/filefield.xml       (widgets/filefield.xml)
  *  content/global/bindings/findbar.xml         (widgets/findbar.xml)
-Index: firefox-60.2.0/toolkit/content/widgets/dialog-kde.xml
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ firefox-60.2.0/toolkit/content/widgets/dialog-kde.xml	2018-09-05 21:49:31.498872824 +0200
+    content/global/bindings/general.xml         (widgets/general.xml)
+    content/global/bindings/groupbox.xml        (widgets/groupbox.xml)
+    content/global/bindings/listbox.xml         (widgets/listbox.xml)
+    content/global/bindings/menu.xml            (widgets/menu.xml)
+    content/global/bindings/menulist.xml        (widgets/menulist.xml)
+diff --git a/toolkit/content/widgets/dialog-kde.xml b/toolkit/content/widgets/dialog-kde.xml
+new file mode 100644
+--- /dev/null
++++ b/toolkit/content/widgets/dialog-kde.xml
 @@ -0,0 +1,478 @@
 +<?xml version="1.0"?>
 +<!-- This Source Code Form is subject to the terms of the Mozilla Public
@@ -602,11 +673,15 @@
 +  </binding>
 +
 +</bindings>
-Index: firefox-60.2.0/toolkit/mozapps/downloads/nsHelperAppDlg.js
-===================================================================
---- firefox-60.2.0.orig/toolkit/mozapps/downloads/nsHelperAppDlg.js	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/toolkit/mozapps/downloads/nsHelperAppDlg.js	2018-09-05 21:49:31.498872824 +0200
-@@ -632,7 +632,7 @@ nsUnknownContentTypeDialog.prototype = {
+diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js
+--- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
++++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
+@@ -627,17 +627,17 @@ nsUnknownContentTypeDialog.prototype = {
+       else
+         typeString = mimeInfo.MIMEType;
+     }
+     // When the length is unknown, contentLength would be -1
+     if (this.mLauncher.contentLength >= 0) {
        let [size, unit] = DownloadUtils.
                           convertByteUnits(this.mLauncher.contentLength);
        type.value = this.dialogElement("strings")
@@ -615,7 +690,17 @@
                                             [typeString, size, unit]);
      }
      else {
-@@ -806,7 +806,7 @@ nsUnknownContentTypeDialog.prototype = {
+       type.value = typeString;
+     }
+   },
+ 
+   // Returns true if opening the default application makes sense.
+@@ -801,17 +801,17 @@ nsUnknownContentTypeDialog.prototype = {
+       switch (this.dialogElement("openHandler").selectedIndex) {
+       case 0:
+         // No app need be specified in this case.
+         ok = true;
+         break;
        case 1:
          // only enable the OK button if we have a default app to use or if
          // the user chose an app....
@@ -624,7 +709,17 @@
          break;
        }
      }
-@@ -1071,20 +1071,50 @@ nsUnknownContentTypeDialog.prototype = {
+ 
+     // Enable Ok button if ok to press.
+     this.mDialog.document.documentElement.getButton("accept").disabled = !ok;
+   },
+ 
+@@ -1066,30 +1066,60 @@ nsUnknownContentTypeDialog.prototype = {
+ 
+       if (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) {
@@ -689,38 +784,77 @@
      } else {
        var nsIFilePicker = Ci.nsIFilePicker;
        var fp = Cc["@mozilla.org/filepicker;1"]
-Index: firefox-60.2.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
-===================================================================
---- firefox-60.2.0.orig/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp	2018-09-05 21:49:31.498872824 +0200
-@@ -20,6 +20,7 @@
+                  .createInstance(nsIFilePicker);
+       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
+@@ -15,16 +15,17 @@
+ #include "nsPrintfCString.h"
+ #include "nsNetCID.h"
+ #include "nsNetUtil.h"
+ #include "nsISupportsPrimitives.h"
+ #include "nsIGSettingsService.h"
  #include "nsInterfaceHashtable.h"
  #include "mozilla/Attributes.h"
  #include "nsIURI.h"
 +#include "nsKDEUtils.h"
  
  class nsUnixSystemProxySettings final : public nsISystemProxySettings {
- public:
-@@ -44,6 +45,7 @@ private:
-   nsresult GetProxyFromGConf(const nsACString& aScheme, const nsACString& aHost, int32_t aPort, nsACString& aResult);
-   nsresult GetProxyFromGSettings(const nsACString& aScheme, const nsACString& aHost, int32_t aPort, nsACString& aResult);
-   nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType, nsACString& aResult);
+  public:
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSISYSTEMPROXYSETTINGS
+ 
+   nsUnixSystemProxySettings() : mSchemeProxySettings(4) {}
+   nsresult Init();
+@@ -42,16 +43,17 @@ class nsUnixSystemProxySettings final : 
+                                    nsACString& aResult);
+   nsresult GetProxyFromGConf(const nsACString& aScheme, const nsACString& aHost,
+                              int32_t aPort, nsACString& aResult);
+   nsresult GetProxyFromGSettings(const nsACString& aScheme,
+                                  const nsACString& aHost, int32_t aPort,
+                                  nsACString& aResult);
+   nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType,
+                                        nsACString& aResult);
 +  nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost, PRInt32 aPort, nsACString& aResult);
  };
  
  NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings)
-@@ -510,6 +512,9 @@ nsUnixSystemProxySettings::GetProxyForUR
-                                           const int32_t      aPort,
-                                           nsACString & aResult)
- {
+ 
+ NS_IMETHODIMP
+ nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) {
+   // dbus prevents us from being threadsafe, but this routine should not block
+   // anyhow
+@@ -488,16 +490,19 @@ nsresult nsUnixSystemProxySettings::GetP
+   return NS_OK;
+ }
+ 
+ nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec,
+                                                    const nsACString& aScheme,
+                                                    const nsACString& aHost,
+                                                    const int32_t aPort,
+                                                    nsACString& aResult) {
 +  if (nsKDEUtils::kdeSupport())
 +    return GetProxyFromKDE(aScheme, aHost, aPort, aResult);
 +
    if (mProxySettings) {
      nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult);
-     if (NS_SUCCEEDED(rv))
-@@ -545,3 +550,29 @@ static const mozilla::Module kUnixProxyM
- };
+     if (NS_SUCCEEDED(rv)) return rv;
+   }
+   if (mGConf) return GetProxyFromGConf(aScheme, aHost, aPort, aResult);
+ 
+   return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult);
+ }
+@@ -521,8 +526,34 @@ static const mozilla::Module::CIDEntry k
+ static const mozilla::Module::ContractIDEntry kUnixProxyContracts[] = {
+     {NS_SYSTEMPROXYSETTINGS_CONTRACTID, &kNS_UNIXSYSTEMPROXYSERVICE_CID},
+     {nullptr}};
+ 
+ static const mozilla::Module kUnixProxyModule = {
+     mozilla::Module::kVersion, kUnixProxyCIDs, kUnixProxyContracts};
  
  NSMODULE_DEFN(nsUnixProxyModule) = &kUnixProxyModule;
 +
@@ -749,11 +883,15 @@
 +  return NS_OK;
 +}
 +
-Index: firefox-60.2.0/toolkit/xre/moz.build
-===================================================================
---- firefox-60.2.0.orig/toolkit/xre/moz.build	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/toolkit/xre/moz.build	2018-09-05 21:49:31.498872824 +0200
-@@ -70,7 +70,9 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'ui
+diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
+--- a/toolkit/xre/moz.build
++++ b/toolkit/xre/moz.build
+@@ -65,17 +65,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
+         '../components/printingui',
+     ]
+ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
+     UNIFIED_SOURCES += [
+         'nsNativeAppSupportDefault.cpp',
          'UIKitDirProvider.mm',
      ]
  elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
@@ -763,10 +901,15 @@
          'nsNativeAppSupportUnix.cpp',
      ]
  else:
-Index: firefox-60.2.0/toolkit/xre/nsKDEUtils.cpp
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ firefox-60.2.0/toolkit/xre/nsKDEUtils.cpp	2018-09-05 21:49:31.498872824 +0200
+     UNIFIED_SOURCES += [
+         'nsNativeAppSupportDefault.cpp',
+     ]
+ 
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
+new file mode 100644
+--- /dev/null
++++ b/toolkit/xre/nsKDEUtils.cpp
 @@ -0,0 +1,344 @@
 +/* -*- 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
@@ -1112,10 +1255,10 @@
 +    fputs( "\\E\n", commandFile ); // done as \E, so it cannot happen in normal data
 +    fflush( commandFile );
 +    }
-Index: firefox-60.2.0/toolkit/xre/nsKDEUtils.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ firefox-60.2.0/toolkit/xre/nsKDEUtils.h	2018-09-05 21:49:31.498872824 +0200
+diff --git a/toolkit/xre/nsKDEUtils.h b/toolkit/xre/nsKDEUtils.h
+new file mode 100644
+--- /dev/null
++++ b/toolkit/xre/nsKDEUtils.h
 @@ -0,0 +1,48 @@
 +/* -*- 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
@@ -1165,11 +1308,14 @@
 +    };
 +
 +#endif // nsKDEUtils
-Index: firefox-60.2.0/uriloader/exthandler/HandlerServiceParent.cpp
-===================================================================
---- firefox-60.2.0.orig/uriloader/exthandler/HandlerServiceParent.cpp	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/uriloader/exthandler/HandlerServiceParent.cpp	2018-09-05 21:49:31.502872845 +0200
-@@ -5,7 +5,7 @@
+diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandler/HandlerServiceParent.cpp
+--- a/uriloader/exthandler/HandlerServiceParent.cpp
++++ b/uriloader/exthandler/HandlerServiceParent.cpp
+@@ -1,16 +1,16 @@
+ #include "mozilla/Logging.h"
+ #include "HandlerServiceParent.h"
+ #include "nsIHandlerService.h"
+ #include "nsIMIMEInfo.h"
  #include "ContentHandlerService.h"
  #include "nsStringEnumerator.h"
  #ifdef MOZ_WIDGET_GTK
@@ -1177,9 +1323,19 @@
 +#include "unix/nsCommonRegistry.h"
  #endif
  
+ using mozilla::dom::ContentHandlerService;
+ using mozilla::dom::HandlerApp;
  using mozilla::dom::HandlerInfo;
-@@ -269,7 +269,7 @@ HandlerServiceParent::RecvExistsForProto
- {
+ using mozilla::dom::RemoteHandlerApp;
+ 
+ namespace {
+@@ -245,17 +245,17 @@ mozilla::ipc::IPCResult HandlerServicePa
+   handlerSvc->Exists(info, exists);
+   return IPC_OK();
+ }
+ 
+ mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocol(
+     const nsCString& aProtocolScheme, bool* aHandlerExists) {
  #ifdef MOZ_WIDGET_GTK
    // Check the GNOME registry for a protocol handler
 -  *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme.get());
@@ -1187,11 +1343,20 @@
  #else
    *aHandlerExists = false;
  #endif
-Index: firefox-60.2.0/uriloader/exthandler/moz.build
-===================================================================
---- firefox-60.2.0.orig/uriloader/exthandler/moz.build	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/uriloader/exthandler/moz.build	2018-09-05 21:49:31.502872845 +0200
-@@ -82,7 +82,9 @@ else:
+   return IPC_OK();
+ }
+ 
+ mozilla::ipc::IPCResult HandlerServiceParent::RecvGetTypeFromExtension(
+     const nsCString& aFileExtension, nsCString* type) {
+diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
+--- a/uriloader/exthandler/moz.build
++++ b/uriloader/exthandler/moz.build
+@@ -77,17 +77,19 @@ else:
+     SOURCES += [
+         osdir + '/nsOSHelperAppService.cpp',
+     ]
+     if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
+         CXXFLAGS += ['-Wno-error=shadow']
  
  if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
      UNIFIED_SOURCES += [
@@ -1201,7 +1366,17 @@
          'unix/nsMIMEInfoUnix.cpp',
      ]
  elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
-@@ -129,6 +131,7 @@ LOCAL_INCLUDES += [
+     UNIFIED_SOURCES += [
+         'android/nsAndroidHandlerApp.cpp',
+         'android/nsExternalSharingAppService.cpp',
+         'android/nsExternalURLHandlerService.cpp',
+         'android/nsMIMEInfoAndroid.cpp',
+@@ -124,16 +126,17 @@ include('/ipc/chromium/chromium-config.m
+ FINAL_LIBRARY = 'xul'
+ 
+ LOCAL_INCLUDES += [
+     '/docshell/base',
+     '/dom/base',
      '/dom/ipc',
      '/netwerk/base',
      '/netwerk/protocol/http',
@@ -1209,10 +1384,15 @@
  ]
  
  if CONFIG['MOZ_ENABLE_DBUS']:
-Index: firefox-60.2.0/uriloader/exthandler/unix/nsCommonRegistry.cpp
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ firefox-60.2.0/uriloader/exthandler/unix/nsCommonRegistry.cpp	2018-09-05 21:49:31.502872845 +0200
+     CXXFLAGS += CONFIG['TK_CFLAGS']
+     CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
+ 
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+     CXXFLAGS += CONFIG['TK_CFLAGS']
+diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
+new file mode 100644
+--- /dev/null
++++ b/uriloader/exthandler/unix/nsCommonRegistry.cpp
 @@ -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
@@ -1267,10 +1447,10 @@
 +        return nsKDERegistry::GetFromType( aMIMEType );
 +    return nsGNOMERegistry::GetFromType( aMIMEType );
 +}
-Index: firefox-60.2.0/uriloader/exthandler/unix/nsCommonRegistry.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ firefox-60.2.0/uriloader/exthandler/unix/nsCommonRegistry.h	2018-09-05 21:49:31.502872845 +0200
+diff --git a/uriloader/exthandler/unix/nsCommonRegistry.h b/uriloader/exthandler/unix/nsCommonRegistry.h
+new file mode 100644
+--- /dev/null
++++ 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
@@ -1300,10 +1480,10 @@
 +};
 +
 +#endif
-Index: firefox-60.2.0/uriloader/exthandler/unix/nsKDERegistry.cpp
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ firefox-60.2.0/uriloader/exthandler/unix/nsKDERegistry.cpp	2018-09-05 21:49:31.502872845 +0200
+diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/unix/nsKDERegistry.cpp
+new file mode 100644
+--- /dev/null
++++ b/uriloader/exthandler/unix/nsKDERegistry.cpp
 @@ -0,0 +1,87 @@
 +/* -*- 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
@@ -1392,10 +1572,10 @@
 +        }
 +    return nullptr;
 +}
-Index: firefox-60.2.0/uriloader/exthandler/unix/nsKDERegistry.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ firefox-60.2.0/uriloader/exthandler/unix/nsKDERegistry.h	2018-09-05 21:49:31.502872845 +0200
+diff --git a/uriloader/exthandler/unix/nsKDERegistry.h b/uriloader/exthandler/unix/nsKDERegistry.h
+new file mode 100644
+--- /dev/null
++++ b/uriloader/exthandler/unix/nsKDERegistry.h
 @@ -0,0 +1,34 @@
 +/* 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
@@ -1431,11 +1611,14 @@
 +};
 +
 +#endif //nsKDERegistry_h__
-Index: firefox-60.2.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
-===================================================================
---- firefox-60.2.0.orig/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp	2018-09-05 21:49:31.502872845 +0200
-@@ -5,7 +5,7 @@
+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,47 +1,50 @@
+ /* -*- 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"
@@ -1444,7 +1627,7 @@
  #include "nsIGIOService.h"
  #include "nsNetCID.h"
  #include "nsIIOService.h"
-@@ -13,11 +13,14 @@
+ #include "nsAutoPtr.h"
  #ifdef MOZ_ENABLE_DBUS
  #include "nsDBusHandlerApp.h"
  #endif
@@ -1452,23 +1635,27 @@
 +#include "nsKDEUtils.h"
 +#endif
  
- nsresult
- nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI)
- {
+ nsresult nsMIMEInfoUnix::LoadUriInternal(nsIURI *aURI) {
 -  return nsGNOMERegistry::LoadURL(aURI);
 +  return nsCommonRegistry::LoadURL(aURI);
  }
  
  NS_IMETHODIMP
-@@ -32,14 +35,14 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo
+ nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval) {
+   // if mDefaultApplication 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 (mDefaultApplication) return nsMIMEInfoImpl::GetHasDefaultHandler(_retval);
+ 
    *_retval = false;
  
    if (mClass == eProtocolInfo) {
 -    *_retval = nsGNOMERegistry::HandlerExists(mSchemeOrType.get());
 +    *_retval = nsCommonRegistry::HandlerExists(mSchemeOrType.get());
    } else {
--    RefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType);
-+    RefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromType(mSchemeOrType);
+     RefPtr<nsMIMEInfoBase> mimeInfo =
+-        nsGNOMERegistry::GetFromType(mSchemeOrType);
++        nsCommonRegistry::GetFromType(mSchemeOrType);
      if (!mimeInfo) {
        nsAutoCString ext;
        nsresult rv = GetPrimaryExtension(ext);
@@ -1477,8 +1664,18 @@
 +        mimeInfo = nsCommonRegistry::GetFromExtension(ext);
        }
      }
-     if (mimeInfo)
-@@ -64,6 +67,23 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
+     if (mimeInfo) *_retval = true;
+   }
+ 
+   if (*_retval) return NS_OK;
+ 
+   return NS_OK;
+@@ -51,16 +54,33 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi
+   // if mDefaultApplication 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 (mDefaultApplication) return nsMIMEInfoImpl::LaunchDefaultWithFile(aFile);
+ 
    nsAutoCString nativePath;
    aFile->GetNativePath(nativePath);
  
@@ -1502,11 +1699,20 @@
    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
    if (!giovfs) {
      return NS_ERROR_FAILURE;
-Index: firefox-60.2.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp
-===================================================================
---- firefox-60.2.0.orig/uriloader/exthandler/unix/nsOSHelperAppService.cpp	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp	2018-09-05 21:49:31.502872845 +0200
-@@ -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
@@ -1515,7 +1721,17 @@
  #endif
  #include "nsISupports.h"
  #include "nsString.h"
-@@ -1133,7 +1133,7 @@ nsresult nsOSHelperAppService::OSProtoco
+ #include "nsReadableUtils.h"
+ #include "nsUnicharUtils.h"
+ #include "nsIURL.h"
+ #include "nsIFileStreams.h"
+ #include "nsILineInputStream.h"
+@@ -1040,17 +1040,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
@@ -1524,38 +1740,77 @@
  #else
      *aHandlerExists = false;
  #endif
-@@ -1151,7 +1151,7 @@ nsresult nsOSHelperAppService::OSProtoco
- NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString& aScheme, nsAString& _retval)
- {
+   } else {
+     *aHandlerExists = false;
+     nsCOMPtr<nsIHandlerService> handlerSvc =
+         do_GetService(NS_HANDLERSERVICE_CONTRACTID, &rv);
+     if (NS_SUCCEEDED(rv) && handlerSvc) {
+@@ -1060,17 +1060,17 @@ nsresult nsOSHelperAppService::OSProtoco
+   }
+ 
+   return rv;
+ }
+ 
+ NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(
+     const nsACString& aScheme, nsAString& _retval) {
  #ifdef MOZ_WIDGET_GTK
 -  nsGNOMERegistry::GetAppDescForScheme(aScheme, _retval);
 +  nsCommonRegistry::GetAppDescForScheme(aScheme, _retval);
    return _retval.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK;
  #else
    return NS_ERROR_NOT_AVAILABLE;
-@@ -1248,7 +1248,7 @@ nsOSHelperAppService::GetFromExtension(c
+ #endif
+ }
+ 
+ nsresult nsOSHelperAppService::GetFileTokenForPath(
+     const char16_t* platformAppPath, nsIFile** aFile) {
+@@ -1151,17 +1151,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 =
--      nsGNOMERegistry::GetFromExtension(aFileExt);
-+      nsCommonRegistry::GetFromExtension(aFileExt);
+-        nsGNOMERegistry::GetFromExtension(aFileExt);
++        nsCommonRegistry::GetFromExtension(aFileExt);
      if (gnomeInfo) {
        LOG(("Got MIMEInfo from GNOME registry\n"));
        return gnomeInfo.forget();
-@@ -1369,7 +1369,7 @@ nsOSHelperAppService::GetFromType(const
+     }
+ #endif
+ 
+     rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType,
+                                   minorType, mime_types_description, false);
+@@ -1263,17 +1263,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()) {
 -    RefPtr<nsMIMEInfoBase> gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType);
 +    RefPtr<nsMIMEInfoBase> gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType);
      if (gnomeInfo) {
-       LOG(("Got MIMEInfo from GNOME registry without extensions; setting them "
-            "to %s\n", NS_LossyConvertUTF16toASCII(extensions).get()));
-Index: firefox-60.2.0/widget/gtk/moz.build
-===================================================================
---- firefox-60.2.0.orig/widget/gtk/moz.build	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/widget/gtk/moz.build	2018-09-05 21:49:31.502872845 +0200
-@@ -126,6 +126,7 @@ LOCAL_INCLUDES += [
+       LOG(
+           ("Got MIMEInfo from GNOME registry without extensions; setting them "
+            "to %s\n",
+            NS_LossyConvertUTF16toASCII(extensions).get()));
+ 
+       NS_ASSERTION(!gnomeInfo->HasExtensions(), "How'd that happen?");
+       gnomeInfo->SetFileExtensions(NS_ConvertUTF16toUTF8(extensions));
+diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
+--- a/widget/gtk/moz.build
++++ b/widget/gtk/moz.build
+@@ -121,16 +121,17 @@ else:
+ include('/ipc/chromium/chromium-config.mozbuild')
+ 
+ FINAL_LIBRARY = 'xul'
+ 
+ LOCAL_INCLUDES += [
      '/layout/generic',
      '/layout/xul',
      '/other-licenses/atk-1.0',
@@ -1563,11 +1818,20 @@
      '/widget',
      '/widget/headless',
  ]
-Index: firefox-60.2.0/widget/gtk/nsFilePicker.cpp
-===================================================================
---- firefox-60.2.0.orig/widget/gtk/nsFilePicker.cpp	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/widget/gtk/nsFilePicker.cpp	2018-09-05 21:49:31.502872845 +0200
-@@ -9,6 +9,7 @@
+ 
+ if CONFIG['MOZ_X11']:
+     LOCAL_INCLUDES += [
+         '/widget/x11',
+     ]
+diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
+--- a/widget/gtk/nsFilePicker.cpp
++++ b/widget/gtk/nsFilePicker.cpp
+@@ -4,32 +4,34 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
+ #include "mozilla/Types.h"
+ #include <sys/types.h>
+ #include <sys/stat.h>
  #include <unistd.h>
  
  #include <gtk/gtk.h>
@@ -1575,7 +1839,16 @@
  
  #include "nsGtkUtils.h"
  #include "nsIFileURL.h"
-@@ -25,6 +26,7 @@
+ #include "nsIURI.h"
+ #include "nsIWidget.h"
+ #include "nsIFile.h"
+ #include "nsIStringBundle.h"
+ 
+ #include "nsArrayEnumerator.h"
+ #include "nsMemory.h"
+ #include "nsEnumeratorUtils.h"
+ #include "nsNetUtil.h"
+ #include "nsReadableUtils.h"
  #include "mozcontainer.h"
  
  #include "nsFilePicker.h"
@@ -1583,8 +1856,18 @@
  
  using namespace mozilla;
  
-@@ -251,7 +253,9 @@ nsFilePicker::AppendFilter(const nsAStri
- {
+ #define MAX_PREVIEW_SIZE 180
+ // bug 1184009
+ #define MAX_PREVIEW_SOURCE_SIZE 4096
+ 
+ nsIFile *nsFilePicker::mPrevDisplayDirectory = nullptr;
+@@ -225,17 +227,19 @@ 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....
 -    return NS_OK;
@@ -1594,9 +1877,19 @@
    }
  
    nsAutoCString filter, name;
-@@ -376,6 +380,29 @@ nsFilePicker::Open(nsIFilePickerShownCal
-   if (mRunning)
-     return NS_ERROR_NOT_AVAILABLE;
+   CopyUTF16toUTF8(aFilter, filter);
+   CopyUTF16toUTF8(aTitle, name);
+ 
+   mFilters.AppendElement(filter);
+   mFilterNames.AppendElement(name);
+@@ -335,16 +339,39 @@ nsresult nsFilePicker::Show(int16_t *aRe
+   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;
  
 +  // KDE file picker is not handled via callback
 +  if( nsKDEUtils::kdeSupport()) {
@@ -1624,7 +1917,17 @@
    nsCString title;
    title.Adopt(ToNewUTF8String(mTitle));
  
-@@ -613,3 +640,228 @@ nsFilePicker::Done(GtkWidget* file_choos
+   GtkWindow *parent_widget =
+       GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
+ 
+   GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
+ 
+@@ -572,8 +599,233 @@ void nsFilePicker::Done(GtkWidget *file_
+   if (mCallback) {
+     mCallback->Done(result);
+     mCallback = nullptr;
+   } else {
+     mResult = result;
    }
    NS_RELEASE_THIS();
  }
@@ -1853,13 +2156,17 @@
 +    return NS_OK;
 +    }
 +
-Index: firefox-60.2.0/widget/gtk/nsFilePicker.h
-===================================================================
---- firefox-60.2.0.orig/widget/gtk/nsFilePicker.h	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/widget/gtk/nsFilePicker.h	2018-09-05 21:49:31.502872845 +0200
-@@ -74,6 +74,12 @@ protected:
- private:
-   static nsIFile *mPrevDisplayDirectory;
+diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
+--- a/widget/gtk/nsFilePicker.h
++++ b/widget/gtk/nsFilePicker.h
+@@ -67,14 +67,20 @@ class nsFilePicker : public nsBaseFilePi
+   nsString mDefaultExtension;
+ 
+   nsTArray<nsCString> mFilters;
+   nsTArray<nsCString> mFilterNames;
+ 
+  private:
+   static nsIFile* mPrevDisplayDirectory;
  
 +  bool kdeRunning();
 +  bool getKdeRunning();
@@ -1868,13 +2175,20 @@
 +  nsCString kdeMakeFilter( int index );
 +
  #ifdef MOZ_WIDGET_GTK
-   GtkFileChooserWidget *mFileChooserDelegate;
+   GtkFileChooserWidget* mFileChooserDelegate;
+ #endif
+ };
+ 
  #endif
-Index: firefox-60.2.0/xpcom/components/ManifestParser.cpp
-===================================================================
---- firefox-60.2.0.orig/xpcom/components/ManifestParser.cpp	2018-09-05 21:49:23.106829422 +0200
-+++ firefox-60.2.0/xpcom/components/ManifestParser.cpp	2018-09-05 21:49:31.502872845 +0200
-@@ -38,6 +38,7 @@
+diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
+--- a/xpcom/components/ManifestParser.cpp
++++ b/xpcom/components/ManifestParser.cpp
+@@ -33,16 +33,17 @@
+ #include "nsTextFormatter.h"
+ #include "nsVersionComparator.h"
+ #include "nsXPCOMCIDInternal.h"
+ 
+ #include "nsIConsoleService.h"
  #include "nsIScriptError.h"
  #include "nsIXULAppInfo.h"
  #include "nsIXULRuntime.h"
@@ -1882,7 +2196,17 @@
  
  using namespace mozilla;
  
-@@ -449,6 +450,7 @@ ParseManifest(NSLocationType aType, File
+ struct ManifestDirective {
+   const char* directive;
+   int argc;
+ 
+   // Binary components are only allowed for APP locations.
+@@ -418,16 +419,17 @@ void ParseManifest(NSLocationType aType,
+   NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled");
+   NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired");
+   NS_NAMED_LITERAL_STRING(kApplication, "application");
+   NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
+   NS_NAMED_LITERAL_STRING(kGeckoVersion, "platformversion");
    NS_NAMED_LITERAL_STRING(kOs, "os");
    NS_NAMED_LITERAL_STRING(kOsVersion, "osversion");
    NS_NAMED_LITERAL_STRING(kABI, "abi");
@@ -1890,44 +2214,62 @@
    NS_NAMED_LITERAL_STRING(kProcess, "process");
  #if defined(MOZ_WIDGET_ANDROID)
    NS_NAMED_LITERAL_STRING(kTablet, "tablet");
-@@ -504,6 +506,7 @@ ParseManifest(NSLocationType aType, File
+ #endif
+ 
+   NS_NAMED_LITERAL_STRING(kMain, "main");
+   NS_NAMED_LITERAL_STRING(kContent, "content");
+ 
+@@ -473,39 +475,44 @@ void ParseManifest(NSLocationType aType,
+         CopyUTF8toUTF16(s, abi);
+         abi.Insert(char16_t('_'), 0);
+         abi.Insert(osTarget, 0);
+       }
+     }
    }
  
    nsAutoString osVersion;
 +  nsAutoString desktop;
  #if defined(XP_WIN)
  #pragma warning(push)
- #pragma warning(disable:4996) // VC12+ deprecates GetVersionEx
-@@ -513,6 +516,7 @@ ParseManifest(NSLocationType aType, File
-                               info.dwMajorVersion,
+ #pragma warning(disable : 4996)  // VC12+ deprecates GetVersionEx
+   OSVERSIONINFO info = {sizeof(OSVERSIONINFO)};
+   if (GetVersionEx(&info)) {
+     nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", info.dwMajorVersion,
                                info.dwMinorVersion);
    }
 +  desktop = NS_LITERAL_STRING("win");
  #pragma warning(pop)
  #elif defined(MOZ_WIDGET_COCOA)
    SInt32 majorVersion = nsCocoaFeatures::OSXVersionMajor();
-@@ -520,10 +524,12 @@ ParseManifest(NSLocationType aType, File
-   nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
-                             majorVersion,
-                             minorVersion);
+   SInt32 minorVersion = nsCocoaFeatures::OSXVersionMinor();
+   nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", majorVersion, minorVersion);
 +  desktop = NS_LITERAL_STRING("macosx");
  #elif defined(MOZ_WIDGET_GTK)
-   nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
-                             gtk_major_version,
+   nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", gtk_major_version,
                              gtk_minor_version);
 +  desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome");
  #elif defined(MOZ_WIDGET_ANDROID)
    bool isTablet = false;
    if (mozilla::AndroidBridge::Bridge()) {
-@@ -532,6 +538,7 @@ ParseManifest(NSLocationType aType, File
-                                                            osVersion);
+     mozilla::AndroidBridge::Bridge()->GetStaticStringField(
+         "android/os/Build$VERSION", "RELEASE", osVersion);
      isTablet = java::GeckoAppShell::IsTablet();
    }
 +  desktop = NS_LITERAL_STRING("android");
  #endif
  
    if (XRE_IsContentProcess()) {
-@@ -643,6 +650,7 @@ ParseManifest(NSLocationType aType, File
+     process = kContent;
+   } else {
+     process = kMain;
+   }
+ 
+@@ -608,25 +615,27 @@ void ParseManifest(NSLocationType aType,
+     TriState stOsVersion = eUnspecified;
+     TriState stOs = eUnspecified;
+     TriState stABI = eUnspecified;
+     TriState stProcess = eUnspecified;
+ #if defined(MOZ_WIDGET_ANDROID)
      TriState stTablet = eUnspecified;
  #endif
      int flags = 0;
@@ -1935,7 +2277,9 @@
  
      while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) &&
             ok) {
-@@ -652,6 +660,7 @@ ParseManifest(NSLocationType aType, File
+       ToLowerCase(token);
+       NS_ConvertASCIItoUTF16 wtoken(token);
+ 
        if (CheckStringFlag(kApplication, wtoken, appID, stApp) ||
            CheckOsFlag(kOs, wtoken, osTarget, stOs) ||
            CheckStringFlag(kABI, wtoken, abi, stABI) ||
@@ -1943,19 +2287,39 @@
            CheckStringFlag(kProcess, wtoken, process, stProcess) ||
            CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) ||
            CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) ||
-@@ -706,6 +715,7 @@ ParseManifest(NSLocationType aType, File
-         stGeckoVersion == eBad ||
-         stOs == eBad ||
-         stOsVersion == eBad ||
-+        stDesktop == eBad ||
+           CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion,
+                            stGeckoVersion)) {
+         continue;
+       }
+ 
+@@ -663,17 +672,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 ||
++        stGeckoVersion == eBad || stOs == eBad || stOsVersion == eBad || stDesktop == eBad ||
  #ifdef MOZ_WIDGET_ANDROID
          stTablet == eBad ||
  #endif
-Index: firefox-60.2.0/xpcom/components/moz.build
-===================================================================
---- firefox-60.2.0.orig/xpcom/components/moz.build	2018-09-05 21:49:23.110829442 +0200
-+++ firefox-60.2.0/xpcom/components/moz.build	2018-09-05 21:49:31.502872845 +0200
-@@ -49,6 +49,7 @@ LOCAL_INCLUDES += [
+         stABI == eBad || stProcess == eBad) {
+       continue;
+     }
+ 
+     if (directive->regfunc) {
+diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
+--- a/xpcom/components/moz.build
++++ b/xpcom/components/moz.build
+@@ -44,12 +44,13 @@ FINAL_LIBRARY = 'xul'
+ LOCAL_INCLUDES += [
+     '!..',
+     '../base',
+     '../build',
+     '../ds',
      '../reflect/xptinfo',
      '/chrome',
      '/modules/libjar',
@@ -1963,11 +2327,16 @@
  ]
  
  if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
-Index: firefox-60.2.0/xpcom/io/nsLocalFileUnix.cpp
-===================================================================
---- firefox-60.2.0.orig/xpcom/io/nsLocalFileUnix.cpp	2018-09-05 21:49:23.110829442 +0200
-+++ firefox-60.2.0/xpcom/io/nsLocalFileUnix.cpp	2018-09-05 21:56:47.649117623 +0200
-@@ -52,6 +52,7 @@
+     CXXFLAGS += CONFIG['TK_CFLAGS']
+diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
+--- a/xpcom/io/nsLocalFileUnix.cpp
++++ b/xpcom/io/nsLocalFileUnix.cpp
+@@ -47,16 +47,17 @@
+ #include "prproces.h"
+ #include "nsIDirectoryEnumerator.h"
+ #include "nsISimpleEnumerator.h"
+ #include "private/pprio.h"
+ #include "prlink.h"
  
  #ifdef MOZ_WIDGET_GTK
  #include "nsIGIOService.h"
@@ -1975,7 +2344,17 @@
  #endif
  
  #ifdef MOZ_WIDGET_COCOA
-@@ -2010,18 +2011,16 @@ nsLocalFile::Reveal()
+ #include <Carbon/Carbon.h>
+ #include "CocoaFileUtils.h"
+ #include "prmem.h"
+ #include "plbase64.h"
+ 
+@@ -1901,62 +1902,77 @@ nsLocalFile::SetPersistentDescriptor(con
+ 
+ NS_IMETHODIMP
+ nsLocalFile::Reveal() {
+   if (!FilePreferences::IsAllowedPath(mPath)) {
+     return NS_ERROR_FILE_ACCESS_DENIED;
    }
  
  #ifdef MOZ_WIDGET_GTK
@@ -1997,7 +2376,13 @@
    }
    if (NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) {
      return NS_OK;
-@@ -2035,7 +2034,7 @@ nsLocalFile::Reveal()
+   }
+   nsCOMPtr<nsIFile> parentDir;
+   nsAutoCString dirPath;
+   if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) {
+     return NS_ERROR_FAILURE;
+   }
+   if (NS_FAILED(parentDir->GetNativePath(dirPath))) {
      return NS_ERROR_FAILURE;
    }
  
@@ -2006,7 +2391,11 @@
  #elif defined(MOZ_WIDGET_COCOA)
    CFURLRef url;
    if (NS_SUCCEEDED(GetCFURL(&url))) {
-@@ -2047,6 +2046,17 @@ nsLocalFile::Reveal()
+     nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
+     ::CFRelease(url);
+     return rv;
+   }
+   return NS_ERROR_FAILURE;
  #else
    return NS_ERROR_FAILURE;
  #endif
@@ -2024,7 +2413,9 @@
  }
  
  NS_IMETHODIMP
-@@ -2057,6 +2067,12 @@ nsLocalFile::Launch()
+ nsLocalFile::Launch() {
+   if (!FilePreferences::IsAllowedPath(mPath)) {
+     return NS_ERROR_FILE_ACCESS_DENIED;
    }
  
  #ifdef MOZ_WIDGET_GTK
@@ -2037,3 +2428,8 @@
    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
    if (!giovfs) {
      return NS_ERROR_FAILURE;
+   }
+ 
+   return giovfs->ShowURIForInput(mPath);
+ #elif defined(MOZ_WIDGET_ANDROID)
+   // Try to get a mimetype, if this fails just use the file uri alone
--- a/mozilla-no-stdcxx-check.patch	Mon Dec 10 22:33:01 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-# HG changeset patch
-# User Wolfgang Rosenauer <wr@rosenauer.org>
-# Parent  f62746698c37af9593338fe75fbff6b319cd370c
-
-diff --git a/config/config.mk b/config/config.mk
---- a/config/config.mk
-+++ b/config/config.mk
-@@ -471,17 +471,16 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),android)
- # of the linker command line), if libmozglue.so ends up after libc.so, all
- # hell breaks loose, so better safe than sorry, and check it's actually the
- # case.
- CHECK_MOZGLUE_ORDER = @$(TOOLCHAIN_PREFIX)readelf -d $(1) | grep NEEDED | awk '{ libs[$$NF] = ++n } END { if (libs["[libmozglue.so]"] && libs["[libc.so]"] < libs["[libmozglue.so]"]) { print "libmozglue.so must be linked before libc.so"; exit 1 } }'
- endif
- 
- define CHECK_BINARY
- $(call CHECK_GLIBC,$(1))
--$(call CHECK_STDCXX,$(1))
- $(call CHECK_TEXTREL,$(1))
- $(call LOCAL_CHECKS,$(1))
- $(call CHECK_MOZGLUE_ORDER,$(1))
- endef
- 
- # autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
- # this file
- OBJ_SUFFIX := $(_OBJ_SUFFIX)
--- a/mozilla-nongnome-proxies.patch	Mon Dec 10 22:33:01 2018 +0100
+++ b/mozilla-nongnome-proxies.patch	Tue Mar 19 09:49:20 2019 +0100
@@ -9,19 +9,20 @@
 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
-@@ -54,23 +54,27 @@ nsUnixSystemProxySettings::GetMainThread
-   // dbus prevents us from being threadsafe, but this routine should not block anyhow
+@@ -55,24 +55,27 @@ NS_IMETHODIMP
+ nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) {
+   // dbus prevents us from being threadsafe, but this routine should not block
+   // anyhow
    *aMainThreadOnly = true;
    return NS_OK;
  }
  
- nsresult
- nsUnixSystemProxySettings::Init()
- {
+ nsresult nsUnixSystemProxySettings::Init() {
 -  mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
 -  if (mGSettings) {
--    mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"),
--                                       getter_AddRefs(mProxySettings));
+-    mGSettings->GetCollectionForSchema(
+-        NS_LITERAL_CSTRING("org.gnome.system.proxy"),
+-        getter_AddRefs(mProxySettings));
 -  }
 -  if (!mProxySettings) {
 -    mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
@@ -41,6 +42,6 @@
    return NS_OK;
  }
  
- bool
- nsUnixSystemProxySettings::IsProxyMode(const char* aMode)
- {
+ bool nsUnixSystemProxySettings::IsProxyMode(const char* aMode) {
+   nsAutoCString mode;
+   return NS_SUCCEEDED(mGConf->GetString(
--- a/mozilla-ntlm-full-path.patch	Mon Dec 10 22:33:01 2018 +0100
+++ b/mozilla-ntlm-full-path.patch	Tue Mar 19 09:49:20 2019 +0100
@@ -1,28 +1,28 @@
 # HG changeset patch
 # User Petr Cerny <pcerny@novell.com>
 # Parent 7308e4a7c1f769f4bbbc90870b849cadd99495a6
-# Parent  46dd9332e67440fb779e99a694a2bf0edf5c203e
+# Parent  eb453c9206ce11b34633ece0c68e79d3e7124e64
 Bug 634334 - call to the ntlm_auth helper fails
 
 diff --git a/extensions/auth/nsAuthSambaNTLM.cpp b/extensions/auth/nsAuthSambaNTLM.cpp
 --- a/extensions/auth/nsAuthSambaNTLM.cpp
 +++ b/extensions/auth/nsAuthSambaNTLM.cpp
-@@ -170,17 +170,17 @@ static uint8_t* ExtractMessage(const nsA
- nsresult
- nsAuthSambaNTLM::SpawnNTLMAuthHelper()
- {
-     const char* username = PR_GetEnv("USER");
-     if (!username)
-         return NS_ERROR_FAILURE;
+@@ -156,17 +156,17 @@ static uint8_t* ExtractMessage(const nsA
+   *aLen = (length / 4) * 3 - numEquals;
+   return reinterpret_cast<uint8_t*>(PL_Base64Decode(s, length, nullptr));
+ }
+ 
+ nsresult nsAuthSambaNTLM::SpawnNTLMAuthHelper() {
+   const char* username = PR_GetEnv("USER");
+   if (!username) return NS_ERROR_FAILURE;
  
-     const char* const args[] = {
--        "ntlm_auth",
-+        "/usr/bin/ntlm_auth",
-         "--helper-protocol", "ntlmssp-client-1",
-         "--use-cached-creds",
-         "--username", username,
-         nullptr
-     };
+-  const char* const args[] = {"ntlm_auth",
++  const char* const args[] = {"/usr/bin/ntlm_auth",
+                               "--helper-protocol",
+                               "ntlmssp-client-1",
+                               "--use-cached-creds",
+                               "--username",
+                               username,
+                               nullptr};
  
-     bool isOK = SpawnIOChild(const_cast<char* const*>(args), &mChildPID, &mFromChildFD, &mToChildFD);
-     if (!isOK)
+   bool isOK = SpawnIOChild(const_cast<char* const*>(args), &mChildPID,
--- a/series	Mon Dec 10 22:33:01 2018 +0100
+++ b/series	Tue Mar 19 09:49:20 2019 +0100
@@ -3,7 +3,6 @@
 mozilla-kde.patch
 mozilla-ntlm-full-path.patch
 mozilla-openaes-decl.patch
-mozilla-no-stdcxx-check.patch
 mozilla-reduce-files-per-UnifiedBindings.patch
 mozilla-aarch64-startup-crash.patch
 mozilla-bmo256180.patch
@@ -12,6 +11,7 @@
 mozilla-bmo1464766.patch
 mozilla-bmo1375074.patch
 mozilla-bmo1436242.patch
+mozilla-bmo1463035.patch
 
 # Firefox patches
 firefox-kde.patch