--- a/mozilla-kde.patch Sun Jan 24 13:40:23 2016 +0100
+++ b/mozilla-kde.patch Thu Apr 28 17:08:03 2016 +0200
@@ -1,34 +1,15 @@
# HG changeset patch
-# Parent d9c9ae52f0338a60d1626d9209248341815e597a
+# Parent 61cdc9af8ceaf75083e751e0d6497feddc26f7ba
Description: Add KDE integration to Firefox (toolkit parts)
Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
Author: Lubos Lunak <lunak@suse.com>
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
https://bugzilla.novell.com/show_bug.cgi?id=170055
-diff --git a/modules/libpref/Makefile.in b/modules/libpref/Makefile.in
---- a/modules/libpref/Makefile.in
-+++ b/modules/libpref/Makefile.in
-@@ -21,13 +21,15 @@ endif
- ifdef MOZ_SERVICES_HEALTHREPORT
- ifneq (android,$(MOZ_WIDGET_TOOLKIT))
- grepref_files += $(topsrcdir)/services/healthreport/healthreport-prefs.js
- else
- grepref_files += $(topsrcdir)/mobile/android/chrome/content/healthreport-prefs.js
- endif
- endif
-
-+LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
-+
- greprefs.js: $(grepref_files)
- $(call py_action,preprocessor,$(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) $^ -o $@)
-
- libs:: greprefs.js
- $(INSTALL) $^ $(DIST)/bin/
diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
-@@ -30,16 +30,17 @@
+@@ -31,16 +31,17 @@
#include "nsIZipReader.h"
#include "nsPrefBranch.h"
#include "nsXPIDLString.h"
@@ -46,7 +27,7 @@
#include "prefread.h"
#include "prefapi_private_data.h"
-@@ -1148,16 +1149,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
+@@ -1135,16 +1136,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
static nsresult pref_LoadPrefsInDirList(const char *listId)
{
@@ -81,7 +62,7 @@
return NS_OK;
bool hasMore;
-@@ -1173,17 +1192,17 @@ static nsresult pref_LoadPrefsInDirList(
+@@ -1160,17 +1179,17 @@ static nsresult pref_LoadPrefsInDirList(
nsAutoCString leaf;
path->GetNativeLeafName(leaf);
@@ -100,7 +81,7 @@
{
nsZipItemPtr<char> manifest(jarReader, name, true);
NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
-@@ -1277,26 +1296,38 @@ static nsresult pref_InitInitialObjects(
+@@ -1264,24 +1283,36 @@ static nsresult pref_InitInitialObjects(
/* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
static const char* specialFiles[] = {
#if defined(XP_MACOSX)
@@ -110,9 +91,7 @@
#elif defined(XP_UNIX)
"unix.js"
+ , "" // placeholder for KDE (empty is otherwise harmless)
- #if defined(VMS)
- , "openvms.js"
- #elif defined(_AIX)
+ #if defined(_AIX)
, "aix.js"
#endif
#elif defined(XP_BEOS)
@@ -139,6 +118,30 @@
// or jar:$gre/omni.jar!/defaults/preferences/*.js.
RefPtr<nsZipArchive> appJarReader = mozilla::Omnijar::GetReader(mozilla::Omnijar::APP);
// GetReader(mozilla::Omnijar::APP) returns null when $app == $gre, in which
+diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
+--- a/modules/libpref/moz.build
++++ b/modules/libpref/moz.build
+@@ -31,16 +31,20 @@ UNIFIED_SOURCES += [
+ 'prefread.cpp',
+ ]
+
+ # prefapi.cpp cannot be built in unified mode because it uses plarena.h
+ SOURCES += [
+ 'prefapi.cpp',
+ ]
+
++LOCAL_INCLUDES += [
++ '/toolkit/xre'
++]
++
+ include('/ipc/chromium/chromium-config.mozbuild')
+
+ FINAL_LIBRARY = 'xul'
+
+ DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
+ DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
+
+ if CONFIG['GNU_CXX']:
diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
--- a/python/mozbuild/mozpack/chrome/flags.py
+++ b/python/mozbuild/mozpack/chrome/flags.py
@@ -184,7 +187,7 @@
diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
--- a/toolkit/components/downloads/moz.build
+++ b/toolkit/components/downloads/moz.build
-@@ -65,15 +65,16 @@ if not CONFIG['MOZ_SUITE']:
+@@ -64,15 +64,16 @@ if not CONFIG['MOZ_SUITE']:
'nsDownloadManagerUI.js',
'nsDownloadManagerUI.manifest',
]
@@ -226,7 +229,7 @@
#include "AndroidBridge.h"
#endif
-@@ -2714,16 +2718,25 @@ nsDownload::SetState(DownloadState aStat
+@@ -2719,16 +2723,25 @@ nsDownload::SetState(DownloadState aStat
nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
// Master pref to control this function.
@@ -252,7 +255,7 @@
int64_t goat = PR_Now() - mStartTime;
showTaskbarAlert = goat > alertIntervalUSec;
-@@ -2754,16 +2767,17 @@ nsDownload::SetState(DownloadState aStat
+@@ -2759,16 +2772,17 @@ nsDownload::SetState(DownloadState aStat
NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title,
message, !removeWhenDone,
mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"),
@@ -273,31 +276,31 @@
diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
-@@ -64,29 +64,33 @@ toolkit.jar:
+@@ -72,29 +72,33 @@ toolkit.jar:
content/global/viewZoomOverlay.js
- *+ content/global/bindings/autocomplete.xml (widgets/autocomplete.xml)
+ content/global/bindings/autocomplete.xml (widgets/autocomplete.xml)
content/global/bindings/browser.xml (widgets/browser.xml)
content/global/bindings/button.xml (widgets/button.xml)
content/global/bindings/checkbox.xml (widgets/checkbox.xml)
content/global/bindings/colorpicker.xml (widgets/colorpicker.xml)
content/global/bindings/datetimepicker.xml (widgets/datetimepicker.xml)
- *+ content/global/bindings/dialog.xml (widgets/dialog.xml)
-+*+ content/global/bindings/dialog-kde.xml (widgets/dialog-kde.xml)
+ * content/global/bindings/dialog.xml (widgets/dialog.xml)
++* 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/filefield.xml (widgets/filefield.xml)
+ * content/global/bindings/findbar.xml (widgets/findbar.xml)
content/global/bindings/general.xml (widgets/general.xml)
content/global/bindings/groupbox.xml (widgets/groupbox.xml)
- *+ content/global/bindings/listbox.xml (widgets/listbox.xml)
+ content/global/bindings/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)
+ * 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)
@@ -311,7 +314,7 @@
new file mode 100644
--- /dev/null
+++ b/toolkit/content/widgets/dialog-kde.xml
-@@ -0,0 +1,460 @@
+@@ -0,0 +1,463 @@
+<?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
@@ -345,7 +348,7 @@
+ <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
+#elif XP_UNIX
+ >
-+ <xul:button dlgtype="help" class="dialog-button" hidden="true"/>
++ <xul:button dlgtype="help" class="dialog-button" hidden="true"/>
+ <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
+ <xul:spacer anonid="spacer" flex="1"/>
+ <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
@@ -486,6 +489,9 @@
+ <parameter name="aEvent"/>
+ <body>
+ <![CDATA[
++ let { AppConstants } =
++ Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
++
+ function focusInit() {
+ const dialog = document.documentElement;
+ const defaultButton = dialog.getButton(dialog.defaultButton);
@@ -511,11 +517,10 @@
+ initialFocusedElt.focus();
+ }
+ }
-+#ifndef XP_MACOSX
-+ else if (focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) {
++ else if (AppConstants.platform != "macosx" &&
++ focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) {
+ defaultButton.focus();
+ }
-+#endif
+ }
+ }
+
@@ -632,13 +637,14 @@
+ for (dlgtype in buttons)
+ buttons[dlgtype].hidden = !shown[dlgtype];
+
-+#ifdef XP_WIN
-+# show the spacer on Windows only when the extra2 button is present
-+ var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");
-+ spacer.removeAttribute("hidden");
-+ spacer.setAttribute("flex", shown["extra2"]?"1":"0");
-+#endif
-+
++ let { AppConstants } =
++ Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
++ // show the spacer on Windows only when the extra2 button is present
++ if (AppConstants.platform == "win") {
++ var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");
++ spacer.removeAttribute("hidden");
++ spacer.setAttribute("flex", shown["extra2"]?"1":"0");
++ }
+ }
+ ]]>
+ </body>
@@ -776,7 +782,7 @@
new file mode 100644
--- /dev/null
+++ b/toolkit/content/widgets/preferences-kde.xml
-@@ -0,0 +1,1403 @@
+@@ -0,0 +1,1406 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE bindings [
@@ -1410,19 +1416,22 @@
+ var acceptButton = docElt.getButton("accept");
+ acceptButton.hidden = true;
+ var cancelButton = docElt.getButton("cancel");
-+#ifdef XP_MACOSX
-+ // 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");
-+#endif
++
++ let { AppConstants } =
++ Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
++ if (AppConstants.platform == "macosx") {
++ // 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");
@@ -1592,11 +1601,13 @@
+ <parameter name="aPaneElement"/>
+ <body>
+ <![CDATA[
-+#ifdef XP_MACOSX
-+ var paneTitle = aPaneElement.label;
-+ if (paneTitle != "")
-+ document.title = paneTitle;
-+#endif
++ let { AppConstants } =
++ Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
++ if (AppConstants.platform == "macosx") {
++ var paneTitle = aPaneElement.label;
++ if (paneTitle != "")
++ document.title = paneTitle;
++ }
+ var helpButton = document.documentElement.getButton("help");
+ if (aPaneElement.helpTopic)
+ helpButton.hidden = false;
@@ -1666,13 +1677,11 @@
+ <property name="_shouldAnimate">
+ <getter>
+ <![CDATA[
++ let { AppConstants } =
++ Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
+ var psvc = Components.classes["@mozilla.org/preferences-service;1"]
+ .getService(Components.interfaces.nsIPrefBranch);
-+#ifdef XP_MACOSX
-+ var animate = true;
-+#else
-+ var animate = false;
-+#endif
++ var animate = AppConstants.platform == "macosx";
+ try {
+ animate = psvc.getBoolPref("browser.preferences.animateFadeIn");
+ }
@@ -2697,7 +2706,7 @@
diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
-@@ -72,17 +72,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'ui
+@@ -75,17 +75,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'ui
else:
# These files can't be built in unified mode because they redefine LOG.
SOURCES += [
@@ -2717,7 +2726,7 @@
'android/nsExternalSharingAppService.cpp',
'android/nsExternalURLHandlerService.cpp',
'android/nsMIMEInfoAndroid.cpp',
-@@ -125,16 +127,17 @@ include('/ipc/chromium/chromium-config.m
+@@ -129,16 +131,17 @@ include('/ipc/chromium/chromium-config.m
FINAL_LIBRARY = 'xul'
@@ -3662,8 +3671,8 @@
--- a/xpcom/components/moz.build
+++ b/xpcom/components/moz.build
@@ -47,12 +47,13 @@ FINAL_LIBRARY = 'xul'
- GENERATED_INCLUDES += ['..']
LOCAL_INCLUDES += [
+ '!..',
'../base',
'../build',
'../ds',
@@ -3678,7 +3687,7 @@
diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
-@@ -47,16 +47,17 @@
+@@ -44,16 +44,17 @@
#include "prproces.h"
#include "nsIDirectoryEnumerator.h"
#include "nsISimpleEnumerator.h"
@@ -3696,7 +3705,7 @@
#include "prmem.h"
#include "plbase64.h"
-@@ -1963,42 +1964,52 @@ nsLocalFile::SetPersistentDescriptor(con
+@@ -1948,42 +1949,52 @@ nsLocalFile::SetPersistentDescriptor(con
return InitWithNativePath(aPersistentDescriptor);
#endif
}
@@ -3755,7 +3764,7 @@
return rv;
}
return NS_ERROR_FAILURE;
-@@ -2006,16 +2017,22 @@ nsLocalFile::Reveal()
+@@ -1991,16 +2002,22 @@ nsLocalFile::Reveal()
return NS_ERROR_FAILURE;
#endif
}