remove obsolete patches
authorWolfgang Rosenauer <wr@rosenauer.org>
Fri, 09 Feb 2018 16:30:49 +0100
changeset 1032 8220ea23b47d
parent 1031 4b419fce88dc
child 1033 51bfdd19b9e9
remove obsolete patches updated patches reworked create-tar.sh to work with in-tree information
MozillaFirefox/MozillaFirefox.changes
MozillaFirefox/MozillaFirefox.spec
MozillaFirefox/create-tar.sh
MozillaFirefox/firefox-no-default-ualocale.patch
MozillaFirefox/l10n_changesets.txt
MozillaFirefox/mozilla-alsa-sandbox.patch
MozillaFirefox/mozilla-enable-csd.patch
firefox-branded-icons.patch
firefox-no-default-ualocale.patch
mozilla-alsa-sandbox.patch
mozilla-enable-csd.patch
mozilla-idldir.patch
mozilla-kde.patch
series
--- a/MozillaFirefox/MozillaFirefox.changes	Fri Feb 09 13:28:07 2018 +0100
+++ b/MozillaFirefox/MozillaFirefox.changes	Fri Feb 09 16:30:49 2018 +0100
@@ -4,6 +4,12 @@
 - update to Firefox 59.0b8
 - requires NSPR 4.18 and NSS 3.35
 - requires rust >= 1.22.1
+- removed obsolete patches:
+  mozilla-alsa-sandbox.patch
+  mozilla-enable-csd.patch
+  firefox-no-default-ualocale.patch
+- removed l10n_changesets.txt since same information is now in
+  Firefox source tree (updated create-tar.sh now requires jq)
 
 -------------------------------------------------------------------
 Fri Feb  9 12:06:31 UTC 2018 - wr@rosenauer.org
--- a/MozillaFirefox/MozillaFirefox.spec	Fri Feb 09 13:28:07 2018 +0100
+++ b/MozillaFirefox/MozillaFirefox.spec	Fri Feb 09 16:30:49 2018 +0100
@@ -136,7 +136,6 @@
 Source14:       create-tar.sh
 Source15:       firefox-appdata.xml
 Source16:       MozillaFirefox.changes
-Source17:       l10n_changesets.txt
 # Set up API keys, see http://www.chromium.org/developers/how-tos/api-keys
 # Note: these are for the openSUSE Firefox builds ONLY. For your own distribution,
 # please get your own set of keys.
@@ -150,13 +149,10 @@
 Patch5:         mozilla-no-stdcxx-check.patch
 Patch6:         mozilla-reduce-files-per-UnifiedBindings.patch
 Patch7:         mozilla-aarch64-startup-crash.patch
-Patch8:         mozilla-enable-csd.patch
-Patch9:         mozilla-bmo256180.patch
-Patch10:        mozilla-alsa-sandbox.patch
+Patch8:         mozilla-bmo256180.patch
 # Firefox/browser
 Patch101:       firefox-kde.patch
-Patch102:       firefox-no-default-ualocale.patch
-Patch103:       firefox-branded-icons.patch
+Patch102:       firefox-branded-icons.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Requires(post):   coreutils shared-mime-info desktop-file-utils
@@ -264,12 +260,9 @@
 %endif
 %patch7 -p1
 %patch8 -p1
-%patch9 -p1
-%patch10 -p1
 # Firefox
 %patch101 -p1
 %patch102 -p1
-%patch103 -p1
 
 %build
 # no need to add build time to binaries
--- a/MozillaFirefox/create-tar.sh	Fri Feb 09 13:28:07 2018 +0100
+++ b/MozillaFirefox/create-tar.sh	Fri Feb 09 16:30:49 2018 +0100
@@ -10,6 +10,11 @@
 RELEASE_TAG="73ef186ad51ac2c4fc27b1f149fcc94355fe7dc6"
 VERSION="58.99"
 
+# check required tools
+test -x /usr/bin/hg || ( echo "hg missing: execute zypper in mercurial"; exit 5 )
+test -x /usr/bin/jq || ( echo "jq missing: execute zypper in jq"; exit 5 )
+
+
 # mozilla
 if [ -d mozilla ]; then
   pushd mozilla
@@ -54,19 +59,19 @@
 # l10n
 echo "fetching locales..."
 test ! -d l10n && mkdir l10n
-for locale in $(awk '{ print $1; }' l10n_changesets.txt); do
-  case $locale in
-    ja-JP-mac|en-US)
-      ;;
-    *)
-      echo "reading changeset information for $locale"
-      _changeset=$(grep ^$locale l10n_changesets.txt | awk '{ print $2; }')
-      echo "fetching $locale changeset $_changeset ..."
-      hg clone http://hg.mozilla.org/l10n-central/$locale l10n/$locale
-      [ "$RELEASE_TAG" == "default" ] || hg -R l10n/$locale up -C -r $_changeset
-      ;;
-  esac
-done
+jq -r 'to_entries[]| "\(.key) \(.value|.revision)"' mozilla/browser/locales/l10n-changesets.json | \
+  while read locale changeset ; do
+    case $locale in
+      ja-JP-mac|en-US)
+        ;;
+      *)
+        echo "reading changeset information for $locale"
+        echo "fetching $locale changeset $changeset ..."
+        hg clone http://hg.mozilla.org/l10n-central/$locale l10n/$locale
+        [ "$RELEASE_TAG" == "default" ] || hg -R l10n/$locale up -C -r $changeset
+        ;;
+    esac
+  done
 echo "creating l10n archive..."
 tar $compression -cf l10n-$VERSION.tar.xz --exclude=.hgtags --exclude=.hgignore --exclude=.hg l10n
 
--- a/MozillaFirefox/firefox-no-default-ualocale.patch	Fri Feb 09 13:28:07 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../firefox-no-default-ualocale.patch
\ No newline at end of file
--- a/MozillaFirefox/l10n_changesets.txt	Fri Feb 09 13:28:07 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-ach 51053376f3b4
-af 9699e648d04f
-an 35bf2af54c6e
-ar 11e28461eedd
-as f48681f3cb1c
-ast a0365b2d2204
-az c9f8178b760e
-be 6a81fe13730e
-bg f5f7827ddaf6
-bn-BD 40173c2773dc
-bn-IN 8a4d7efa4656
-br 87dd84f3fb15
-bs f9194e1b9d1f
-ca 2393377daf04
-cak 358337cd8e62
-cs b2f2d66e474f
-cy cd528119b1f0
-da 3d4f38f6c602
-de c4580757245b
-dsb 6cae073a841f
-el 7c198d3d5d8c
-en-GB 108b5a928fb5
-en-ZA 5b50bebf4e4f
-eo eb148ada0d56
-es-AR 08d927e7ad92
-es-CL 02584a2d25b7
-es-ES 1c9d3c3c689d
-es-MX 6435282dbc75
-et e29f6a05d5a8
-eu 756e60b234ec
-fa 8aee74bd73fe
-ff b529c4fc084b
-fi 124ad6d2caeb
-fr 87ec33d89386
-fy-NL 3705ebdd28f5
-ga-IE 2453123d83ab
-gd da7de9b6e635
-gl 99003c9cd063
-gn 54547111d875
-gu-IN 88180147b7f5
-he 9837e2cc4a95
-hi-IN e1dddb32c7d0
-hr 1699e5d11dfc
-hsb b779311b0bd0
-hu 5f446a971f03
-hy-AM 024da8b34b46
-id 0f0141ed9bb6
-is 4b3c58c9d645
-it 6e2c7978b0e7
-ja f30c0c2f2bc4
-ja-JP-mac 4230da7b0695
-ka 6650158784f6
-kab 6b3c6e707013
-kk 1e85339bcb5c
-km d934d1e2fbba
-kn 9d356f38d208
-ko 6370c2a0f030
-lij 0ab26fda46bc
-lt 450e1219d46f
-lv 78a846f93b16
-mai 53cf7cd14176
-mk 3d22bc5b8e99
-ml 128c7b806403
-mr 074d705e44b7
-ms 7fa602755a3b
-my eee9ab816d7c
-nb-NO 963968719128
-ne-NP c318f683bdb7
-nl fca30e75c8a2
-nn-NO 484b14dee153
-or 9420e75f84ba
-pa-IN 5634ac6e7d9b
-pl 45fa8ed87819
-pt-BR 38d2f920e7b1
-pt-PT 60446c901737
-rm cf0859e63177
-ro 7fea5671214f
-ru 67b070efcbd9
-si 5b5533ef2e97
-sk 4c17a502b748
-sl 8c446da2c7c5
-son 914d74ec145e
-sq 704b52416e5e
-sr cbf4a5eafb4d
-sv-SE 2e8d40795c69
-ta 26d7cbe37e4a
-te 9338813fedc1
-th aa91b43781fe
-tr a392fcf83ab9
-uk 214311bf7877
-ur 60247a51a921
-uz 51175e255277
-vi 2731355cccc7
-xh a756d272d1fe
-zh-CN 9ab59b4c446a
-zh-TW a56ff00fa7b0
-
--- a/MozillaFirefox/mozilla-alsa-sandbox.patch	Fri Feb 09 13:28:07 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../mozilla-alsa-sandbox.patch
\ No newline at end of file
--- a/MozillaFirefox/mozilla-enable-csd.patch	Fri Feb 09 13:28:07 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../mozilla-enable-csd.patch
\ No newline at end of file
--- a/firefox-branded-icons.patch	Fri Feb 09 13:28:07 2018 +0100
+++ b/firefox-branded-icons.patch	Fri Feb 09 16:30:49 2018 +0100
@@ -1,39 +1,30 @@
 # HG changeset patch
 # Parent e0751ad74e835e80041a61ea00c2a63bf6fbe2de
-# Parent  75308bbaaf73d672c88cb283591d4aefc7db9804
+# Parent  38e46d7f98d3e392de95d83660ecd147b30dc9aa
 
 diff --git a/browser/branding/branding-common.mozbuild b/browser/branding/branding-common.mozbuild
 --- a/browser/branding/branding-common.mozbuild
 +++ b/browser/branding/branding-common.mozbuild
-@@ -38,18 +38,24 @@ def FirefoxBranding():
-             'disk.icns',
-             'document.icns',
-             'dsstore',
-             'firefox.icns',
+@@ -17,12 +17,15 @@ def FirefoxBranding():
+         FINAL_TARGET_FILES.VisualElements += [
+             'VisualElements_150.png',
+             'VisualElements_70.png',
          ]
      elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
-         BRANDING_FILES += [
+         FINAL_TARGET_FILES.chrome.icons.default += [
+             'default128.png',
              'default16.png',
-+            'default22.png',
-+            'default24.png',
-+            'default256.png',
++	    'default22.png',
++	    'default24.png',
++	    'default256.png',
              'default32.png',
              'default48.png',
-             'mozicon128.png',
-         ]
-         FINAL_TARGET_FILES.icons += ['mozicon128.png']
-         FINAL_TARGET_FILES.chrome.icons.default += [
-             'default16.png',
-+            'default22.png',
-+            'default24.png',
-+            'default256.png',
-             'default32.png',
-             'default48.png',
+             'default64.png',
          ]
 diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
 --- a/browser/installer/package-manifest.in
 +++ b/browser/installer/package-manifest.in
-@@ -618,18 +618,21 @@
+@@ -601,20 +601,23 @@
  @RESPATH@/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.manifest
  @RESPATH@/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf
  @RESPATH@/chrome/toolkit@JAREXT@
@@ -46,6 +37,8 @@
 +@RESPATH@/browser/chrome/icons/default/default24.png
  @RESPATH@/browser/chrome/icons/default/default32.png
  @RESPATH@/browser/chrome/icons/default/default48.png
+ @RESPATH@/browser/chrome/icons/default/default64.png
+ @RESPATH@/browser/chrome/icons/default/default128.png
 +@RESPATH@/browser/chrome/icons/default/default256.png
  #endif
  @RESPATH@/browser/features/*
--- a/firefox-no-default-ualocale.patch	Fri Feb 09 13:28:07 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-# HG changeset patch
-# User Wolfgang Rosenauer <wr@rosenauer.org>
-# Parent 099312626f5f7c9cb5573a61d0230574ee12a660
-# Parent  3d1dbfbdfa41b433352fadf3efe4a21cb45a468f
-Do not overwrite the locale dynamic pref from xulrunner's all.js with a wrong default value
-
-diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
---- a/browser/app/profile/firefox.js
-+++ b/browser/app/profile/firefox.js
-@@ -219,17 +219,17 @@ pref("browser.uitour.requireSecure", tru
- pref("browser.uitour.themeOrigin", "https://addons.mozilla.org/%LOCALE%/firefox/themes/");
- pref("browser.uitour.url", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/tour/");
- // How long to show a Hearbeat survey (two hours, in seconds)
- pref("browser.uitour.surveyDuration", 7200);
- 
- pref("keyword.enabled", true);
- pref("browser.fixup.domainwhitelist.localhost", true);
- 
--pref("general.useragent.locale", "@AB_CD@");
-+pref("general.useragent.locale", "chrome://global/locale/intl.properties");
- pref("general.skins.selectedSkin", "classic/1.0");
- 
- pref("general.smoothScroll", true);
- #ifdef UNIX_BUT_NOT_MAC
- pref("general.autoScroll", false);
- #else
- pref("general.autoScroll", true);
- #endif
--- a/mozilla-alsa-sandbox.patch	Fri Feb 09 13:28:07 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
---- mozilla/security/sandbox/linux/moz.build	2018-02-06 07:58:27.127145777 +0100
-+++ mozilla/security/sandbox/linux/moz.build	2018-02-06 08:01:22.213706297 +0100
-@@ -77,6 +77,9 @@
-         'SandboxOpenedFiles.cpp',
-     ]
- 
-+if CONFIG['MOZ_ALSA']:
-+    DEFINES['MOZ_ALSA'] = True
-+
- # This copy of SafeSPrintf doesn't need to avoid the Chromium logging
- # dependency like the one in libxul does, but this way the behavior is
- # consistent.  See also the comment in SandboxLogging.h.
--- a/mozilla-enable-csd.patch	Fri Feb 09 13:28:07 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1312 +0,0 @@
-diff -up firefox-58.0/browser/base/moz.build.1399611 firefox-58.0/browser/base/moz.build
---- firefox-58.0/browser/base/moz.build.1399611	2017-11-02 17:16:30.000000000 +0100
-+++ firefox-58.0/browser/base/moz.build	2018-01-24 10:57:03.717031953 +0100
-@@ -57,7 +57,7 @@ DEFINES['APP_LICENSE_BLOCK'] = '%s/conte
- if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3', 'cocoa'):
-     DEFINES['CONTEXT_COPY_IMAGE_CONTENTS'] = 1
- 
--if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):
-+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa', 'gtk3'):
-     DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1
- 
- if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3'):
-diff -up firefox-58.0/browser/themes/linux/browser.css.1399611 firefox-58.0/browser/themes/linux/browser.css
---- firefox-58.0/browser/themes/linux/browser.css.1399611	2018-01-11 21:16:54.000000000 +0100
-+++ firefox-58.0/browser/themes/linux/browser.css	2018-01-24 10:57:03.718031950 +0100
-@@ -717,7 +717,7 @@ html|span.ac-emphasize-text-url {
-   :root[tabsintitlebar] > #titlebar:-moz-lwtheme {
-     visibility: hidden;
-   }
--  :root[tabsintitlebar] > #titlebar-content:-moz-lwtheme {
-+  :root[tabsintitlebar] #titlebar-content:-moz-lwtheme {
-     visibility: visible;
-   }
- 
-diff -up firefox-58.0/layout/style/nsMediaFeatures.cpp.1399611 firefox-58.0/layout/style/nsMediaFeatures.cpp
---- firefox-58.0/layout/style/nsMediaFeatures.cpp.1399611	2018-01-11 21:17:01.000000000 +0100
-+++ firefox-58.0/layout/style/nsMediaFeatures.cpp	2018-01-24 10:57:03.718031950 +0100
-@@ -831,6 +831,42 @@ nsMediaFeatures::features[] = {
-     GetSystemMetric
-   },
- 
-+  {
-+    &nsGkAtoms::_moz_gtk_csd_available,
-+    nsMediaFeature::eMinMaxNotAllowed,
-+    nsMediaFeature::eBoolInteger,
-+    nsMediaFeature::eNoRequirements,
-+    { &nsGkAtoms::gtk_csd_available },
-+    GetSystemMetric
-+  },
-+
-+  {
-+    &nsGkAtoms::_moz_gtk_csd_minimize_button,
-+    nsMediaFeature::eMinMaxNotAllowed,
-+    nsMediaFeature::eBoolInteger,
-+    nsMediaFeature::eNoRequirements,
-+    { &nsGkAtoms::gtk_csd_minimize_button },
-+    GetSystemMetric
-+  },
-+
-+  {
-+    &nsGkAtoms::_moz_gtk_csd_maximize_button,
-+    nsMediaFeature::eMinMaxNotAllowed,
-+    nsMediaFeature::eBoolInteger,
-+    nsMediaFeature::eNoRequirements,
-+    { &nsGkAtoms::gtk_csd_maximize_button },
-+    GetSystemMetric
-+  },
-+
-+  {
-+    &nsGkAtoms::_moz_gtk_csd_close_button,
-+    nsMediaFeature::eMinMaxNotAllowed,
-+    nsMediaFeature::eBoolInteger,
-+    nsMediaFeature::eNoRequirements,
-+    { &nsGkAtoms::gtk_csd_close_button },
-+    GetSystemMetric
-+  },
-+
-   // Internal -moz-is-glyph media feature: applies only inside SVG glyphs.
-   // Internal because it is really only useful in the user agent anyway
-   //  and therefore not worth standardizing.
-diff -up firefox-58.0/toolkit/modules/moz.build.1399611 firefox-58.0/toolkit/modules/moz.build
---- firefox-58.0/toolkit/modules/moz.build.1399611	2018-01-11 21:17:05.000000000 +0100
-+++ firefox-58.0/toolkit/modules/moz.build	2018-01-24 10:57:03.718031950 +0100
-@@ -259,7 +259,7 @@ EXTRA_JS_MODULES.sessionstore += [
- ]
- 
- DEFINES['INSTALL_COMPACT_THEMES'] = 1
--if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):
-+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa', 'gtk3'):
-     DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1
- 
- if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3'):
-diff -up firefox-58.0/widget/gtk/mozgtk/mozgtk.c.1399611 firefox-58.0/widget/gtk/mozgtk/mozgtk.c
---- firefox-58.0/widget/gtk/mozgtk/mozgtk.c.1399611	2018-01-11 21:17:06.000000000 +0100
-+++ firefox-58.0/widget/gtk/mozgtk/mozgtk.c	2018-01-24 10:11:58.638648276 +0100
-@@ -391,6 +391,7 @@ STUB(gtk_separator_menu_item_new)
- STUB(gtk_separator_tool_item_new)
- STUB(gtk_settings_get_default)
- STUB(gtk_settings_get_for_screen)
-+STUB(gtk_show_uri)
- STUB(gtk_socket_add_id)
- STUB(gtk_socket_get_id)
- STUB(gtk_socket_get_type)
-@@ -407,6 +408,7 @@ STUB(gtk_target_list_add_image_targets)
- STUB(gtk_target_list_new)
- STUB(gtk_target_list_unref)
- STUB(gtk_targets_include_image)
-+STUB(gtk_targets_include_text)
- STUB(gtk_target_table_free)
- STUB(gtk_target_table_new_from_list)
- STUB(gtk_text_view_new)
-@@ -479,6 +481,7 @@ STUB(gtk_widget_show_all)
- STUB(gtk_widget_size_allocate)
- STUB(gtk_widget_style_get)
- STUB(gtk_widget_unparent)
-+STUB(gtk_widget_unrealize)
- STUB(gtk_window_deiconify)
- STUB(gtk_window_fullscreen)
- STUB(gtk_window_get_group)
-@@ -582,6 +585,8 @@ STUB(gtk_style_context_set_state)
- STUB(gtk_style_properties_lookup_property)
- STUB(gtk_tree_view_column_get_button)
- STUB(gtk_widget_get_preferred_size)
-+STUB(gtk_widget_get_preferred_width)
-+STUB(gtk_widget_get_preferred_height)
- STUB(gtk_widget_get_state_flags)
- STUB(gtk_widget_get_style_context)
- STUB(gtk_widget_path_append_type)
-diff -up firefox-58.0/widget/gtk/nsLookAndFeel.cpp.1399611 firefox-58.0/widget/gtk/nsLookAndFeel.cpp
---- firefox-58.0/widget/gtk/nsLookAndFeel.cpp.1399611	2018-01-11 21:17:06.000000000 +0100
-+++ firefox-58.0/widget/gtk/nsLookAndFeel.cpp	2018-01-24 10:57:03.718031950 +0100
-@@ -24,6 +24,7 @@
- #include "nsStyleConsts.h"
- #include "gfxFontConstants.h"
- #include "WidgetUtils.h"
-+#include "nsWindow.h"
- 
- #include <dlfcn.h>
- 
-@@ -740,7 +741,7 @@ GetSystemFontInfo(GtkStyleContext *aStyl
-     // Scale fonts up on HiDPI displays.
-     // This would be done automatically with cairo, but we manually manage
-     // the display scale for platform consistency.
--    size *= ScreenHelperGTK::GetGTKMonitorScaleFactor();
-+    size *= mozilla::widget::ScreenHelperGTK::GetGTKMonitorScaleFactor();
- 
-     // |size| is now pixels
- 
-@@ -1076,17 +1077,13 @@ nsLookAndFeel::EnsureInit()
-     gtk_widget_destroy(window);
-     g_object_unref(labelWidget);
- 
--    // Require GTK 3.20 for client-side decoration support.
--    mCSDAvailable = gtk_check_version(3, 20, 0) == nullptr;
--    if (mCSDAvailable) {
--        mCSDAvailable =
--            mozilla::Preferences::GetBool("widget.allow-client-side-decoration",
--                                          false);
--    }
-+    // Require GTK 3.10 for GtkHeaderBar support and compatible window manager.
-+    mCSDAvailable = (gtk_check_version(3, 10, 0) == nullptr &&
-+        nsWindow::GetCSDSupportLevel() != nsWindow::CSD_SUPPORT_NONE);
- 
-     // We need to initialize whole CSD config explicitly because it's queried
-     // as -moz-gtk* media features.
--    mCSDCloseButton = false;
-+    mCSDCloseButton = true;
-     mCSDMaximizeButton = false;
-     mCSDMinimizeButton = false;
- 
-@@ -1095,18 +1092,24 @@ nsLookAndFeel::EnsureInit()
-           (const gchar* (*)(GtkWidget*))
-           dlsym(RTLD_DEFAULT, "gtk_header_bar_get_decoration_layout");
- 
--        GtkWidget* headerBar = GetWidget(MOZ_GTK_HEADER_BAR);
--        const gchar* decorationLayout =
--            sGtkHeaderBarGetDecorationLayoutPtr(headerBar);
--        if (!decorationLayout) {
--            g_object_get(settings, "gtk-decoration-layout", &decorationLayout,
--                         nullptr);
--        }
-+        if (sGtkHeaderBarGetDecorationLayoutPtr) {
-+            GtkWidget* headerBar = GetWidget(MOZ_GTK_HEADER_BAR);
-+            const gchar* decorationLayout =
-+                sGtkHeaderBarGetDecorationLayoutPtr(headerBar);
-+            if (!decorationLayout) {
-+                g_object_get(settings, "gtk-decoration-layout",
-+                             &decorationLayout,
-+                             nullptr);
-+            }
- 
--        if (decorationLayout) {
--            mCSDCloseButton = (strstr(decorationLayout, "close") != nullptr);
--            mCSDMaximizeButton = (strstr(decorationLayout, "maximize") != nullptr);
--            mCSDMinimizeButton = (strstr(decorationLayout, "minimize") != nullptr);
-+            if (decorationLayout) {
-+                mCSDCloseButton =
-+                    (strstr(decorationLayout, "close") != nullptr);
-+                mCSDMaximizeButton =
-+                    (strstr(decorationLayout, "maximize") != nullptr);
-+                mCSDMinimizeButton =
-+                    (strstr(decorationLayout, "minimize") != nullptr);
-+            }
-         }
-     }
- }
-diff -up firefox-58.0/widget/gtk/nsNativeThemeGTK.cpp.1399611 firefox-58.0/widget/gtk/nsNativeThemeGTK.cpp
---- firefox-58.0/widget/gtk/nsNativeThemeGTK.cpp.1399611	2018-01-11 21:17:06.000000000 +0100
-+++ firefox-58.0/widget/gtk/nsNativeThemeGTK.cpp	2018-01-24 10:57:03.719031946 +0100
-@@ -29,6 +29,7 @@
- 
- #include <gdk/gdkprivate.h>
- #include <gtk/gtk.h>
-+#include <gtk/gtkx.h>
- 
- #include "gfxContext.h"
- #include "gfxPlatformGtk.h"
-@@ -51,6 +52,7 @@
- 
- using namespace mozilla;
- using namespace mozilla::gfx;
-+using namespace mozilla::widget;
- 
- NS_IMPL_ISUPPORTS_INHERITED(nsNativeThemeGTK, nsNativeTheme, nsITheme,
-                                                              nsIObserver)
-@@ -1375,6 +1377,10 @@ nsNativeThemeGTK::GetWidgetPadding(nsDev
-   switch (aWidgetType) {
-     case NS_THEME_BUTTON_FOCUS:
-     case NS_THEME_TOOLBARBUTTON:
-+    case NS_THEME_WINDOW_BUTTON_CLOSE:
-+    case NS_THEME_WINDOW_BUTTON_MINIMIZE:
-+    case NS_THEME_WINDOW_BUTTON_MAXIMIZE:
-+    case NS_THEME_WINDOW_BUTTON_RESTORE:
-     case NS_THEME_DUALBUTTON:
-     case NS_THEME_TAB_SCROLL_ARROW_BACK:
-     case NS_THEME_TAB_SCROLL_ARROW_FORWARD:
-diff -up firefox-58.0/widget/gtk/nsWindow.cpp.1399611 firefox-58.0/widget/gtk/nsWindow.cpp
---- firefox-58.0/widget/gtk/nsWindow.cpp.1399611	2018-01-24 10:57:03.714031963 +0100
-+++ firefox-58.0/widget/gtk/nsWindow.cpp	2018-01-24 10:57:03.720031943 +0100
-@@ -178,13 +178,8 @@ static int    is_parent_ungrab_enter(Gdk
- static int    is_parent_grab_leave(GdkEventCrossing *aEvent);
- 
- /* callbacks from widgets */
--#if (MOZ_WIDGET_GTK == 2)
--static gboolean expose_event_cb           (GtkWidget *widget,
--                                           GdkEventExpose *event);
--#else
- static gboolean expose_event_cb           (GtkWidget *widget,
-                                            cairo_t *rect);
--#endif
- static gboolean configure_event_cb        (GtkWidget *widget,
-                                            GdkEventConfigure *event);
- static void     container_unrealize_cb    (GtkWidget *widget);
-@@ -230,11 +225,9 @@ static void     screen_composited_change
- static void     widget_composited_changed_cb     (GtkWidget* widget,
-                                                   gpointer user_data);
- 
--#if (MOZ_WIDGET_GTK == 3)
- static void     scale_changed_cb          (GtkWidget* widget,
-                                            GParamSpec* aPSpec,
-                                            gpointer aPointer);
--#endif
- #if GTK_CHECK_VERSION(3,4,0)
- static gboolean touch_event_cb            (GtkWidget* aWidget,
-                                            GdkEventTouch* aEvent);
-@@ -390,7 +383,7 @@ static guint gButtonState;
- static inline int32_t
- GetBitmapStride(int32_t width)
- {
--#if defined(MOZ_X11) || (MOZ_WIDGET_GTK == 2)
-+#if defined(MOZ_X11)
-   return (width+7)/8;
- #else
-   return cairo_format_stride_for_width(CAIRO_FORMAT_A1, width);
-@@ -458,11 +451,23 @@ nsWindow::nsWindow()
-     mXVisual  = nullptr;
-     mXDepth   = 0;
- #endif /* MOZ_X11 */
-+
-     if (!gGlobalsInitialized) {
-         gGlobalsInitialized = true;
- 
-         // It's OK if either of these fail, but it may not be one day.
-         initialize_prefs();
-+
-+#ifdef MOZ_WAYLAND
-+        // Wayland provides clipboard data to application on focus-in event
-+        // so we need to init our clipboard hooks before we create window
-+        // and get focus.
-+        if (!mIsX11Display) {
-+            nsCOMPtr<nsIClipboard> clipboard =
-+                do_GetService("@mozilla.org/widget/clipboard;1");
-+            NS_ASSERTION(clipboard, "Failed to init clipboard!");
-+        }
-+#endif
-     }
- 
-     mLastMotionPressure = 0;
-@@ -1521,7 +1526,7 @@ nsWindow::UpdateClientOffset()
- {
-     AUTO_PROFILER_LABEL("nsWindow::UpdateClientOffset", GRAPHICS);
- 
--    if (!mIsTopLevel || !mShell || !mGdkWindow || !mIsX11Display ||
-+    if (!mIsTopLevel || !mShell || !mIsX11Display ||
-         gtk_window_get_window_type(GTK_WINDOW(mShell)) == GTK_WINDOW_POPUP) {
-         mClientOffset = nsIntPoint(0, 0);
-         return;
-@@ -1534,7 +1539,7 @@ nsWindow::UpdateClientOffset()
-     int length_returned;
-     long *frame_extents;
- 
--    if (!gdk_property_get(mGdkWindow,
-+    if (!gdk_property_get(gtk_widget_get_window(mShell),
-                           gdk_atom_intern ("_NET_FRAME_EXTENTS", FALSE),
-                           cardinal_atom,
-                           0, // offset
-@@ -1710,16 +1715,22 @@ nsWindow::GetNativeData(uint32_t aDataTy
- #ifdef MOZ_X11
-         GdkDisplay* gdkDisplay = gdk_display_get_default();
-         if (GDK_IS_X11_DISPLAY(gdkDisplay)) {
--          return GDK_DISPLAY_XDISPLAY(gdkDisplay);
-+            return GDK_DISPLAY_XDISPLAY(gdkDisplay);
-         }
- #endif /* MOZ_X11 */
-+        // Don't bother to return native display on Wayland as it's for
-+        // X11 only NPAPI plugins.
-         return nullptr;
-     }
-     case NS_NATIVE_SHELLWIDGET:
-         return GetToplevelWidget();
- 
-     case NS_NATIVE_SHAREABLE_WINDOW:
--        return (void *) GDK_WINDOW_XID(gdk_window_get_toplevel(mGdkWindow));
-+        if (mIsX11Display) {
-+            return (void *) GDK_WINDOW_XID(gdk_window_get_toplevel(mGdkWindow));
-+        }
-+        NS_WARNING("nsWindow::GetNativeData(): NS_NATIVE_SHAREABLE_WINDOW is not handled on Wayland!");
-+        return nullptr;
-     case NS_RAW_NATIVE_IME_CONTEXT: {
-         void* pseudoIMEContext = GetPseudoIMEContext();
-         if (pseudoIMEContext) {
-@@ -1800,18 +1811,18 @@ nsWindow::SetIcon(const nsAString& aIcon
-         // The last two entries (for the old XPM format) will be ignored unless
-         // no icons are found using other suffixes. XPM icons are deprecated.
- 
--        const char extensions[6][7] = { ".png", "16.png", "32.png", "48.png",
--                                    ".xpm", "16.xpm" };
-+        const char16_t extensions[9][8] = { u".png", u"16.png", u"32.png",
-+                                            u"48.png", u"64.png", u"128.png",
-+                                            u"256.png",
-+                                            u".xpm", u"16.xpm" };
- 
-         for (uint32_t i = 0; i < ArrayLength(extensions); i++) {
-             // Don't bother looking for XPM versions if we found a PNG.
-             if (i == ArrayLength(extensions) - 2 && foundIcon)
-                 break;
- 
--            nsAutoString extension;
--            extension.AppendASCII(extensions[i]);
--
--            ResolveIconName(aIconSpec, extension, getter_AddRefs(iconFile));
-+            ResolveIconName(aIconSpec, nsDependentString(extensions[i]),
-+                            getter_AddRefs(iconFile));
-             if (iconFile) {
-                 iconFile->GetNativePath(path);
-                 GdkPixbuf *icon = gdk_pixbuf_new_from_file(path.get(), nullptr);
-@@ -2024,30 +2035,6 @@ gdk_window_flash(GdkWindow *    aGdkWind
- #endif // DEBUG
- #endif
- 
--#if (MOZ_WIDGET_GTK == 2)
--static bool
--ExtractExposeRegion(LayoutDeviceIntRegion& aRegion, GdkEventExpose* aEvent)
--{
--  GdkRectangle* rects;
--  gint nrects;
--  gdk_region_get_rectangles(aEvent->region, &rects, &nrects);
--
--  if (nrects > MAX_RECTS_IN_REGION) {
--      // Just use the bounding box
--      rects[0] = aEvent->area;
--      nrects = 1;
--  }
--
--  for (GdkRectangle* r = rects; r < rects + nrects; r++) {
--      aRegion.Or(aRegion, LayoutDeviceIntRect(r->x, r->y, r->width, r->height));
--      LOGDRAW(("\t%d %d %d %d\n", r->x, r->y, r->width, r->height));
--  }
--
--  g_free(rects);
--  return true;
--}
--
--#else
- # ifdef cairo_copy_clip_rectangle_list
- #  error "Looks like we're including Mozilla's cairo instead of system cairo"
- # endif
-@@ -2069,15 +2056,9 @@ ExtractExposeRegion(LayoutDeviceIntRegio
-   cairo_rectangle_list_destroy(rects);
-   return true;
- }
--#endif
- 
--#if (MOZ_WIDGET_GTK == 2)
--gboolean
--nsWindow::OnExposeEvent(GdkEventExpose *aEvent)
--#else
- gboolean
- nsWindow::OnExposeEvent(cairo_t *cr)
--#endif
- {
-     // Send any pending resize events so that layout can update.
-     // May run event loop.
-@@ -2096,11 +2077,7 @@ nsWindow::OnExposeEvent(cairo_t *cr)
-         return FALSE;
- 
-     LayoutDeviceIntRegion exposeRegion;
--#if (MOZ_WIDGET_GTK == 2)
--    if (!ExtractExposeRegion(exposeRegion, aEvent)) {
--#else
-     if (!ExtractExposeRegion(exposeRegion, cr)) {
--#endif
-         return FALSE;
-     }
- 
-@@ -2141,7 +2118,7 @@ nsWindow::OnExposeEvent(cairo_t *cr)
- 
-     LOGDRAW(("sending expose event [%p] %p 0x%lx (rects follow):\n",
-              (void *)this, (void *)mGdkWindow,
--             gdk_x11_window_get_xid(mGdkWindow)));
-+             mIsX11Display ? gdk_x11_window_get_xid(mGdkWindow) : 0));
- 
-     // Our bounds may have changed after calling WillPaintWindow.  Clip
-     // to the new bounds here.  The region is relative to this
-@@ -2304,19 +2281,11 @@ nsWindow::OnExposeEvent(cairo_t *cr)
-     listener->DidPaintWindow();
- 
-     // Synchronously flush any new dirty areas
--#if (MOZ_WIDGET_GTK == 2)
--    GdkRegion* dirtyArea = gdk_window_get_update_area(mGdkWindow);
--#else
-     cairo_region_t* dirtyArea = gdk_window_get_update_area(mGdkWindow);
--#endif
- 
-     if (dirtyArea) {
-         gdk_window_invalidate_region(mGdkWindow, dirtyArea, false);
--#if (MOZ_WIDGET_GTK == 2)
--        gdk_region_destroy(dirtyArea);
--#else
-         cairo_region_destroy(dirtyArea);
--#endif
-         gdk_window_process_updates(mGdkWindow, false);
-     }
- 
-@@ -2466,7 +2435,7 @@ nsWindow::OnSizeAllocate(GtkAllocation *
-     mBounds.SizeTo(size);
- 
- #ifdef MOZ_X11
--    // Notify the X11CompositorWidget of a ClientSizeChange
-+    // Notify the GtkCompositorWidget of a ClientSizeChange
-     if (mCompositorWidgetDelegate) {
-       mCompositorWidgetDelegate->NotifyClientSizeChanged(GetClientSize());
-     }
-@@ -3550,21 +3519,9 @@ CreateGdkWindow(GdkWindow *parent, GtkWi
-     attributes.visual = gtk_widget_get_visual(widget);
-     attributes.window_type = GDK_WINDOW_CHILD;
- 
--#if (MOZ_WIDGET_GTK == 2)
--    attributes_mask |= GDK_WA_COLORMAP;
--    attributes.colormap = gtk_widget_get_colormap(widget);
--#endif
--
-     GdkWindow *window = gdk_window_new(parent, &attributes, attributes_mask);
-     gdk_window_set_user_data(window, widget);
- 
--// GTK3 TODO?
--#if (MOZ_WIDGET_GTK == 2)
--    /* set the default pixmap to None so that you don't end up with the
--       gtk default which is BlackPixel. */
--    gdk_window_set_back_pixmap(window, nullptr, FALSE);
--#endif
--
-     return window;
- }
- 
-@@ -3653,10 +3610,14 @@ nsWindow::Create(nsIWidget* aParent,
-         // which will use a Window with the override-redirect attribute
-         // (for temporary windows).
-         // For long-lived windows, their stacking order is managed by the
--        // window manager, as indicated by GTK_WINDOW_TOPLEVEL ...
--        GtkWindowType type =
--            mWindowType != eWindowType_popup || aInitData->mNoAutoHide ?
--              GTK_WINDOW_TOPLEVEL : GTK_WINDOW_POPUP;
-+        // window manager, as indicated by GTK_WINDOW_TOPLEVEL.
-+        // For Wayland we have to always use GTK_WINDOW_POPUP to control
-+        // popup window position.
-+        GtkWindowType type = GTK_WINDOW_TOPLEVEL;
-+        if (mWindowType == eWindowType_popup) {
-+            type = (mIsX11Display && aInitData->mNoAutoHide) ?
-+                GTK_WINDOW_TOPLEVEL : GTK_WINDOW_POPUP;
-+        }
-         mShell = gtk_window_new(type);
- 
-         bool useAlphaVisual = (mWindowType == eWindowType_popup &&
-@@ -3674,13 +3635,8 @@ nsWindow::Create(nsIWidget* aParent,
-         if (useAlphaVisual) {
-             GdkScreen *screen = gtk_widget_get_screen(mShell);
-             if (gdk_screen_is_composited(screen)) {
--#if (MOZ_WIDGET_GTK == 2)
--                GdkColormap *colormap = gdk_screen_get_rgba_colormap(screen);
--                gtk_widget_set_colormap(mShell, colormap);
--#else
-                 GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
-                 gtk_widget_set_visual(mShell, visual);
--#endif
-             }
-         }
- 
-@@ -3728,9 +3684,11 @@ nsWindow::Create(nsIWidget* aParent,
- #ifdef MOZ_X11
-                 // ... but when the window manager offers focus through
-                 // WM_TAKE_FOCUS, focus is requested on the parent window.
--                gtk_widget_realize(mShell);
--                gdk_window_add_filter(gtk_widget_get_window(mShell),
--                                      popup_take_focus_filter, nullptr);
-+                if (mIsX11Display) {
-+                    gtk_widget_realize(mShell);
-+                    gdk_window_add_filter(gtk_widget_get_window(mShell),
-+                                          popup_take_focus_filter, nullptr);
-+                }
- #endif
-             }
- 
-@@ -3742,7 +3700,11 @@ nsWindow::Create(nsIWidget* aParent,
-             else {
-                 switch (aInitData->mPopupHint) {
-                     case ePopupTypeMenu:
--                        gtkTypeHint = GDK_WINDOW_TYPE_HINT_POPUP_MENU;
-+                        // Use GDK_WINDOW_TYPE_HINT_UTILITY on Wayland which
-+                        // guides Gtk to create the popup as subsurface
-+                        // instead of xdg_shell popup (see Bug 1423598).
-+                        gtkTypeHint = mIsX11Display ? GDK_WINDOW_TYPE_HINT_POPUP_MENU :
-+                                                      GDK_WINDOW_TYPE_HINT_UTILITY;
-                         break;
-                     case ePopupTypeTooltip:
-                         gtkTypeHint = GDK_WINDOW_TYPE_HINT_TOOLTIP;
-@@ -3769,13 +3731,11 @@ nsWindow::Create(nsIWidget* aParent,
-             gtk_window_group_add_window(group, GTK_WINDOW(mShell));
-             g_object_unref(group);
- 
--            if (GetCSDSupportLevel() != CSD_SUPPORT_NONE) {
--                int32_t isCSDAvailable = false;
--                nsresult rv = LookAndFeel::GetInt(LookAndFeel::eIntID_GTKCSDAvailable,
--                                                &isCSDAvailable);
--                if (NS_SUCCEEDED(rv)) {
--                   mIsCSDAvailable = isCSDAvailable;
--                }
-+            int32_t isCSDAvailable = false;
-+            nsresult rv = LookAndFeel::GetInt(LookAndFeel::eIntID_GTKCSDAvailable,
-+                                              &isCSDAvailable);
-+            if (NS_SUCCEEDED(rv)) {
-+               mIsCSDAvailable = isCSDAvailable;
-             }
-         }
- 
-@@ -3783,7 +3743,6 @@ nsWindow::Create(nsIWidget* aParent,
-         GtkWidget *container = moz_container_new();
-         mContainer = MOZ_CONTAINER(container);
- 
--#if (MOZ_WIDGET_GTK == 3)
-         // "csd" style is set when widget is realized so we need to call
-         // it explicitly now.
-         gtk_widget_realize(mShell);
-@@ -3793,16 +3752,22 @@ nsWindow::Create(nsIWidget* aParent,
-          * 1) We're running on Gtk+ without client side decorations.
-          *    Content is rendered to mShell window and we listen
-          *    to the Gtk+ events on mShell
--         * 2) We're running on Gtk+ > 3.20 and client side decorations
-+         * 2) We're running on Gtk+ and client side decorations
-          *    are drawn by Gtk+ to mShell. Content is rendered to mContainer
-          *    and we listen to the Gtk+ events on mContainer.
-+         * 3) We're running on Wayland. All gecko content is rendered
-+         *    to mContainer and we listen to the Gtk+ events on mContainer.
-          */
-         GtkStyleContext* style = gtk_widget_get_style_context(mShell);
--        drawToContainer = gtk_style_context_has_class(style, "csd");
--#endif
-+        drawToContainer =
-+            !mIsX11Display ||
-+            (mIsCSDAvailable && GetCSDSupportLevel() == CSD_SUPPORT_FLAT ) ||
-+            gtk_style_context_has_class(style, "csd");
-         eventWidget = (drawToContainer) ? container : mShell;
- 
-         gtk_widget_add_events(eventWidget, kEvents);
-+        if (drawToContainer)
-+            gtk_widget_add_events(mShell, GDK_PROPERTY_CHANGE_MASK);
- 
-         // Prevent GtkWindow from painting a background to avoid flickering.
-         gtk_widget_set_app_paintable(eventWidget, TRUE);
-@@ -3839,19 +3804,11 @@ nsWindow::Create(nsIWidget* aParent,
- 
-             // If the popup ignores mouse events, set an empty input shape.
-             if (aInitData->mMouseTransparent) {
--#if (MOZ_WIDGET_GTK == 2)
--              GdkRectangle rect = { 0, 0, 0, 0 };
--              GdkRegion *region = gdk_region_rectangle(&rect);
--
--              gdk_window_input_shape_combine_region(mGdkWindow, region, 0, 0);
--              gdk_region_destroy(region);
--#else
-               cairo_rectangle_int_t rect = { 0, 0, 0, 0 };
-               cairo_region_t *region = cairo_region_create_rectangle(&rect);
- 
-               gdk_window_input_shape_combine_region(mGdkWindow, region, 0, 0);
-               cairo_region_destroy(region);
--#endif
-             }
-         }
-     }
-@@ -3893,6 +3850,12 @@ nsWindow::Create(nsIWidget* aParent,
- 
-     // label the drawing window with this object so we can find our way home
-     g_object_set_data(G_OBJECT(mGdkWindow), "nsWindow", this);
-+    if (drawToContainer) {
-+        // Also label mShell toplevel window,
-+        // property_notify_event_cb callback also needs to find its way home
-+        g_object_set_data(G_OBJECT(gtk_widget_get_window(mShell)),
-+                          "nsWindow", this);
-+    }
- 
-     if (mContainer)
-         g_object_set_data(G_OBJECT(mContainer), "nsWindow", this);
-@@ -3910,12 +3873,12 @@ nsWindow::Create(nsIWidget* aParent,
-                          G_CALLBACK(window_state_event_cb), nullptr);
-         g_signal_connect(mShell, "check-resize",
-                          G_CALLBACK(check_resize_cb), nullptr);
--
--        GdkScreen *screen = gtk_widget_get_screen(mShell);
--
-         g_signal_connect(mShell, "composited-changed",
-                          G_CALLBACK(widget_composited_changed_cb), nullptr);
-+        g_signal_connect(mShell, "property-notify-event",
-+                         G_CALLBACK(property_notify_event_cb), nullptr);
- 
-+        GdkScreen *screen = gtk_widget_get_screen(mShell);
-         if (!g_signal_handler_find(screen, G_SIGNAL_MATCH_FUNC,
-                                    0, 0, nullptr,
-                                    FuncToGpointer(screen_composited_changed_cb), 0)) {
-@@ -3940,21 +3903,14 @@ nsWindow::Create(nsIWidget* aParent,
-                                G_CALLBACK(size_allocate_cb), nullptr);
-         g_signal_connect(mContainer, "hierarchy-changed",
-                          G_CALLBACK(hierarchy_changed_cb), nullptr);
--#if (MOZ_WIDGET_GTK == 3)
-         g_signal_connect(mContainer, "notify::scale-factor",
-                          G_CALLBACK(scale_changed_cb), nullptr);
--#endif
-         // Initialize mHasMappedToplevel.
-         hierarchy_changed_cb(GTK_WIDGET(mContainer), nullptr);
-         // Expose, focus, key, and drag events are sent even to GTK_NO_WINDOW
-         // widgets.
--#if (MOZ_WIDGET_GTK == 2)
--        g_signal_connect(mContainer, "expose_event",
--                         G_CALLBACK(expose_event_cb), nullptr);
--#else
-         g_signal_connect(G_OBJECT(mContainer), "draw",
-                          G_CALLBACK(expose_event_cb), nullptr);
--#endif
-         g_signal_connect(mContainer, "focus_in_event",
-                          G_CALLBACK(focus_in_event_cb), nullptr);
-         g_signal_connect(mContainer, "focus_out_event",
-@@ -4006,10 +3962,6 @@ nsWindow::Create(nsIWidget* aParent,
-     }
- 
-     if (eventWidget) {
--#if (MOZ_WIDGET_GTK == 2)
--        // Don't let GTK mess with the shapes of our GdkWindows
--        GTK_PRIVATE_SET_FLAG(eventWidget, GTK_HAS_SHAPE_MASK);
--#endif
- 
-         // These events are sent to the owning widget of the relevant window
-         // and propagate up to the first widget that handles the events, so we
-@@ -4025,8 +3977,6 @@ nsWindow::Create(nsIWidget* aParent,
-                          G_CALLBACK(button_press_event_cb), nullptr);
-         g_signal_connect(eventWidget, "button-release-event",
-                          G_CALLBACK(button_release_event_cb), nullptr);
--        g_signal_connect(eventWidget, "property-notify-event",
--                         G_CALLBACK(property_notify_event_cb), nullptr);
-         g_signal_connect(eventWidget, "scroll-event",
-                          G_CALLBACK(scroll_event_cb), nullptr);
- #if GTK_CHECK_VERSION(3,4,0)
-@@ -4039,7 +3989,7 @@ nsWindow::Create(nsIWidget* aParent,
-     if (mShell) {
-         LOG(("\tmShell %p mContainer %p mGdkWindow %p 0x%lx\n",
-              mShell, mContainer, mGdkWindow,
--             gdk_x11_window_get_xid(mGdkWindow)));
-+             mIsX11Display ? gdk_x11_window_get_xid(mGdkWindow) : 0));
-     } else if (mContainer) {
-         LOG(("\tmContainer %p mGdkWindow %p\n", mContainer, mGdkWindow));
-     }
-@@ -4063,8 +4013,12 @@ nsWindow::Create(nsIWidget* aParent,
- 
-       mSurfaceProvider.Initialize(mXDisplay, mXWindow, mXVisual, mXDepth);
-     }
-+#ifdef MOZ_WAYLAND
-+    else if (!mIsX11Display) {
-+      mSurfaceProvider.Initialize(this);
-+    }
-+#endif
- #endif
--
-     return NS_OK;
- }
- 
-@@ -4099,7 +4053,8 @@ nsWindow::SetWindowClass(const nsAString
-   res_name[0] = toupper(res_name[0]);
-   if (!role) role = res_name;
- 
--  gdk_window_set_role(mGdkWindow, role);
-+  GdkWindow* gdkWindow = gtk_widget_get_window(mShell);
-+  gdk_window_set_role(gdkWindow, role);
- 
- #ifdef MOZ_X11
-   if (mIsX11Display) {
-@@ -4115,7 +4070,7 @@ nsWindow::SetWindowClass(const nsAString
-       // a warning & refuses to make the change.
-       GdkDisplay *display = gdk_display_get_default();
-       XSetClassHint(GDK_DISPLAY_XDISPLAY(display),
--                    gdk_x11_window_get_xid(mGdkWindow),
-+                    gdk_x11_window_get_xid(gdkWindow),
-                     class_hint);
-       XFree(class_hint);
-   }
-@@ -4164,7 +4119,7 @@ nsWindow::NativeResize()
-     }
- 
- #ifdef MOZ_X11
--    // Notify the X11CompositorWidget of a ClientSizeChange
-+    // Notify the GtkCompositorWidget of a ClientSizeChange
-     // This is different than OnSizeAllocate to catch initial sizing
-     if (mCompositorWidgetDelegate) {
-       mCompositorWidgetDelegate->NotifyClientSizeChanged(GetClientSize());
-@@ -4220,7 +4175,7 @@ nsWindow::NativeMoveResize()
-     }
- 
- #ifdef MOZ_X11
--    // Notify the X11CompositorWidget of a ClientSizeChange
-+    // Notify the GtkCompositorWidget of a ClientSizeChange
-     // This is different than OnSizeAllocate to catch initial sizing
-     if (mCompositorWidgetDelegate) {
-       mCompositorWidgetDelegate->NotifyClientSizeChanged(GetClientSize());
-@@ -4529,17 +4484,6 @@ nsWindow::SetWindowClipRegion(const nsTA
-     if (!mGdkWindow)
-         return NS_OK;
- 
--#if (MOZ_WIDGET_GTK == 2)
--    GdkRegion *region = gdk_region_new(); // aborts on OOM
--    for (uint32_t i = 0; i < newRects->Length(); ++i) {
--        const LayoutDeviceIntRect& r = newRects->ElementAt(i);
--        GdkRectangle rect = { r.x, r.y, r.width, r.height };
--        gdk_region_union_with_rect(region, &rect);
--    }
--
--    gdk_window_shape_combine_region(mGdkWindow, region, 0, 0);
--    gdk_region_destroy(region);
--#else
-     cairo_region_t *region = cairo_region_create();
-     for (uint32_t i = 0; i < newRects->Length(); ++i) {
-         const LayoutDeviceIntRect& r = newRects->ElementAt(i);
-@@ -4549,7 +4493,6 @@ nsWindow::SetWindowClipRegion(const nsTA
- 
-     gdk_window_shape_combine_region(mGdkWindow, region, 0, 0);
-     cairo_region_destroy(region);
--#endif
- 
-     return NS_OK;
- }
-@@ -4658,17 +4601,6 @@ nsWindow::ApplyTransparencyBitmap()
-                       maskPixmap, ShapeSet);
-     XFreePixmap(xDisplay, maskPixmap);
- #else
--#if (MOZ_WIDGET_GTK == 2)
--    gtk_widget_reset_shapes(mShell);
--    GdkBitmap* maskBitmap = gdk_bitmap_create_from_data(mGdkWindow,
--            mTransparencyBitmap,
--            mTransparencyBitmapWidth, mTransparencyBitmapHeight);
--    if (!maskBitmap)
--        return;
--
--    gtk_widget_shape_combine_mask(mShell, maskBitmap, 0, 0);
--    g_object_unref(maskBitmap);
--#else
-     cairo_surface_t *maskBitmap;
-     maskBitmap = cairo_image_surface_create_for_data((unsigned char*)mTransparencyBitmap,
-                                                      CAIRO_FORMAT_A1,
-@@ -4682,7 +4614,6 @@ nsWindow::ApplyTransparencyBitmap()
-     gtk_widget_shape_combine_region(mShell, maskRegion);
-     cairo_region_destroy(maskRegion);
-     cairo_surface_destroy(maskBitmap);
--#endif // MOZ_WIDGET_GTK == 2
- #endif // MOZ_X11
- }
- 
-@@ -4779,6 +4710,12 @@ nsWindow::GrabPointer(guint32 aTime)
-     if (!mGdkWindow)
-         return;
- 
-+    if (!mIsX11Display) {
-+        // Don't to the grab on Wayland as it causes a regression
-+        // from Bug 1377084.
-+        return;
-+    }
-+
-     gint retval;
-     retval = gdk_pointer_grab(mGdkWindow, TRUE,
-                               (GdkEventMask)(GDK_BUTTON_PRESS_MASK |
-@@ -4812,6 +4749,13 @@ nsWindow::ReleaseGrabs(void)
-     LOG(("ReleaseGrabs\n"));
- 
-     mRetryPointerGrab = false;
-+
-+    if (!mIsX11Display) {
-+        // Don't to the ungrab on Wayland as it causes a regression
-+        // from Bug 1377084.
-+        return;
-+    }
-+
-     gdk_pointer_ungrab(GDK_CURRENT_TIME);
- }
- 
-@@ -5058,7 +5002,7 @@ nsWindow::MakeFullScreen(bool aFullScree
-     LOG(("nsWindow::MakeFullScreen [%p] aFullScreen %d\n",
-          (void *)this, aFullScreen));
- 
--    if (!IsFullscreenSupported(mShell)) {
-+    if (mIsX11Display && !IsFullscreenSupported(mShell)) {
-         return NS_ERROR_NOT_AVAILABLE;
-     }
- 
-@@ -5080,7 +5024,7 @@ nsWindow::MakeFullScreen(bool aFullScree
- }
- 
- void
--nsWindow::HideWindowChrome(bool aShouldHide)
-+nsWindow::SetWindowDecoration(nsBorderStyle aStyle)
- {
-     if (!mShell) {
-         // Pass the request to the toplevel window
-@@ -5092,30 +5036,29 @@ nsWindow::HideWindowChrome(bool aShouldH
-         if (!topWindow)
-             return;
- 
--        topWindow->HideWindowChrome(aShouldHide);
-+        topWindow->SetWindowDecoration(aStyle);
-         return;
-     }
- 
-+    // We can't use mGdkWindow directly here as it can be
-+    // derived from mContainer which is not a top-level GdkWindow.
-+    GdkWindow *window = gtk_widget_get_window(mShell);
-+
-     // Sawfish, metacity, and presumably other window managers get
-     // confused if we change the window decorations while the window
-     // is visible.
-     bool wasVisible = false;
--    if (gdk_window_is_visible(mGdkWindow)) {
--        gdk_window_hide(mGdkWindow);
-+    if (gdk_window_is_visible(window)) {
-+        gdk_window_hide(window);
-         wasVisible = true;
-     }
- 
--    gint wmd;
--    if (aShouldHide)
--        wmd = 0;
--    else
--        wmd = ConvertBorderStyles(mBorderStyle);
--
-+    gint wmd = ConvertBorderStyles(aStyle);
-     if (wmd != -1)
--      gdk_window_set_decorations(mGdkWindow, (GdkWMDecoration) wmd);
-+      gdk_window_set_decorations(window, (GdkWMDecoration) wmd);
- 
-     if (wasVisible)
--        gdk_window_show(mGdkWindow);
-+        gdk_window_show(window);
- 
-     // For some window managers, adding or removing window decorations
-     // requires unmapping and remapping our toplevel window.  Go ahead
-@@ -5123,10 +5066,19 @@ nsWindow::HideWindowChrome(bool aShouldH
-     // error later when this happens (when the persistence timer fires
-     // and GetWindowPos is called)
- #ifdef MOZ_X11
--    XSync(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()) , False);
--#else
--    gdk_flush ();
-+    if (mIsX11Display) {
-+        XSync(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()) , False);
-+    } else
- #endif /* MOZ_X11 */
-+    {
-+        gdk_flush ();
-+    }
-+}
-+
-+void
-+nsWindow::HideWindowChrome(bool aShouldHide)
-+{
-+    SetWindowDecoration(aShouldHide ? eBorderStyle_none : mBorderStyle);
- }
- 
- bool
-@@ -5237,12 +5189,8 @@ is_mouse_in_window (GdkWindow* aWindow,
-         window = gdk_window_get_parent(window);
-     }
- 
--#if (MOZ_WIDGET_GTK == 2)
--    gdk_drawable_get_size(aWindow, &w, &h);
--#else
-     w = gdk_window_get_width(aWindow);
-     h = gdk_window_get_height(aWindow);
--#endif
- 
-     if (aMouseX > x && aMouseX < x + w &&
-         aMouseY > y && aMouseY < y + h)
-@@ -5498,18 +5446,6 @@ get_gtk_cursor(nsCursor aCursor)
- 
- // gtk callbacks
- 
--#if (MOZ_WIDGET_GTK == 2)
--static gboolean
--expose_event_cb(GtkWidget *widget, GdkEventExpose *event)
--{
--    RefPtr<nsWindow> window = get_window_for_gdk_window(event->window);
--    if (!window)
--        return FALSE;
--
--    window->OnExposeEvent(event);
--    return FALSE;
--}
--#else
- void
- draw_window_of_widget(GtkWidget *widget, GdkWindow *aWindow, cairo_t *cr)
- {
-@@ -5561,7 +5497,6 @@ expose_event_cb(GtkWidget *widget, cairo
- 
-     return FALSE;
- }
--#endif //MOZ_WIDGET_GTK == 2
- 
- static gboolean
- configure_event_cb(GtkWidget *widget,
-@@ -5980,7 +5915,6 @@ widget_composited_changed_cb (GtkWidget*
-     window->OnCompositedChanged();
- }
- 
--#if (MOZ_WIDGET_GTK == 3)
- static void
- scale_changed_cb (GtkWidget* widget, GParamSpec* aPSpec, gpointer aPointer)
- {
-@@ -5996,7 +5930,6 @@ scale_changed_cb (GtkWidget* widget, GPa
-     gtk_widget_get_allocation(widget, &allocation);
-     window->OnSizeAllocate(&allocation);
- }
--#endif
- 
- #if GTK_CHECK_VERSION(3,4,0)
- static gboolean
-@@ -6174,11 +6107,7 @@ get_inner_gdk_window (GdkWindow *aWindow
-          child = g_list_previous(child)) {
-         auto *childWindow = (GdkWindow *) child->data;
-         if (get_window_for_gdk_window(childWindow)) {
--#if (MOZ_WIDGET_GTK == 2)
--            gdk_window_get_geometry(childWindow, &cx, &cy, &cw, &ch, nullptr);
--#else
-             gdk_window_get_geometry(childWindow, &cx, &cy, &cw, &ch);
--#endif
-             if ((cx < x) && (x < (cx + cw)) &&
-                 (cy < y) && (y < (cy + ch)) &&
-                 gdk_window_is_visible(childWindow)) {
-@@ -6386,53 +6315,6 @@ nsWindow::GetEditCommands(NativeKeyBindi
-     keyBindings->GetEditCommands(aEvent, aCommands);
- }
- 
--#if defined(MOZ_X11) && (MOZ_WIDGET_GTK == 2)
--/* static */ already_AddRefed<DrawTarget>
--nsWindow::GetDrawTargetForGdkDrawable(GdkDrawable* aDrawable,
--                                      const IntSize& aSize)
--{
--    GdkVisual* visual = gdk_drawable_get_visual(aDrawable);
--    Screen* xScreen =
--        gdk_x11_screen_get_xscreen(gdk_drawable_get_screen(aDrawable));
--    Display* xDisplay = DisplayOfScreen(xScreen);
--    Drawable xDrawable = gdk_x11_drawable_get_xid(aDrawable);
--
--    RefPtr<gfxASurface> surface;
--
--    if (visual) {
--        Visual* xVisual = gdk_x11_visual_get_xvisual(visual);
--
--        surface = new gfxXlibSurface(xDisplay, xDrawable, xVisual, aSize);
--    } else {
--        // no visual? we must be using an xrender format.  Find a format
--        // for this depth.
--        XRenderPictFormat *pf = nullptr;
--        switch (gdk_drawable_get_depth(aDrawable)) {
--            case 32:
--                pf = XRenderFindStandardFormat(xDisplay, PictStandardARGB32);
--                break;
--            case 24:
--                pf = XRenderFindStandardFormat(xDisplay, PictStandardRGB24);
--                break;
--            default:
--                NS_ERROR("Don't know how to handle the given depth!");
--                break;
--        }
--
--        surface = new gfxXlibSurface(xScreen, xDrawable, pf, aSize);
--    }
--
--    RefPtr<DrawTarget> dt =
--        gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(surface, aSize);
--
--    if (!dt || !dt->IsValid()) {
--        return nullptr;
--    }
--
--    return dt.forget();
--}
--#endif
--
- already_AddRefed<DrawTarget>
- nsWindow::StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion, BufferMode* aBufferMode)
- {
-@@ -6649,9 +6531,66 @@ nsWindow::SetDrawsInTitlebar(bool aState
-       return;
- 
-   if (mShell) {
--      gint wmd = aState ? GDK_DECOR_BORDER : ConvertBorderStyles(mBorderStyle);
--      gdk_window_set_decorations(gtk_widget_get_window(mShell),
--                                 (GdkWMDecoration) wmd);
-+      if (GetCSDSupportLevel() == CSD_SUPPORT_FULL) {
-+          SetWindowDecoration(aState ? eBorderStyle_border : mBorderStyle);
-+      }
-+      else {
-+          /* Window manager does not support GDK_DECOR_BORDER,
-+           * emulate it by CSD.
-+           *
-+           * gtk_window_set_titlebar() works on unrealized widgets only,
-+           * we need to handle mShell carefully here.
-+           * When CSD is enabled mGdkWindow is owned by mContainer which is good
-+           * as we can't delete our mGdkWindow. To make mShell unrealized while
-+           * mContainer is preserved we temporary reparent mContainer to an
-+           * invisible GtkWindow.
-+           */
-+          NativeShow(false);
-+
-+          // Using GTK_WINDOW_POPUP rather than
-+          // GTK_WINDOW_TOPLEVEL in the hope that POPUP results in less
-+          // initialization and window manager interaction.
-+          GtkWidget* tmpWindow = gtk_window_new(GTK_WINDOW_POPUP);
-+          gtk_widget_realize(tmpWindow);
-+
-+          gtk_widget_reparent(GTK_WIDGET(mContainer), tmpWindow);
-+          gtk_widget_unrealize(GTK_WIDGET(mShell));
-+
-+          // Available as of GTK 3.10+
-+          static auto sGtkWindowSetTitlebar = (void (*)(GtkWindow*, GtkWidget*))
-+              dlsym(RTLD_DEFAULT, "gtk_window_set_titlebar");
-+          MOZ_ASSERT(sGtkWindowSetTitlebar,
-+              "Missing gtk_window_set_titlebar(), old Gtk+ library?");
-+
-+          if (aState) {
-+              // Add a hidden titlebar widget to trigger CSD, but disable the default
-+              // titlebar.  GtkFixed is a somewhat random choice for a simple unused
-+              // widget. gtk_window_set_titlebar() takes ownership of the titlebar
-+              // widget.
-+              sGtkWindowSetTitlebar(GTK_WINDOW(mShell), gtk_fixed_new());
-+          } else {
-+              sGtkWindowSetTitlebar(GTK_WINDOW(mShell), nullptr);
-+          }
-+
-+          /* A workaround for https://bugzilla.gnome.org/show_bug.cgi?id=791081
-+           * gtk_widget_realize() throws:
-+           * "In pixman_region32_init_rect: Invalid rectangle passed"
-+           * when mShell has default 1x1 size.
-+           */
-+          GtkAllocation allocation = {0, 0, 0, 0};
-+          gtk_widget_get_preferred_width(GTK_WIDGET(mShell), nullptr,
-+                                         &allocation.width);
-+          gtk_widget_get_preferred_height(GTK_WIDGET(mShell), nullptr,
-+                                          &allocation.height);
-+          gtk_widget_size_allocate(GTK_WIDGET(mShell), &allocation);
-+
-+          gtk_widget_realize(GTK_WIDGET(mShell));
-+          gtk_widget_reparent(GTK_WIDGET(mContainer), GTK_WIDGET(mShell));
-+          mNeedsShow = true;
-+          NativeResize();
-+
-+          gtk_widget_destroy(tmpWindow);
-+      }
-   }
- 
-   mIsCSDEnabled = aState;
-@@ -6762,11 +6701,9 @@ nsWindow::SynthesizeNativeMouseEvent(Lay
-     event.button.window = mGdkWindow;
-     event.button.time = GDK_CURRENT_TIME;
- 
--#if (MOZ_WIDGET_GTK == 3)
-     // Get device for event source
-     GdkDeviceManager *device_manager = gdk_display_get_device_manager(display);
-     event.button.device = gdk_device_manager_get_client_pointer(device_manager);
--#endif
- 
-     event.button.x_root = DevicePixelsToGdkCoordRoundDown(aPoint.x);
-     event.button.y_root = DevicePixelsToGdkCoordRoundDown(aPoint.y);
-@@ -6809,12 +6746,10 @@ nsWindow::SynthesizeNativeMouseScrollEve
-   event.type = GDK_SCROLL;
-   event.scroll.window = mGdkWindow;
-   event.scroll.time = GDK_CURRENT_TIME;
--#if (MOZ_WIDGET_GTK == 3)
-   // Get device for event source
-   GdkDisplay* display = gdk_window_get_display(mGdkWindow);
-   GdkDeviceManager *device_manager = gdk_display_get_device_manager(display);
-   event.scroll.device = gdk_device_manager_get_client_pointer(device_manager);
--#endif
-   event.scroll.x_root = DevicePixelsToGdkCoordRoundDown(aPoint.x);
-   event.scroll.y_root = DevicePixelsToGdkCoordRoundDown(aPoint.y);
- 
-@@ -6938,27 +6873,54 @@ nsWindow::GetCSDSupportLevel() {
-     if (sCSDSupportLevel != CSD_SUPPORT_UNKNOWN) {
-         return sCSDSupportLevel;
-     }
--    // TODO: MATE
-+
-     const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP");
-     if (currentDesktop) {
--        if (strcmp(currentDesktop, "GNOME") == 0) {
--            sCSDSupportLevel = CSD_SUPPORT_FULL;
--        } else if (strcmp(currentDesktop, "XFCE") == 0) {
-+        if (strstr(currentDesktop, "GNOME") != nullptr) {
-             sCSDSupportLevel = CSD_SUPPORT_FULL;
--        } else if (strcmp(currentDesktop, "X-Cinnamon") == 0) {
-+        } else if (strstr(currentDesktop, "XFCE") != nullptr) {
-+            sCSDSupportLevel = CSD_SUPPORT_FLAT;
-+        } else if (strstr(currentDesktop, "X-Cinnamon") != nullptr) {
-             sCSDSupportLevel = CSD_SUPPORT_FULL;
--        } else if (strcmp(currentDesktop, "KDE") == 0) {
-+        } else if (strstr(currentDesktop, "KDE") != nullptr) {
-             sCSDSupportLevel = CSD_SUPPORT_FLAT;
--        } else if (strcmp(currentDesktop, "LXDE") == 0) {
-+        } else if (strstr(currentDesktop, "LXDE") != nullptr) {
-             sCSDSupportLevel = CSD_SUPPORT_FLAT;
--        } else if (strcmp(currentDesktop, "openbox") == 0) {
-+        } else if (strstr(currentDesktop, "openbox") != nullptr) {
-             sCSDSupportLevel = CSD_SUPPORT_FLAT;
--        } else if (strcmp(currentDesktop, "i3") == 0) {
-+        } else if (strstr(currentDesktop, "i3") != nullptr) {
-             sCSDSupportLevel = CSD_SUPPORT_NONE;
-+        } else if (strstr(currentDesktop, "MATE") != nullptr) {
-+            sCSDSupportLevel = CSD_SUPPORT_FLAT;
-+        } else if (strstr(currentDesktop, "Unity") != nullptr) {
-+            sCSDSupportLevel = CSD_SUPPORT_FLAT;
-+        } else if (strstr(currentDesktop, "Pantheon") != nullptr) {
-+            sCSDSupportLevel = CSD_SUPPORT_FULL;
-         } else {
-+            sCSDSupportLevel = CSD_SUPPORT_FLAT;
-+        }
-+    } else {
-+        sCSDSupportLevel = CSD_SUPPORT_NONE;
-+    }
-+
-+    // We don't support CSD_SUPPORT_FULL on Wayland
-+    if (!GDK_IS_X11_DISPLAY(gdk_display_get_default()) &&
-+        sCSDSupportLevel == CSD_SUPPORT_FULL) {
-+        sCSDSupportLevel = CSD_SUPPORT_FLAT;
-+    }
-+
-+    // Allow MOZ_GTK_TITLEBAR_DECORATION to override our heuristics
-+    const char* decorationOverride = getenv("MOZ_GTK_TITLEBAR_DECORATION");
-+    if (decorationOverride) {
-+        if (strcmp(decorationOverride, "none") == 0) {
-             sCSDSupportLevel = CSD_SUPPORT_NONE;
-+        } else if (strcmp(decorationOverride, "client") == 0) {
-+            sCSDSupportLevel = CSD_SUPPORT_FLAT;
-+        } else if (strcmp(decorationOverride, "system") == 0) {
-+            sCSDSupportLevel = CSD_SUPPORT_FULL;
-         }
-     }
-+
-     return sCSDSupportLevel;
- }
- 
-@@ -6991,3 +6953,24 @@ nsWindow::IsComposited() const
-          (gdk_window_get_visual(mGdkWindow)
-             == gdk_screen_get_rgba_visual(gdkScreen));
- }
-+
-+#ifdef MOZ_WAYLAND
-+wl_display*
-+nsWindow::GetWaylandDisplay()
-+{
-+  // Available as of GTK 3.8+
-+  static auto sGdkWaylandDisplayGetWlDisplay =
-+      (wl_display *(*)(GdkDisplay *))
-+      dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_wl_display");
-+
-+  GdkDisplay* gdkDisplay = gdk_display_get_default();
-+  return mIsX11Display ? nullptr :
-+                         sGdkWaylandDisplayGetWlDisplay(gdkDisplay);
-+}
-+
-+wl_surface*
-+nsWindow::GetWaylandSurface()
-+{
-+  return moz_container_get_wl_surface(MOZ_CONTAINER(mContainer));
-+}
-+#endif
-diff -up firefox-58.0/widget/gtk/nsWindow.h.1399611 firefox-58.0/widget/gtk/nsWindow.h
---- firefox-58.0/widget/gtk/nsWindow.h.1399611	2018-01-11 21:17:06.000000000 +0100
-+++ firefox-58.0/widget/gtk/nsWindow.h	2018-01-24 10:57:03.720031943 +0100
-@@ -23,7 +23,11 @@
- 
- #ifdef MOZ_X11
- #include <gdk/gdkx.h>
-+#include "X11UndefineNone.h"
- #endif /* MOZ_X11 */
-+#ifdef MOZ_WAYLAND
-+#include <gdk/gdkwayland.h>
-+#endif
- 
- #include "mozilla/widget/WindowSurface.h"
- #include "mozilla/widget/WindowSurfaceProvider.h"
-@@ -172,11 +176,7 @@ public:
-     GdkRectangle DevicePixelsToGdkRectRoundOut(LayoutDeviceIntRect aRect);
- 
-     // event callbacks
--#if (MOZ_WIDGET_GTK == 2)
--    gboolean           OnExposeEvent(GdkEventExpose *aEvent);
--#else
-     gboolean           OnExposeEvent(cairo_t *cr);
--#endif
-     gboolean           OnConfigureEvent(GtkWidget *aWidget,
-                                         GdkEventConfigure *aEvent);
-     void               OnContainerUnrealize();
-@@ -315,10 +315,6 @@ public:
-    nsresult            UpdateTranslucentWindowAlphaInternal(const nsIntRect& aRect,
-                                                             uint8_t* aAlphas, int32_t aStride);
- 
--#if (MOZ_WIDGET_GTK == 2)
--    static already_AddRefed<DrawTarget> GetDrawTargetForGdkDrawable(GdkDrawable* aDrawable,
--                                                                    const mozilla::gfx::IntSize& aSize);
--#endif
-     virtual void       ReparentNativeWidget(nsIWidget* aNewParent) override;
- 
-     virtual nsresult SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
-@@ -348,9 +344,14 @@ public:
-                                                 nsIObserver* aObserver) override;
- #endif
- 
-+
- #ifdef MOZ_X11
-     Display* XDisplay() { return mXDisplay; }
- #endif
-+#ifdef MOZ_WAYLAND
-+    wl_display* GetWaylandDisplay();
-+    wl_surface* GetWaylandSurface();
-+#endif
-     virtual void GetCompositorWidgetInitData(mozilla::widget::CompositorWidgetInitData* aInitData) override;
- 
-     virtual nsresult SetNonClientMargins(LayoutDeviceIntMargin& aMargins) override;
-@@ -374,6 +375,18 @@ public:
-     virtual bool WidgetTypeSupportsAcceleration() override;
- 
-     bool DoDrawTitlebar() const;
-+
-+    typedef enum { CSD_SUPPORT_FULL,    // CSD including shadows
-+                   CSD_SUPPORT_FLAT,    // CSD without shadows
-+                   CSD_SUPPORT_NONE,    // WM does not support CSD at all
-+                   CSD_SUPPORT_UNKNOWN
-+    } CSDSupportLevel;
-+    /**
-+     * Get the support of Client Side Decoration by checking
-+     * the XDG_CURRENT_DESKTOP environment variable.
-+     */
-+    static CSDSupportLevel GetCSDSupportLevel();
-+
- protected:
-     virtual ~nsWindow();
- 
-@@ -423,6 +436,7 @@ private:
-     nsWindow          *GetContainerWindow();
-     void               SetUrgencyHint(GtkWidget *top_window, bool state);
-     void               SetDefaultIcon(void);
-+    void               SetWindowDecoration(nsBorderStyle aStyle);
-     void               InitButtonEvent(mozilla::WidgetMouseEvent& aEvent,
-                                        GdkEventButton* aGdkEvent);
-     bool               DispatchCommandEvent(nsAtom* aCommand);
-@@ -441,7 +455,6 @@ private:
-     nsIWidgetListener* GetListener();
-     bool               IsComposited() const;
- 
--
-     GtkWidget          *mShell;
-     MozContainer       *mContainer;
-     GdkWindow          *mGdkWindow;
-@@ -578,16 +591,6 @@ private:
-     RefPtr<mozilla::widget::IMContextWrapper> mIMContext;
- 
-     mozilla::UniquePtr<mozilla::CurrentX11TimeGetter> mCurrentTimeGetter;
--    typedef enum { CSD_SUPPORT_FULL,    // CSD including shadows
--                   CSD_SUPPORT_FLAT,    // CSD without shadows
--                   CSD_SUPPORT_NONE,    // WM does not support CSD at all
--                   CSD_SUPPORT_UNKNOWN
--    } CSDSupportLevel;
--    /**
--     * Get the support of Client Side Decoration by checking
--     * the XDG_CURRENT_DESKTOP environment variable.
--     */
--    static CSDSupportLevel GetCSDSupportLevel();
-     static CSDSupportLevel sCSDSupportLevel;
- };
- 
--- a/mozilla-idldir.patch	Fri Feb 09 13:28:07 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-# HG changeset patch
-# Parent 1cd1e78dfe63c1a7bcfc0707697bb99bcfea19c4
-# User Wolfgang Rosenauer <wr@rosenauer.org>
-# Parent  a3ba03360353036e15ec6d275c14d82d783c53f5
-Install IDL files to includedir instead of /usr/share/idl
-
-diff --git a/config/baseconfig.mk b/config/baseconfig.mk
---- a/config/baseconfig.mk
-+++ b/config/baseconfig.mk
-@@ -1,14 +1,14 @@
- # This file is normally included by autoconf.mk, but it is also used
- # directly in python/mozbuild/mozbuild/base.py for gmake validation.
- # We thus use INCLUDED_AUTOCONF_MK to enable/disable some parts depending
- # whether a normal build is happening or whether the check is running.
- includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
--idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
-+idldir = $(includedir)
- installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
- sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
- ifeq (.,$(DEPTH))
- DIST = dist
- else
- DIST = $(DEPTH)/dist
- endif
- ABS_DIST = $(topobjdir)/dist
--- a/mozilla-kde.patch	Fri Feb 09 13:28:07 2018 +0100
+++ b/mozilla-kde.patch	Fri Feb 09 16:30:49 2018 +0100
@@ -1,5 +1,5 @@
 # HG changeset patch
-# Parent  5be2231eadfb6de978e93c0ba95469e8a4d54cb0
+# Parent  0a40cd14044b87117b99763e7a155b6deb5ab180
 Description: Add KDE integration to Firefox (toolkit parts)
 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
 Author: Lubos Lunak <lunak@suse.com>
@@ -9,7 +9,7 @@
 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
 --- a/modules/libpref/Preferences.cpp
 +++ b/modules/libpref/Preferences.cpp
-@@ -75,16 +75,17 @@
+@@ -76,16 +76,17 @@
  #include "nsXPCOMCID.h"
  #include "nsXPCOM.h"
  #include "nsXULAppAPI.h"
@@ -20,68 +20,14 @@
  #include "prlink.h"
 +#include "nsKDEUtils.h"
  
- #ifdef MOZ_CRASHREPORTER
- #include "nsICrashReporter.h"
- #endif
- 
  #ifdef XP_WIN
  #include "windows.h"
  #endif
-@@ -4324,16 +4325,34 @@ pref_LoadPrefsInDirList(const char* aLis
- {
-   nsresult rv;
-   nsCOMPtr<nsIProperties> dirSvc(
-     do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
-   if (NS_FAILED(rv)) {
-     return rv;
-   }
+ 
+ using namespace mozilla;
  
-+  // make sure we load these special files after all the others
-+  static const char* specialFiles[] = {
-+#if defined(XP_UNIX)
-+    ""
-+#endif
-+  };
-+
-+  if (nsKDEUtils::kdeSession()) {
-+    for(int i = 0;
-+        i < MOZ_ARRAY_LENGTH(specialFiles);
-+        ++i ) {
-+      if (*specialFiles[ i ] == '\0') {
-+        specialFiles[ i ] = "kde.js";
-+        break;
-+      }
-+    }
-+  }
-+
-   nsCOMPtr<nsISimpleEnumerator> list;
-   dirSvc->Get(aListId, NS_GET_IID(nsISimpleEnumerator), getter_AddRefs(list));
-   if (!list) {
-     return NS_OK;
-   }
- 
-   bool hasMore;
-   while (NS_SUCCEEDED(list->HasMoreElements(&hasMore)) && hasMore) {
-@@ -4344,17 +4363,17 @@ pref_LoadPrefsInDirList(const char* aLis
-     }
- 
-     nsCOMPtr<nsIFile> path = do_QueryInterface(elem);
-     if (!path) {
-       continue;
-     }
- 
-     // Do we care if a file provided by this process fails to load?
--    pref_LoadPrefsInDir(path, nullptr, 0);
-+    pref_LoadPrefsInDir(path, specialFiles, ArrayLength(specialFiles));
-   }
- 
-   return NS_OK;
- }
- 
- static nsresult
- pref_ReadPrefFromJar(nsZipArchive* aJarReader, const char* aName)
- {
-@@ -4461,25 +4480,37 @@ pref_InitInitialObjects()
+ #ifdef DEBUG
+@@ -4235,25 +4236,37 @@ Preferences::InitInitialObjects()
    // application pref files for backwards compatibility.
    static const char* specialFiles[] = {
  #if defined(XP_MACOSX)
@@ -119,6 +65,25 @@
  
    // Load jar:$app/omni.jar!/defaults/preferences/*.js
    // or jar:$gre/omni.jar!/defaults/preferences/*.js.
+@@ -4302,17 +4315,17 @@ Preferences::InitInitialObjects()
+       }
+ 
+       nsCOMPtr<nsIFile> path = do_QueryInterface(elem);
+       if (!path) {
+         continue;
+       }
+ 
+       // Do we care if a file provided by this process fails to load?
+-      pref_LoadPrefsInDir(path, nullptr, 0);
++      pref_LoadPrefsInDir(path, specialFiles, ArrayLength(specialFiles));
+     }
+   }
+ 
+ #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
@@ -205,11 +170,11 @@
 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
 --- a/toolkit/content/jar.mn
 +++ b/toolkit/content/jar.mn
-@@ -75,29 +75,33 @@ toolkit.jar:
+@@ -67,16 +67,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/datetimepicker.xml  (widgets/datetimepicker.xml)
     content/global/bindings/datetimepopup.xml   (widgets/datetimepopup.xml)
     content/global/bindings/datetimebox.xml     (widgets/datetimebox.xml)
     content/global/bindings/datetimebox.css     (widgets/datetimebox.css)
@@ -217,7 +182,6 @@
 +*  content/global/bindings/dialog-kde.xml      (widgets/dialog-kde.xml)
 +% override chrome://global/content/bindings/dialog.xml chrome://global/content/bindings/dialog-kde.xml desktop=kde
     content/global/bindings/editor.xml          (widgets/editor.xml)
-    content/global/bindings/expander.xml        (widgets/expander.xml)
     content/global/bindings/filefield.xml       (widgets/filefield.xml)
  *  content/global/bindings/findbar.xml         (widgets/findbar.xml)
     content/global/bindings/general.xml         (widgets/general.xml)
@@ -225,30 +189,20 @@
     content/global/bindings/listbox.xml         (widgets/listbox.xml)
     content/global/bindings/menu.xml            (widgets/menu.xml)
     content/global/bindings/menulist.xml        (widgets/menulist.xml)
-    content/global/bindings/notification.xml    (widgets/notification.xml)
-    content/global/bindings/numberbox.xml       (widgets/numberbox.xml)
-    content/global/bindings/popup.xml           (widgets/popup.xml)
- *  content/global/bindings/preferences.xml     (widgets/preferences.xml)
-+*  content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml)
-+% override chrome://global/content/bindings/preferences.xml chrome://global/content/bindings/preferences-kde.xml desktop=kde
-    content/global/bindings/progressmeter.xml   (widgets/progressmeter.xml)
-    content/global/bindings/radio.xml           (widgets/radio.xml)
-    content/global/bindings/remote-browser.xml  (widgets/remote-browser.xml)
-    content/global/bindings/resizer.xml         (widgets/resizer.xml)
-    content/global/bindings/richlistbox.xml     (widgets/richlistbox.xml)
-    content/global/bindings/scale.xml           (widgets/scale.xml)
-    content/global/bindings/scrollbar.xml       (widgets/scrollbar.xml)
-    content/global/bindings/scrollbox.xml       (widgets/scrollbox.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,459 @@
+@@ -0,0 +1,477 @@
 +<?xml version="1.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/. -->
 +
++<!DOCTYPE bindings [
++  <!ENTITY % globalKeysDTD SYSTEM "chrome://global/locale/globalKeys.dtd">
++  %globalKeysDTD;
++]>
 +
 +<bindings id="dialogBindings"
 +          xmlns="http://www.mozilla.org/xbl"
@@ -295,6 +249,16 @@
 +        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
 +#endif
 +      </xul:hbox>
++
++    <xul:keyset>
++      <xul:key phase="capturing" oncommand="document.documentElement.openHelp(event)"
++#ifdef XP_MACOSX
++           key="&openHelpMac.commandkey;" modifiers="accel"/>
++#else
++           keycode="&openHelp.commandkey;"/>
++#endif
++    </xul:keyset>
++
 +    </content>
 +
 +    <implementation>
@@ -313,7 +277,7 @@
 +        <![CDATA[
 +          if (this.hasAttribute("defaultButton"))
 +            return this.getAttribute("defaultButton");
-+          return "accept";  // default to the accept button
++          return "accept"; // default to the accept button
 +        ]]>
 +        </getter>
 +        <setter>
@@ -464,6 +428,20 @@
 +        </body>
 +      </method>
 +
++      <method name="openHelp">
++        <parameter name="event"/>
++        <body>
++        <![CDATA[
++          var helpButton = document.documentElement.getButton("help");
++          if (helpButton.disabled || helpButton.hidden)
++            return;
++          this._fireButtonEvent("help");
++          event.stopPropagation();
++          event.preventDefault();
++        ]]>
++        </body>
++      </method>
++
 +      <property name="mStrBundle">
 +        <getter>
 +        <![CDATA[
@@ -692,1431 +670,7 @@
 +
 +  </binding>
 +
-+  <binding id="dialogheader">
-+    <resources>
-+      <stylesheet src="chrome://global/skin/dialog.css"/>
-+    </resources>
-+    <content>
-+      <xul:label class="dialogheader-title" xbl:inherits="value=title,crop" crop="right" flex="1"/>
-+      <xul:label class="dialogheader-description" xbl:inherits="value=description"/>
-+    </content>
-+  </binding>
-+
 +</bindings>
-diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widgets/preferences-kde.xml
-new file mode 100644
---- /dev/null
-+++ b/toolkit/content/widgets/preferences-kde.xml
-@@ -0,0 +1,1409 @@
-+<?xml version="1.0"?>
-+
-+<!DOCTYPE bindings [
-+  <!ENTITY % preferencesDTD SYSTEM "chrome://global/locale/preferences.dtd">
-+  %preferencesDTD;
-+  <!ENTITY % globalKeysDTD SYSTEM "chrome://global/locale/globalKeys.dtd">
-+  %globalKeysDTD;
-+]>
-+
-+<bindings id="preferencesBindings"
-+          xmlns="http://www.mozilla.org/xbl"
-+          xmlns:xbl="http://www.mozilla.org/xbl"
-+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-+
-+#
-+# = Preferences Window Framework
-+#
-+#   The syntax for use looks something like:
-+#
-+#   <prefwindow>
-+#     <prefpane id="prefPaneA">
-+#       <preferences>
-+#         <preference id="preference1" name="app.preference1" type="bool" onchange="foo();"/>
-+#         <preference id="preference2" name="app.preference2" type="bool" useDefault="true"/>
-+#       </preferences>
-+#       <checkbox label="Preference" preference="preference1"/>
-+#     </prefpane>
-+#   </prefwindow>
-+#
-+
-+  <binding id="preferences">
-+    <implementation implements="nsIObserver">
-+      <method name="_constructAfterChildren">
-+      <body>
-+      <![CDATA[
-+      // This method will be called after the last of the child
-+      // <preference> elements is constructed. Its purpose is to propagate
-+      // the values to the associated form elements. Sometimes the code for
-+      // some <preference> initializers depend on other <preference> elements
-+      // being initialized so we wait and call updateElements on all of them
-+      // once the last one has been constructed. See bugs 997570 and 992185.
-+
-+      var elements = this.getElementsByTagName("preference");
-+      for (let element of elements) {
-+        element.updateElements();
-+      }
-+
-+      this._constructAfterChildrenCalled = true;
-+      ]]>
-+      </body>
-+      </method>
-+      <method name="observe">
-+        <parameter name="aSubject"/>
-+        <parameter name="aTopic"/>
-+        <parameter name="aData"/>
-+        <body>
-+        <![CDATA[
-+          for (var i = 0; i < this.childNodes.length; ++i) {
-+            var preference = this.childNodes[i];
-+            if (preference.name == aData) {
-+              preference.value = preference.valueFromPreferences;
-+            }
-+          }
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <method name="fireChangedEvent">
-+        <parameter name="aPreference"/>
-+        <body>
-+        <![CDATA[
-+          // Value changed, synthesize an event
-+          try {
-+            var event = document.createEvent("Events");
-+            event.initEvent("change", true, true);
-+            aPreference.dispatchEvent(event);
-+          } catch (e) {
-+            Components.utils.reportError(e);
-+          }
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <field name="service">
-+        Components.classes["@mozilla.org/preferences-service;1"]
-+                  .getService(Components.interfaces.nsIPrefService);
-+      </field>
-+      <field name="rootBranch">
-+        Components.classes["@mozilla.org/preferences-service;1"]
-+                  .getService(Components.interfaces.nsIPrefBranch);
-+      </field>
-+      <field name="defaultBranch">
-+        this.service.getDefaultBranch("");
-+      </field>
-+      <field name="rootBranchInternal">
-+        Components.classes["@mozilla.org/preferences-service;1"]
-+                  .getService(Components.interfaces.nsIPrefBranch);
-+      </field>
-+      <property name="type" readonly="true">
-+        <getter>
-+          <![CDATA[
-+            return document.documentElement.type || "";
-+          ]]>
-+        </getter>
-+      </property>
-+      <property name="instantApply" readonly="true">
-+        <getter>
-+          <![CDATA[
-+            var doc = document.documentElement;
-+            return this.type == "child" ? doc.instantApply
-+                                        : doc.instantApply || this.rootBranch.getBoolPref("browser.preferences.instantApply");
-+          ]]>
-+        </getter>
-+      </property>
-+
-+      <!-- We want to call _constructAfterChildren after all child
-+           <preference> elements have been constructed. To do this, we get
-+           and store the node list of all child <preference> elements in the
-+           constructor, and maintain a count which is incremented in the
-+           constructor of <preference>. _constructAfterChildren is called
-+           when the count matches the length of the list. -->
-+      <field name="_constructedChildrenCount">0</field>
-+      <field name="_preferenceChildren">null</field>
-+      <!-- Some <preference> elements are added dynamically after
-+           _constructAfterChildren has already been called - we want to
-+           avoid looping over all of them again in this case so we remember
-+           if we already called it. -->
-+      <field name="_constructAfterChildrenCalled">false</field>
-+      <constructor>
-+      <![CDATA[
-+        this._preferenceChildren = this.getElementsByTagName("preference");
-+      ]]>
-+      </constructor>
-+    </implementation>
-+  </binding>
-+
-+  <binding id="preference">
-+    <implementation>
-+      <constructor>
-+      <![CDATA[
-+        // if the element has been inserted without the name attribute set,
-+        // we have nothing to do here
-+        if (!this.name)
-+          return;
-+
-+        this.preferences.rootBranchInternal
-+            .addObserver(this.name, this.preferences);
-+        // In non-instant apply mode, we must try and use the last saved state
-+        // from any previous opens of a child dialog instead of the value from
-+        // preferences, to pick up any edits a user may have made.
-+
-+        var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
-+                    .getService(Components.interfaces.nsIScriptSecurityManager);
-+        if (this.preferences.type == "child" &&
-+            !this.instantApply && window.opener &&
-+            secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {
-+          var pdoc = window.opener.document;
-+
-+          // Try to find a preference element for the same preference.
-+          var preference = null;
-+          var parentPreferences = pdoc.getElementsByTagName("preferences");
-+          for (var k = 0; (k < parentPreferences.length && !preference); ++k) {
-+            var parentPrefs = parentPreferences[k]
-+                                    .getElementsByAttribute("name", this.name);
-+            for (var l = 0; (l < parentPrefs.length && !preference); ++l) {
-+              if (parentPrefs[l].localName == "preference")
-+                preference = parentPrefs[l];
-+            }
-+          }
-+
-+          // Don't use the value setter here, we don't want updateElements to be prematurely fired.
-+          this._value = preference ? preference.value : this.valueFromPreferences;
-+        } else {
-+          this._value = this.valueFromPreferences;
-+        }
-+        if (this.preferences._constructAfterChildrenCalled) {
-+          // This <preference> was added after _constructAfterChildren() was already called.
-+          // We can directly call updateElements().
-+          this.updateElements();
-+          return;
-+        }
-+        this.preferences._constructedChildrenCount++;
-+        if (this.preferences._constructedChildrenCount ==
-+            this.preferences._preferenceChildren.length) {
-+          // This is the last <preference>, time to updateElements() on all of them.
-+          this.preferences._constructAfterChildren();
-+        }
-+      ]]>
-+      </constructor>
-+      <destructor>
-+        this.preferences.rootBranchInternal
-+            .removeObserver(this.name, this.preferences);
-+      </destructor>
-+      <field name="_constructed">false</field>
-+      <property name="instantApply">
-+        <getter>
-+          if (this.getAttribute("instantApply") == "false")
-+            return false;
-+          return this.getAttribute("instantApply") == "true" || this.preferences.instantApply;
-+        </getter>
-+      </property>
-+
-+      <property name="preferences" onget="return this.parentNode"/>
-+      <property name="name" onget="return this.getAttribute('name');">
-+        <setter>
-+          if (val == this.name)
-+            return val;
-+
-+          this.preferences.rootBranchInternal
-+              .removeObserver(this.name, this.preferences);
-+          this.setAttribute("name", val);
-+          this.preferences.rootBranchInternal
-+              .addObserver(val, this.preferences);
-+
-+          return val;
-+        </setter>
-+      </property>
-+      <property name="type" onget="return this.getAttribute('type');"
-+                            onset="this.setAttribute('type', val); return val;"/>
-+      <property name="inverted" onget="return this.getAttribute('inverted') == 'true';"
-+                                onset="this.setAttribute('inverted', val); return val;"/>
-+      <property name="readonly" onget="return this.getAttribute('readonly') == 'true';"
-+                                onset="this.setAttribute('readonly', val); return val;"/>
-+
-+      <field name="_value">null</field>
-+      <method name="_setValue">
-+        <parameter name="aValue"/>
-+        <body>
-+        <![CDATA[
-+          if (this.value !== aValue) {
-+            this._value = aValue;
-+            if (this.instantApply)
-+              this.valueFromPreferences = aValue;
-+            this.preferences.fireChangedEvent(this);
-+          }
-+          return aValue;
-+        ]]>
-+        </body>
-+      </method>
-+      <property name="value" onget="return this._value" onset="return this._setValue(val);"/>
-+
-+      <property name="locked">
-+        <getter>
-+          return this.preferences.rootBranch.prefIsLocked(this.name);
-+        </getter>
-+      </property>
-+
-+      <property name="disabled">
-+        <getter>
-+          return this.getAttribute("disabled") == "true";
-+        </getter>
-+        <setter>
-+        <![CDATA[
-+          if (val)
-+            this.setAttribute("disabled", "true");
-+          else
-+            this.removeAttribute("disabled");
-+
-+          if (!this.id)
-+            return val;
-+
-+          var elements = document.getElementsByAttribute("preference", this.id);
-+          for (var i = 0; i < elements.length; ++i) {
-+            elements[i].disabled = val;
-+
-+            var labels = document.getElementsByAttribute("control", elements[i].id);
-+            for (var j = 0; j < labels.length; ++j)
-+              labels[j].disabled = val;
-+          }
-+
-+          return val;
-+        ]]>
-+        </setter>
-+      </property>
-+
-+      <property name="tabIndex">
-+        <getter>
-+          return parseInt(this.getAttribute("tabindex"));
-+        </getter>
-+        <setter>
-+        <![CDATA[
-+          if (val)
-+            this.setAttribute("tabindex", val);
-+          else
-+            this.removeAttribute("tabindex");
-+
-+          if (!this.id)
-+            return val;
-+
-+          var elements = document.getElementsByAttribute("preference", this.id);
-+          for (var i = 0; i < elements.length; ++i) {
-+            elements[i].tabIndex = val;
-+
-+            var labels = document.getElementsByAttribute("control", elements[i].id);
-+            for (var j = 0; j < labels.length; ++j)
-+              labels[j].tabIndex = val;
-+          }
-+
-+          return val;
-+        ]]>
-+        </setter>
-+      </property>
-+
-+      <property name="hasUserValue">
-+        <getter>
-+        <![CDATA[
-+          return this.preferences.rootBranch.prefHasUserValue(this.name) &&
-+                 this.value !== undefined;
-+        ]]>
-+        </getter>
-+      </property>
-+
-+      <method name="reset">
-+        <body>
-+          // defer reset until preference update
-+          this.value = undefined;
-+        </body>
-+      </method>
-+
-+      <field name="_useDefault">false</field>
-+      <property name="defaultValue">
-+        <getter>
-+        <![CDATA[
-+          this._useDefault = true;
-+          var val = this.valueFromPreferences;
-+          this._useDefault = false;
-+          return val;
-+        ]]>
-+        </getter>
-+      </property>
-+
-+      <property name="_branch">
-+        <getter>
-+          return this._useDefault ? this.preferences.defaultBranch : this.preferences.rootBranch;
-+        </getter>
-+      </property>
-+
-+      <field name="batching">false</field>
-+
-+      <method name="_reportUnknownType">
-+        <body>
-+        <![CDATA[
-+          var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
-+                                         .getService(Components.interfaces.nsIConsoleService);
-+          var msg = "<preference> with id='" + this.id + "' and name='" +
-+                    this.name + "' has unknown type '" + this.type + "'.";
-+          consoleService.logStringMessage(msg);
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <property name="valueFromPreferences">
-+        <getter>
-+        <![CDATA[
-+          try {
-+            // Force a resync of value with preferences.
-+            switch (this.type) {
-+            case "int":
-+              return this._branch.getIntPref(this.name);
-+            case "bool":
-+              var val = this._branch.getBoolPref(this.name);
-+              return this.inverted ? !val : val;
-+            case "wstring":
-+              return this._branch
-+                         .getComplexValue(this.name, Components.interfaces.nsIPrefLocalizedString)
-+                         .data;
-+            case "string":
-+            case "unichar":
-+              return this._branch.getStringPref(this.name);
-+            case "fontname":
-+              var family = this._branch.getStringPref(this.name);
-+              var fontEnumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"]
-+                                             .createInstance(Components.interfaces.nsIFontEnumerator);
-+              return fontEnumerator.getStandardFamilyName(family);
-+            case "file":
-+              var f = this._branch
-+                          .getComplexValue(this.name, Components.interfaces.nsIFile);
-+              return f;
-+            default:
-+              this._reportUnknownType();
-+            }
-+          } catch (e) { }
-+          return null;
-+        ]]>
-+        </getter>
-+        <setter>
-+        <![CDATA[
-+          // Exit early if nothing to do.
-+          if (this.readonly || this.valueFromPreferences == val)
-+            return val;
-+
-+          // The special value undefined means 'reset preference to default'.
-+          if (val === undefined) {
-+            this.preferences.rootBranch.clearUserPref(this.name);
-+            return val;
-+          }
-+
-+          // Force a resync of preferences with value.
-+          switch (this.type) {
-+          case "int":
-+            this.preferences.rootBranch.setIntPref(this.name, val);
-+            break;
-+          case "bool":
-+            this.preferences.rootBranch.setBoolPref(this.name, this.inverted ? !val : val);
-+            break;
-+          case "wstring":
-+            var pls = Components.classes["@mozilla.org/pref-localizedstring;1"]
-+                                .createInstance(Components.interfaces.nsIPrefLocalizedString);
-+            pls.data = val;
-+            this.preferences.rootBranch
-+                .setComplexValue(this.name, Components.interfaces.nsIPrefLocalizedString, pls);
-+            break;
-+          case "string":
-+          case "unichar":
-+          case "fontname":
-+            this.preferences.rootBranch.setStringPref(this.name, val);
-+            break;
-+          case "file":
-+            var lf;
-+            if (typeof(val) == "string") {
-+              lf = Components.classes["@mozilla.org/file/local;1"]
-+                             .createInstance(Components.interfaces.nsIFile);
-+              lf.persistentDescriptor = val;
-+              if (!lf.exists())
-+                lf.initWithPath(val);
-+            } else
-+              lf = val.QueryInterface(Components.interfaces.nsIFile);
-+            this.preferences.rootBranch
-+                .setComplexValue(this.name, Components.interfaces.nsIFile, lf);
-+            break;
-+          default:
-+            this._reportUnknownType();
-+          }
-+          if (!this.batching)
-+            this.preferences.service.savePrefFile(null);
-+          return val;
-+        ]]>
-+        </setter>
-+      </property>
-+
-+      <method name="setElementValue">
-+        <parameter name="aElement"/>
-+        <body>
-+        <![CDATA[
-+          if (this.locked)
-+            aElement.disabled = true;
-+
-+          if (!this.isElementEditable(aElement))
-+            return;
-+
-+          var rv = undefined;
-+          if (aElement.hasAttribute("onsyncfrompreference")) {
-+            // Value changed, synthesize an event
-+            try {
-+              var event = document.createEvent("Events");
-+              event.initEvent("syncfrompreference", true, true);
-+              var f = new Function("event",
-+                                   aElement.getAttribute("onsyncfrompreference"));
-+              rv = f.call(aElement, event);
-+            } catch (e) {
-+              Components.utils.reportError(e);
-+            }
-+          }
-+          var val = rv;
-+          if (val === undefined)
-+            val = this.instantApply ? this.valueFromPreferences : this.value;
-+          // if the preference is marked for reset, show default value in UI
-+          if (val === undefined)
-+            val = this.defaultValue;
-+
-+          /**
-+           * Initialize a UI element property with a value. Handles the case
-+           * where an element has not yet had a XBL binding attached for it and
-+           * the property setter does not yet exist by setting the same attribute
-+           * on the XUL element using DOM apis and assuming the element's
-+           * constructor or property getters appropriately handle this state.
-+           */
-+          function setValue(element, attribute, value) {
-+            if (attribute in element)
-+              element[attribute] = value;
-+            else
-+              element.setAttribute(attribute, value);
-+          }
-+          if (aElement.localName == "checkbox" ||
-+              aElement.localName == "listitem")
-+            setValue(aElement, "checked", val);
-+          else if (aElement.localName == "colorpicker")
-+            setValue(aElement, "color", val);
-+          else if (aElement.localName == "textbox") {
-+            // XXXmano Bug 303998: Avoid a caret placement issue if either the
-+            // preference observer or its setter calls updateElements as a result
-+            // of the input event handler.
-+            if (aElement.value !== val)
-+              setValue(aElement, "value", val);
-+          } else
-+            setValue(aElement, "value", val);
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <method name="getElementValue">
-+        <parameter name="aElement"/>
-+        <body>
-+        <![CDATA[
-+          if (aElement.hasAttribute("onsynctopreference")) {
-+            // Value changed, synthesize an event
-+            try {
-+              var event = document.createEvent("Events");
-+              event.initEvent("synctopreference", true, true);
-+              var f = new Function("event",
-+                                   aElement.getAttribute("onsynctopreference"));
-+              var rv = f.call(aElement, event);
-+              if (rv !== undefined)
-+                return rv;
-+            } catch (e) {
-+              Components.utils.reportError(e);
-+            }
-+          }
-+
-+          /**
-+           * Read the value of an attribute from an element, assuming the
-+           * attribute is a property on the element's node API. If the property
-+           * is not present in the API, then assume its value is contained in
-+           * an attribute, as is the case before a binding has been attached.
-+           */
-+          function getValue(element, attribute) {
-+            if (attribute in element)
-+              return element[attribute];
-+            return element.getAttribute(attribute);
-+          }
-+          if (aElement.localName == "checkbox" ||
-+              aElement.localName == "listitem")
-+            var value = getValue(aElement, "checked");
-+          else if (aElement.localName == "colorpicker")
-+            value = getValue(aElement, "color");
-+          else
-+            value = getValue(aElement, "value");
-+
-+          switch (this.type) {
-+          case "int":
-+            return parseInt(value, 10) || 0;
-+          case "bool":
-+            return typeof(value) == "boolean" ? value : value == "true";
-+          }
-+          return value;
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <method name="isElementEditable">
-+        <parameter name="aElement"/>
-+        <body>
-+        <![CDATA[
-+          switch (aElement.localName) {
-+          case "checkbox":
-+          case "colorpicker":
-+          case "radiogroup":
-+          case "textbox":
-+          case "listitem":
-+          case "listbox":
-+          case "menulist":
-+            return true;
-+          }
-+          return aElement.getAttribute("preference-editable") == "true";
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <method name="updateElements">
-+        <body>
-+        <![CDATA[
-+          if (!this.id)
-+            return;
-+
-+          // This "change" event handler tracks changes made to preferences by
-+          // sources other than the user in this window.
-+          var elements = document.getElementsByAttribute("preference", this.id);
-+          for (var i = 0; i < elements.length; ++i)
-+            this.setElementValue(elements[i]);
-+        ]]>
-+        </body>
-+      </method>
-+    </implementation>
-+
-+    <handlers>
-+      <handler event="change">
-+        this.updateElements();
-+      </handler>
-+    </handlers>
-+  </binding>
-+
-+  <binding id="prefwindow"
-+           extends="chrome://global/content/bindings/dialog.xml#dialog">
-+    <resources>
-+      <stylesheet src="chrome://global/skin/preferences.css"/>
-+    </resources>
-+    <content dlgbuttons="accept,cancel" persist="lastSelected screenX screenY"
-+             closebuttonlabel="&preferencesCloseButton.label;"
-+             closebuttonaccesskey="&preferencesCloseButton.accesskey;"
-+             role="dialog"
-+#ifdef XP_WIN
-+             title="&preferencesDefaultTitleWin.title;">
-+#else
-+             title="&preferencesDefaultTitleMac.title;">
-+#endif
-+      <xul:windowdragbox orient="vertical">
-+        <xul:radiogroup anonid="selector" orient="horizontal" class="paneSelector chromeclass-toolbar"
-+                        role="listbox"/> <!-- Expose to accessibility APIs as a listbox -->
-+      </xul:windowdragbox>
-+      <xul:hbox flex="1" class="paneDeckContainer">
-+        <xul:deck anonid="paneDeck" flex="1">
-+          <children includes="prefpane"/>
-+        </xul:deck>
-+      </xul:hbox>
-+      <xul:hbox anonid="dlg-buttons" class="prefWindow-dlgbuttons" pack="end">
-+#ifndef XP_UNIX
-+        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
-+        <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/>
-+        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
-+        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
-+        <xul:spacer anonid="spacer" flex="1"/>
-+        <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/>
-+        <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
-+#else
-+        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
-+        <xul:spacer anonid="spacer" flex="1"/>
-+        <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
-+        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
-+        <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/>
-+        <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/>
-+        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
-+#endif
-+      </xul:hbox>
-+      <xul:hbox>
-+        <children/>
-+      </xul:hbox>
-+    </content>
-+    <implementation implements="nsITimerCallback">
-+      <constructor>
-+      <![CDATA[
-+        if (this.type != "child") {
-+          if (!this._instantApplyInitialized) {
-+            let psvc = Components.classes["@mozilla.org/preferences-service;1"]
-+                                 .getService(Components.interfaces.nsIPrefBranch);
-+            this.instantApply = psvc.getBoolPref("browser.preferences.instantApply");
-+          }
-+          if (this.instantApply) {
-+            var docElt = document.documentElement;
-+            var acceptButton = docElt.getButton("accept");
-+            acceptButton.hidden = true;
-+            var cancelButton  = docElt.getButton("cancel");
-+            if (/Mac/.test(navigator.platform)) {
-+              // no buttons on Mac except Help
-+              cancelButton.hidden = true;
-+              // Move Help button to the end
-+              document.getAnonymousElementByAttribute(this, "anonid", "spacer").hidden = true;
-+              // Also, don't fire onDialogAccept on enter
-+              acceptButton.disabled = true;
-+            } else {
-+              // morph the Cancel button into the Close button
-+              cancelButton.setAttribute("icon", "close");
-+              cancelButton.label = docElt.getAttribute("closebuttonlabel");
-+              cancelButton.accesskey = docElt.getAttribute("closebuttonaccesskey");
-+            }
-+          }
-+        }
-+        this.setAttribute("animated", this._shouldAnimate ? "true" : "false");
-+        var panes = this.preferencePanes;
-+
-+        var lastPane = null;
-+        if (this.lastSelected) {
-+          lastPane = document.getElementById(this.lastSelected);
-+          if (!lastPane) {
-+            this.lastSelected = "";
-+          }
-+        }
-+
-+        var paneToLoad;
-+        if ("arguments" in window && window.arguments[0] && document.getElementById(window.arguments[0]) && document.getElementById(window.arguments[0]).nodeName == "prefpane") {
-+          paneToLoad = document.getElementById(window.arguments[0]);
-+          this.lastSelected = paneToLoad.id;
-+        } else if (lastPane)
-+          paneToLoad = lastPane;
-+        else
-+          paneToLoad = panes[0];
-+
-+        for (var i = 0; i < panes.length; ++i) {
-+          this._makePaneButton(panes[i]);
-+          if (panes[i].loaded) {
-+            // Inline pane content, fire load event to force initialization.
-+            this._fireEvent("paneload", panes[i]);
-+          }
-+        }
-+        this.showPane(paneToLoad);
-+
-+        if (panes.length == 1)
-+          this._selector.setAttribute("collapsed", "true");
-+      ]]>
-+      </constructor>
-+
-+      <destructor>
-+      <![CDATA[
-+        // Release timers to avoid reference cycles.
-+        if (this._animateTimer) {
-+          this._animateTimer.cancel();
-+          this._animateTimer = null;
-+        }
-+        if (this._fadeTimer) {
-+          this._fadeTimer.cancel();
-+          this._fadeTimer = null;
-+        }
-+      ]]>
-+      </destructor>
-+
-+      <!-- Derived bindings can set this to true to cause us to skip
-+           reading the browser.preferences.instantApply pref in the constructor.
-+           Then they can set instantApply to their wished value. -->
-+      <field name="_instantApplyInitialized">false</field>
-+      <!-- Controls whether changed pref values take effect immediately. -->
-+      <field name="instantApply">false</field>
-+
-+      <property name="preferencePanes"
-+                onget="return this.getElementsByTagName('prefpane');"/>
-+
-+      <property name="type" onget="return this.getAttribute('type');"/>
-+      <property name="_paneDeck"
-+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'paneDeck');"/>
-+      <property name="_paneDeckContainer"
-+                onget="return document.getAnonymousElementByAttribute(this, 'class', 'paneDeckContainer');"/>
-+      <property name="_selector"
-+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'selector');"/>
-+      <property name="lastSelected"
-+                onget="return this.getAttribute('lastSelected');">
-+        <setter>
-+          this.setAttribute("lastSelected", val);
-+          document.persist(this.id, "lastSelected");
-+          return val;
-+        </setter>
-+      </property>
-+      <property name="currentPane"
-+                onset="return this._currentPane = val;">
-+        <getter>
-+          if (!this._currentPane)
-+            this._currentPane = this.preferencePanes[0];
-+
-+          return this._currentPane;
-+        </getter>
-+      </property>
-+      <field name="_currentPane">null</field>
-+
-+
-+      <method name="_makePaneButton">
-+        <parameter name="aPaneElement"/>
-+        <body>
-+        <![CDATA[
-+          var radio = document.createElement("radio");
-+          radio.setAttribute("pane", aPaneElement.id);
-+          radio.setAttribute("label", aPaneElement.label);
-+          // Expose preference group choice to accessibility APIs as an unchecked list item
-+          // The parent group is exposed to accessibility APIs as a list
-+          if (aPaneElement.image)
-+            radio.setAttribute("src", aPaneElement.image);
-+          radio.style.listStyleImage = aPaneElement.style.listStyleImage;
-+          this._selector.appendChild(radio);
-+          return radio;
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <method name="showPane">
-+        <parameter name="aPaneElement"/>
-+        <body>
-+        <![CDATA[
-+          if (!aPaneElement)
-+            return;
-+
-+          this._selector.selectedItem = document.getAnonymousElementByAttribute(this, "pane", aPaneElement.id);
-+          if (!aPaneElement.loaded) {
-+            let OverlayLoadObserver = function(aPane) {
-+              this._pane = aPane;
-+            }
-+            OverlayLoadObserver.prototype = {
-+              _outer: this,
-+              observe(aSubject, aTopic, aData) {
-+                this._pane.loaded = true;
-+                this._outer._fireEvent("paneload", this._pane);
-+                this._outer._selectPane(this._pane);
-+              }
-+            };
-+
-+            var obs = new OverlayLoadObserver(aPaneElement);
-+            document.loadOverlay(aPaneElement.src, obs);
-+          } else
-+            this._selectPane(aPaneElement);
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <method name="_fireEvent">
-+        <parameter name="aEventName"/>
-+        <parameter name="aTarget"/>
-+        <body>
-+        <![CDATA[
-+          // Panel loaded, synthesize a load event.
-+          try {
-+            var event = document.createEvent("Events");
-+            event.initEvent(aEventName, true, true);
-+            var cancel = !aTarget.dispatchEvent(event);
-+            if (aTarget.hasAttribute("on" + aEventName)) {
-+              var fn = new Function("event", aTarget.getAttribute("on" + aEventName));
-+              var rv = fn.call(aTarget, event);
-+              if (rv == false)
-+                cancel = true;
-+            }
-+            return !cancel;
-+          } catch (e) {
-+            Components.utils.reportError(e);
-+          }
-+          return false;
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <field name="_initialized">false</field>
-+      <method name="_selectPane">
-+        <parameter name="aPaneElement"/>
-+        <body>
-+        <![CDATA[
-+          if (/Mac/.test(navigator.platform)) {
-+            var paneTitle = aPaneElement.label;
-+            if (paneTitle != "")
-+              document.title = paneTitle;
-+          }
-+          var helpButton = document.documentElement.getButton("help");
-+          if (aPaneElement.helpTopic)
-+            helpButton.hidden = false;
-+          else
-+            helpButton.hidden = true;
-+
-+          // Find this pane's index in the deck and set the deck's
-+          // selectedIndex to that value to switch to it.
-+          var prefpanes = this.preferencePanes;
-+          for (var i = 0; i < prefpanes.length; ++i) {
-+            if (prefpanes[i] == aPaneElement) {
-+              this._paneDeck.selectedIndex = i;
-+
-+              if (this.type != "child") {
-+                if (aPaneElement.hasAttribute("flex") && this._shouldAnimate &&
-+                    prefpanes.length > 1)
-+                  aPaneElement.removeAttribute("flex");
-+                // Calling sizeToContent after the first prefpane is loaded
-+                // will size the windows contents so style information is
-+                // available to calculate correct sizing.
-+                if (!this._initialized && prefpanes.length > 1) {
-+                  if (this._shouldAnimate)
-+                    this.style.minHeight = 0;
-+                  window.sizeToContent();
-+                }
-+
-+                var oldPane = this.lastSelected ? document.getElementById(this.lastSelected) : this.preferencePanes[0];
-+                oldPane.selected = !(aPaneElement.selected = true);
-+                this.lastSelected = aPaneElement.id;
-+                this.currentPane = aPaneElement;
-+                this._initialized = true;
-+
-+                // Only animate if we've switched between prefpanes
-+                if (this._shouldAnimate && oldPane.id != aPaneElement.id) {
-+                  aPaneElement.style.opacity = 0.0;
-+                  this.animate(oldPane, aPaneElement);
-+                } else if (!this._shouldAnimate && prefpanes.length > 1) {
-+                  var targetHeight = parseInt(window.getComputedStyle(this._paneDeckContainer).height);
-+                  var verticalPadding = parseInt(window.getComputedStyle(aPaneElement).paddingTop);
-+                  verticalPadding += parseInt(window.getComputedStyle(aPaneElement).paddingBottom);
-+                  if (aPaneElement.contentHeight > targetHeight - verticalPadding) {
-+                    // To workaround the bottom border of a groupbox from being
-+                    // cutoff an hbox with a class of bottomBox may enclose it.
-+                    // This needs to include its padding to resize properly.
-+                    // See bug 394433
-+                    var bottomPadding = 0;
-+                    var bottomBox = aPaneElement.getElementsByAttribute("class", "bottomBox")[0];
-+                    if (bottomBox)
-+                      bottomPadding = parseInt(window.getComputedStyle(bottomBox).paddingBottom);
-+                    window.innerHeight += bottomPadding + verticalPadding + aPaneElement.contentHeight - targetHeight;
-+                  }
-+
-+                  // XXX rstrong - extend the contents of the prefpane to
-+                  // prevent elements from being cutoff (see bug 349098).
-+                  if (aPaneElement.contentHeight + verticalPadding < targetHeight)
-+                    aPaneElement._content.style.height = targetHeight - verticalPadding + "px";
-+                }
-+              }
-+              break;
-+            }
-+          }
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <property name="_shouldAnimate">
-+        <getter>
-+        <![CDATA[
-+          var psvc = Components.classes["@mozilla.org/preferences-service;1"]
-+                               .getService(Components.interfaces.nsIPrefBranch);
-+          return psvc.getBoolPref("browser.preferences.animateFadeIn",
-+                                  /Mac/.test(navigator.platform));
-+        ]]>
-+        </getter>
-+      </property>
-+
-+      <method name="animate">
-+        <parameter name="aOldPane"/>
-+        <parameter name="aNewPane"/>
-+        <body>
-+        <![CDATA[
-+          // if we are already resizing, use currentHeight
-+          var oldHeight = this._currentHeight ? this._currentHeight : aOldPane.contentHeight;
-+
-+          this._multiplier = aNewPane.contentHeight > oldHeight ? 1 : -1;
-+          var sizeDelta = Math.abs(oldHeight - aNewPane.contentHeight);
-+          this._animateRemainder = sizeDelta % this._animateIncrement;
-+
-+          this._setUpAnimationTimer(oldHeight);
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <property name="_sizeIncrement">
-+        <getter>
-+        <![CDATA[
-+          var lastSelectedPane = document.getElementById(this.lastSelected);
-+          var increment = this._animateIncrement * this._multiplier;
-+          var newHeight = this._currentHeight + increment;
-+          if ((this._multiplier > 0 && this._currentHeight >= lastSelectedPane.contentHeight) ||
-+              (this._multiplier < 0 && this._currentHeight <= lastSelectedPane.contentHeight))
-+            return 0;
-+
-+          if ((this._multiplier > 0 && newHeight > lastSelectedPane.contentHeight) ||
-+              (this._multiplier < 0 && newHeight < lastSelectedPane.contentHeight))
-+            increment = this._animateRemainder * this._multiplier;
-+          return increment;
-+        ]]>
-+        </getter>
-+      </property>
-+
-+      <method name="notify">
-+        <parameter name="aTimer"/>
-+        <body>
-+        <![CDATA[
-+          if (!document)
-+            aTimer.cancel();
-+
-+          if (aTimer == this._animateTimer) {
-+            var increment = this._sizeIncrement;
-+            if (increment != 0) {
-+              window.innerHeight += increment;
-+              this._currentHeight += increment;
-+            } else {
-+              aTimer.cancel();
-+              this._setUpFadeTimer();
-+            }
-+          } else if (aTimer == this._fadeTimer) {
-+            var elt = document.getElementById(this.lastSelected);
-+            var newOpacity = parseFloat(window.getComputedStyle(elt).opacity) + this._fadeIncrement;
-+            if (newOpacity < 1.0)
-+              elt.style.opacity = newOpacity;
-+            else {
-+              aTimer.cancel();
-+              elt.style.opacity = 1.0;
-+            }
-+          }
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <method name="_setUpAnimationTimer">
-+        <parameter name="aStartHeight"/>
-+        <body>
-+        <![CDATA[
-+          if (!this._animateTimer)
-+            this._animateTimer = Components.classes["@mozilla.org/timer;1"]
-+                                           .createInstance(Components.interfaces.nsITimer);
-+          else
-+            this._animateTimer.cancel();
-+          this._currentHeight = aStartHeight;
-+
-+          this._animateTimer.initWithCallback(this, this._animateDelay,
-+                                              Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <method name="_setUpFadeTimer">
-+        <body>
-+        <![CDATA[
-+          if (!this._fadeTimer)
-+            this._fadeTimer = Components.classes["@mozilla.org/timer;1"]
-+                                        .createInstance(Components.interfaces.nsITimer);
-+          else
-+            this._fadeTimer.cancel();
-+
-+          this._fadeTimer.initWithCallback(this, this._fadeDelay,
-+                                           Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <field name="_animateTimer">null</field>
-+      <field name="_fadeTimer">null</field>
-+      <field name="_animateDelay">15</field>
-+      <field name="_animateIncrement">40</field>
-+      <field name="_fadeDelay">5</field>
-+      <field name="_fadeIncrement">0.40</field>
-+      <field name="_animateRemainder">0</field>
-+      <field name="_currentHeight">0</field>
-+      <field name="_multiplier">0</field>
-+
-+      <method name="addPane">
-+        <parameter name="aPaneElement"/>
-+        <body>
-+        <![CDATA[
-+          this.appendChild(aPaneElement);
-+
-+          // Set up pane button
-+          this._makePaneButton(aPaneElement);
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <method name="openSubDialog">
-+        <parameter name="aURL"/>
-+        <parameter name="aFeatures"/>
-+        <parameter name="aParams"/>
-+        <body>
-+          return openDialog(aURL, "", "modal,centerscreen,resizable=no" + (aFeatures != "" ? ("," + aFeatures) : ""), aParams);
-+        </body>
-+      </method>
-+
-+      <method name="openWindow">
-+        <parameter name="aWindowType"/>
-+        <parameter name="aURL"/>
-+        <parameter name="aFeatures"/>
-+        <parameter name="aParams"/>
-+        <body>
-+        <![CDATA[
-+          var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
-+                             .getService(Components.interfaces.nsIWindowMediator);
-+          var win = aWindowType ? wm.getMostRecentWindow(aWindowType) : null;
-+          if (win) {
-+            if ("initWithParams" in win)
-+              win.initWithParams(aParams);
-+            win.focus();
-+          } else {
-+            var features = "resizable,dialog=no,centerscreen" + (aFeatures != "" ? ("," + aFeatures) : "");
-+            var parentWindow = (this.instantApply || !window.opener || window.opener.closed) ? window : window.opener;
-+            win = parentWindow.openDialog(aURL, "_blank", features, aParams);
-+          }
-+          return win;
-+        ]]>
-+        </body>
-+      </method>
-+    </implementation>
-+    <handlers>
-+      <handler event="dialogaccept">
-+      <![CDATA[
-+        if (!this._fireEvent("beforeaccept", this)) {
-+          return false;
-+        }
-+
-+        var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
-+                    .getService(Components.interfaces.nsIScriptSecurityManager);
-+        if (this.type == "child" && window.opener &&
-+            secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {
-+          var pdocEl = window.opener.document.documentElement;
-+          if (pdocEl.instantApply) {
-+            let panes = this.preferencePanes;
-+            for (let i = 0; i < panes.length; ++i)
-+              panes[i].writePreferences(true);
-+          } else {
-+            // Clone all the preferences elements from the child document and
-+            // insert them into the pane collection of the parent.
-+            var pdoc = window.opener.document;
-+            if (pdoc.documentElement.localName == "prefwindow") {
-+              var currentPane = pdoc.documentElement.currentPane;
-+              var id = window.location.href + "#childprefs";
-+              var childPrefs = pdoc.getElementById(id);
-+              if (!childPrefs) {
-+                childPrefs = pdoc.createElement("preferences");
-+                currentPane.appendChild(childPrefs);
-+                childPrefs.id = id;
-+              }
-+              let panes = this.preferencePanes;
-+              for (let i = 0; i < panes.length; ++i) {
-+                var preferences = panes[i].preferences;
-+                for (var j = 0; j < preferences.length; ++j) {
-+                  // Try to find a preference element for the same preference.
-+                  var preference = null;
-+                  var parentPreferences = pdoc.getElementsByTagName("preferences");
-+                  for (var k = 0; (k < parentPreferences.length && !preference); ++k) {
-+                    var parentPrefs = parentPreferences[k]
-+                                         .getElementsByAttribute("name", preferences[j].name);
-+                    for (var l = 0; (l < parentPrefs.length && !preference); ++l) {
-+                      if (parentPrefs[l].localName == "preference")
-+                        preference = parentPrefs[l];
-+                    }
-+                  }
-+                  if (!preference) {
-+                    // No matching preference in the parent window.
-+                    preference = pdoc.createElement("preference");
-+                    childPrefs.appendChild(preference);
-+                    preference.name     = preferences[j].name;
-+                    preference.type     = preferences[j].type;
-+                    preference.inverted = preferences[j].inverted;
-+                    preference.readonly = preferences[j].readonly;
-+                    preference.disabled = preferences[j].disabled;
-+                  }
-+                  preference.value = preferences[j].value;
-+                }
-+              }
-+            }
-+          }
-+        } else {
-+          let panes = this.preferencePanes;
-+          for (var i = 0; i < panes.length; ++i)
-+            panes[i].writePreferences(false);
-+
-+          let psvc = Components.classes["@mozilla.org/preferences-service;1"]
-+                               .getService(Components.interfaces.nsIPrefService);
-+          psvc.savePrefFile(null);
-+        }
-+
-+        return true;
-+      ]]>
-+      </handler>
-+      <handler event="command">
-+        if (event.originalTarget.hasAttribute("pane")) {
-+          var pane = document.getElementById(event.originalTarget.getAttribute("pane"));
-+          this.showPane(pane);
-+        }
-+      </handler>
-+
-+      <handler event="keypress" key="&windowClose.key;" modifiers="accel" phase="capturing">
-+      <![CDATA[
-+        if (this.instantApply)
-+          window.close();
-+        event.stopPropagation();
-+        event.preventDefault();
-+      ]]>
-+      </handler>
-+
-+      <handler event="keypress"
-+#ifdef XP_MACOSX
-+               key="&openHelpMac.commandkey;" modifiers="accel"
-+#else
-+               keycode="&openHelp.commandkey;"
-+#endif
-+               phase="capturing">
-+      <![CDATA[
-+        var helpButton = this.getButton("help");
-+        if (helpButton.disabled || helpButton.hidden)
-+          return;
-+        this._fireEvent("dialoghelp", this);
-+        event.stopPropagation();
-+        event.preventDefault();
-+      ]]>
-+      </handler>
-+    </handlers>
-+  </binding>
-+
-+  <binding id="prefpane">
-+    <resources>
-+      <stylesheet src="chrome://global/skin/preferences.css"/>
-+    </resources>
-+    <content>
-+      <xul:vbox class="content-box" xbl:inherits="flex">
-+        <children/>
-+      </xul:vbox>
-+    </content>
-+    <implementation>
-+      <method name="writePreferences">
-+        <parameter name="aFlushToDisk"/>
-+        <body>
-+        <![CDATA[
-+          // Write all values to preferences.
-+          if (this._deferredValueUpdateElements.size) {
-+            this._finalizeDeferredElements();
-+          }
-+
-+          var preferences = this.preferences;
-+          for (var i = 0; i < preferences.length; ++i) {
-+            var preference = preferences[i];
-+            preference.batching = true;
-+            preference.valueFromPreferences = preference.value;
-+            preference.batching = false;
-+          }
-+          if (aFlushToDisk) {
-+            var psvc = Components.classes["@mozilla.org/preferences-service;1"]
-+                                 .getService(Components.interfaces.nsIPrefService);
-+            psvc.savePrefFile(null);
-+          }
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <property name="src"
-+                onget="return this.getAttribute('src');"
-+                onset="this.setAttribute('src', val); return val;"/>
-+      <property name="selected"
-+                onget="return this.getAttribute('selected') == 'true';"
-+                onset="this.setAttribute('selected', val); return val;"/>
-+      <property name="image"
-+                onget="return this.getAttribute('image');"
-+                onset="this.setAttribute('image', val); return val;"/>
-+      <property name="label"
-+                onget="return this.getAttribute('label');"
-+                onset="this.setAttribute('label', val); return val;"/>
-+
-+      <property name="preferenceElements"
-+                onget="return this.getElementsByAttribute('preference', '*');"/>
-+      <property name="preferences"
-+                onget="return this.getElementsByTagName('preference');"/>
-+
-+      <property name="helpTopic">
-+        <getter>
-+        <![CDATA[
-+          // if there are tabs, and the selected tab provides a helpTopic, return that
-+          var box = this.getElementsByTagName("tabbox");
-+          if (box[0]) {
-+            var tab = box[0].selectedTab;
-+            if (tab && tab.hasAttribute("helpTopic"))
-+              return tab.getAttribute("helpTopic");
-+          }
-+
-+          // otherwise, return the helpTopic of the current panel
-+          return this.getAttribute("helpTopic");
-+        ]]>
-+        </getter>
-+      </property>
-+
-+      <field name="_loaded">false</field>
-+      <property name="loaded"
-+                onget="return !this.src ? true : this._loaded;"
-+                onset="this._loaded = val; return val;"/>
-+
-+      <method name="preferenceForElement">
-+        <parameter name="aElement"/>
-+        <body>
-+          return document.getElementById(aElement.getAttribute("preference"));
-+        </body>
-+      </method>
-+
-+      <method name="getPreferenceElement">
-+        <parameter name="aStartElement"/>
-+        <body>
-+        <![CDATA[
-+          var temp = aStartElement;
-+          while (temp && temp.nodeType == Node.ELEMENT_NODE &&
-+                 !temp.hasAttribute("preference"))
-+            temp = temp.parentNode;
-+          return temp && temp.nodeType == Node.ELEMENT_NODE ?
-+                 temp : aStartElement;
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <property name="DeferredTask" readonly="true">
-+        <getter><![CDATA[
-+          let module = {};
-+          Components.utils.import("resource://gre/modules/DeferredTask.jsm", module);
-+          Object.defineProperty(this, "DeferredTask", {
-+            configurable: true,
-+            enumerable: true,
-+            writable: true,
-+            value: module.DeferredTask
-+          });
-+          return module.DeferredTask;
-+        ]]></getter>
-+      </property>
-+      <method name="_deferredValueUpdate">
-+        <parameter name="aElement"/>
-+        <body>
-+        <![CDATA[
-+          delete aElement._deferredValueUpdateTask;
-+          let preference = document.getElementById(aElement.getAttribute("preference"));
-+          let prefVal = preference.getElementValue(aElement);
-+          preference.value = prefVal;
-+          this._deferredValueUpdateElements.delete(aElement);
-+        ]]>
-+        </body>
-+      </method>
-+      <field name="_deferredValueUpdateElements">
-+        new Set();
-+      </field>
-+      <method name="_finalizeDeferredElements">
-+        <body>
-+        <![CDATA[
-+          for (let el of this._deferredValueUpdateElements) {
-+            if (el._deferredValueUpdateTask) {
-+              el._deferredValueUpdateTask.finalize();
-+            }
-+          }
-+        ]]>
-+        </body>
-+      </method>
-+      <method name="userChangedValue">
-+        <parameter name="aElement"/>
-+        <body>
-+        <![CDATA[
-+          let element = this.getPreferenceElement(aElement);
-+          if (element.hasAttribute("preference")) {
-+            if (element.getAttribute("delayprefsave") != "true") {
-+              var preference = document.getElementById(element.getAttribute("preference"));
-+              var prefVal = preference.getElementValue(element);
-+              preference.value = prefVal;
-+            } else {
-+              if (!element._deferredValueUpdateTask) {
-+                element._deferredValueUpdateTask = new this.DeferredTask(this._deferredValueUpdate.bind(this, element), 1000);
-+                this._deferredValueUpdateElements.add(element);
-+              } else {
-+                // Each time the preference is changed, restart the delay.
-+                element._deferredValueUpdateTask.disarm();
-+              }
-+              element._deferredValueUpdateTask.arm();
-+            }
-+          }
-+        ]]>
-+        </body>
-+      </method>
-+
-+      <property name="contentHeight">
-+        <getter>
-+          var targetHeight = parseInt(window.getComputedStyle(this._content).height);
-+          targetHeight += parseInt(window.getComputedStyle(this._content).marginTop);
-+          targetHeight += parseInt(window.getComputedStyle(this._content).marginBottom);
-+          return targetHeight;
-+        </getter>
-+      </property>
-+      <field name="_content">
-+        document.getAnonymousElementByAttribute(this, "class", "content-box");
-+      </field>
-+    </implementation>
-+    <handlers>
-+      <handler event="command">
-+        // This "command" event handler tracks changes made to preferences by
-+        // the user in this window.
-+        if (event.sourceEvent)
-+          event = event.sourceEvent;
-+        this.userChangedValue(event.target);
-+      </handler>
-+      <handler event="select">
-+        // This "select" event handler tracks changes made to colorpicker
-+        // preferences by the user in this window.
-+        if (event.target.localName == "colorpicker")
-+          this.userChangedValue(event.target);
-+      </handler>
-+      <handler event="change">
-+        // This "change" event handler tracks changes made to preferences by
-+        // the user in this window.
-+        this.userChangedValue(event.target);
-+      </handler>
-+      <handler event="input">
-+        // This "input" event handler tracks changes made to preferences by
-+        // the user in this window.
-+        this.userChangedValue(event.target);
-+      </handler>
-+      <handler event="paneload">
-+      <![CDATA[
-+        // Initialize all values from preferences.
-+        var elements = this.preferenceElements;
-+        for (var i = 0; i < elements.length; ++i) {
-+          try {
-+            var preference = this.preferenceForElement(elements[i]);
-+            preference.setElementValue(elements[i]);
-+          } catch (e) {
-+            dump("*** No preference found for " + elements[i].getAttribute("preference") + "\n");
-+          }
-+        }
-+      ]]>
-+      </handler>
-+    </handlers>
-+  </binding>
-+
-+  <binding id="panebutton" role="xul:listitem"
-+           extends="chrome://global/content/bindings/radio.xml#radio">
-+    <resources>
-+      <stylesheet src="chrome://global/skin/preferences.css"/>
-+    </resources>
-+    <content>
-+      <xul:image class="paneButtonIcon" xbl:inherits="src"/>
-+      <xul:label class="paneButtonLabel" xbl:inherits="value=label"/>
-+    </content>
-+  </binding>
-+
-+</bindings>
-+
-+# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-+# 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/.
-+
-+#
-+# This is PrefWindow 6. The Code Could Well Be Ready, Are You?
-+#
-+#    Historical References:
-+#    PrefWindow V   (February 1, 2003)
-+#    PrefWindow IV  (April 24, 2000)
-+#    PrefWindow III (January 6, 2000)
-+#    PrefWindow II  (???)
-+#    PrefWindow I   (June 4, 1999)
-+#
 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
@@ -2327,7 +881,7 @@
 --- a/toolkit/xre/moz.build
 +++ b/toolkit/xre/moz.build
 @@ -61,17 +61,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
-         '../components/printingui/mac',
+         '../components/printingui',
      ]
  elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
      UNIFIED_SOURCES += [
@@ -2755,14 +1309,14 @@
      SOURCES += [
          osdir + '/nsOSHelperAppService.cpp',
      ]
-     if CONFIG['GNU_CXX']:
+     if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
          CXXFLAGS += ['-Wno-error=shadow']
  
  if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
      UNIFIED_SOURCES += [
 +        'unix/nsCommonRegistry.cpp',
          'unix/nsGNOMERegistry.cpp',
-+	'unix/nsKDERegistry.cpp',
++        'unix/nsKDERegistry.cpp',
          'unix/nsMIMEInfoUnix.cpp',
      ]
  elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
@@ -2771,7 +1325,7 @@
          'android/nsExternalSharingAppService.cpp',
          'android/nsExternalURLHandlerService.cpp',
          'android/nsMIMEInfoAndroid.cpp',
-@@ -129,16 +131,17 @@ include('/ipc/chromium/chromium-config.m
+@@ -124,16 +126,17 @@ include('/ipc/chromium/chromium-config.m
  FINAL_LIBRARY = 'xul'
  
  LOCAL_INCLUDES += [
@@ -2787,7 +1341,7 @@
      CXXFLAGS += CONFIG['TK_CFLAGS']
      CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
  
- if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
+ 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
@@ -3073,14 +1627,14 @@
  
    if (*_retval)
      return NS_OK;
-@@ -79,16 +82,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
-     ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get()));
-   if (action.isValid()) {
-     action.trigger();
-     return NS_OK;
-   }
-   return NS_ERROR_FAILURE;
- #endif
+@@ -59,16 +62,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
+   // 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);
  
 +  if( nsKDEUtils::kdeSupport()) {
 +    bool supports;
@@ -3208,7 +1762,7 @@
 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
 --- a/widget/gtk/moz.build
 +++ b/widget/gtk/moz.build
-@@ -109,16 +109,17 @@ else:
+@@ -121,16 +121,17 @@ else:
  include('/ipc/chromium/chromium-config.mozbuild')
  
  FINAL_LIBRARY = 'xul'
@@ -3577,7 +2131,7 @@
 +  NS_IMETHODIMP kdeAppsDialog(PRInt16 *aReturn);
 +  nsCString kdeMakeFilter( int index );
 +
- #if (MOZ_WIDGET_GTK == 3)
+ #ifdef MOZ_WIDGET_GTK
    GtkFileChooserWidget *mFileChooserDelegate;
  #endif
  };
@@ -3756,7 +2310,7 @@
  #include "prmem.h"
  #include "plbase64.h"
  
-@@ -1938,59 +1939,74 @@ nsLocalFile::SetPersistentDescriptor(con
+@@ -1934,59 +1935,74 @@ nsLocalFile::SetPersistentDescriptor(con
    return InitWithNativePath(aPersistentDescriptor);
  #endif
  }
@@ -3835,5 +2389,5 @@
    }
  
    return giovfs->ShowURIForInput(mPath);
- #elif defined(MOZ_ENABLE_CONTENTACTION)
-   QUrl uri = QUrl::fromLocalFile(QString::fromUtf8(mPath.get()));
+ #elif defined(MOZ_WIDGET_ANDROID)
+   // Try to get a mimetype, if this fails just use the file uri alone
--- a/series	Fri Feb 09 13:28:07 2018 +0100
+++ b/series	Fri Feb 09 16:30:49 2018 +0100
@@ -2,16 +2,12 @@
 mozilla-nongnome-proxies.patch
 mozilla-kde.patch
 mozilla-ntlm-full-path.patch
-mozilla-idldir.patch
 mozilla-openaes-decl.patch
 mozilla-no-stdcxx-check.patch
 mozilla-reduce-files-per-UnifiedBindings.patch
 mozilla-aarch64-startup-crash.patch
-mozilla-enable-csd.patch
 mozilla-bmo256180.patch
-mozilla-alsa-sandbox.patch
 
 # Firefox patches
 firefox-kde.patch
-firefox-no-default-ualocale.patch
 firefox-branded-icons.patch