diff options
author | Björn Bidar | 2018-07-07 22:53:29 +0200 |
---|---|---|
committer | Björn Bidar | 2018-07-07 22:53:29 +0200 |
commit | c70a021517c1945b1626d3832a126eb88a17c1c8 (patch) | |
tree | 99f9db4dcd6293546aeeef4c9545f9ff7e859fd1 | |
parent | 2c81840bf9762337b17cae04ff16a10ff0e1f205 (diff) | |
download | aur-c70a021517c1945b1626d3832a126eb88a17c1c8.tar.gz |
upkg
-rw-r--r-- | .SRCINFO | 38 | ||||
-rw-r--r-- | 0001-Bug-1430274-Define-MOZ_ALSA-for-more-source-files.-r.patch | 27 | ||||
-rw-r--r-- | PKGBUILD | 42 | ||||
-rw-r--r-- | complete-csd-window-offset-mozilla-1457691.patch.xz | bin | 6372 -> 0 bytes | |||
-rw-r--r-- | fix_pgo_bug1389436_explicitly_instantiate_gfxFont.patch | 32 | ||||
-rw-r--r-- | mozconfig | 6 | ||||
-rw-r--r-- | no-crmf.diff | 15 | ||||
-rw-r--r-- | unity-menubar.patch | 457 |
8 files changed, 309 insertions, 308 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Tue Jun 12 04:09:59 UTC 2018 +# Sat Jul 7 20:53:23 UTC 2018 pkgbase = firefox-kde-opensuse pkgdesc = Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE - pkgver = 60.0.2 - pkgrel = 4 + pkgver = 61.0.1 + pkgrel = 1 url = https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox arch = i686 arch = x86_64 @@ -13,7 +13,7 @@ pkgbase = firefox-kde-opensuse makedepends = unzip makedepends = zip makedepends = diffutils - makedepends = python2 + makedepends = python makedepends = yasm makedepends = mesa makedepends = imake @@ -47,46 +47,38 @@ pkgbase = firefox-kde-opensuse depends = gtk3 optdepends = networkmanager: Location detection via available WiFi networks optdepends = speech-dispatcher: Text-to-Speech - provides = firefox=60.0.2 + provides = firefox=61.0.1 conflicts = firefox options = !emptydirs options = debug options = strip - source = hg+https://hg.mozilla.org/mozilla-unified#tag=FIREFOX_60_0_2_RELEASE + source = hg+https://hg.mozilla.org/mozilla-unified#tag=FIREFOX_61_0_1_RELEASE source = mozconfig source = firefox.desktop source = vendor.js source = kde.js source = firefox-fixed-loading-icon.png - source = firefox-branded-icons-bf0d08380dcf.patch::http://www.rosenauer.org/hg/mozilla/raw-file/bf0d08380dcf/firefox-branded-icons.patch - source = firefox-kde-bf0d08380dcf.patch::http://www.rosenauer.org/hg/mozilla/raw-file/bf0d08380dcf/firefox-kde.patch - source = mozilla-kde-bf0d08380dcf.patch::http://www.rosenauer.org/hg/mozilla/raw-file/bf0d08380dcf/mozilla-kde.patch - source = mozilla-nongnome-proxies-bf0d08380dcf.patch::http://www.rosenauer.org/hg/mozilla/raw-file/bf0d08380dcf/mozilla-nongnome-proxies.patch + source = firefox-branded-icons-42510f8eee28.patch::http://www.rosenauer.org/hg/mozilla/raw-file/42510f8eee28/firefox-branded-icons.patch + source = firefox-kde-42510f8eee28.patch::http://www.rosenauer.org/hg/mozilla/raw-file/42510f8eee28/firefox-kde.patch + source = mozilla-kde-42510f8eee28.patch::http://www.rosenauer.org/hg/mozilla/raw-file/42510f8eee28/mozilla-kde.patch + source = mozilla-nongnome-proxies-42510f8eee28.patch::http://www.rosenauer.org/hg/mozilla/raw-file/42510f8eee28/mozilla-nongnome-proxies.patch source = unity-menubar.patch source = add_missing_pgo_rule.patch source = pgo_fix_missing_kdejs.patch - source = fix_pgo_bug1389436_explicitly_instantiate_gfxFont.patch - source = no-crmf.diff - source = complete-csd-window-offset-mozilla-1457691.patch.xz - source = 0001-Bug-1435212-Add-support-for-FFmpeg-4.0.-r-bryce.patch.xz source = https://dev.gentoo.org/~axs/mozilla/patchsets/source/firefox-60.0-patches-01.tar.xz md5sums = SKIP - md5sums = 8831241577913001175641c092c9d3ea + md5sums = c29437a9ebf93ffb5876e5df80f650f5 md5sums = 14e0f6237a79b85e60256f4808163160 md5sums = c9385708f41599649e4e14fd3af506ce md5sums = 05bb69d25fb3572c618e3adf1ee7b670 md5sums = 6e335a517c68488941340ee1c23f97b0 - md5sums = df9f710c842d4847aae5bc667f97f4a2 - md5sums = dbf69e423c18e08536d9999f0d405a7a - md5sums = 3640c50476625fc9e292074ebaf4fff9 + md5sums = d7ce23a18da21c05cd756766e177834f + md5sums = 9a9a8cd8da7231e3bfc57132a7863021 + md5sums = d501f3cf592451a6d377fa748b6967b6 md5sums = 0661e259fe57df87fca791f4aeb78da0 - md5sums = d0bb97636b07d521f279c01233f0cbdb + md5sums = b3c34d2c275f5373cfcbde17b74d2aa5 md5sums = fe24f5ea463013bb7f1c12d12dce41b2 md5sums = 3fa8bd22d97248de529780f5797178af - md5sums = b358b5ed3726ecd4ed054bdc09901982 - md5sums = 5223d4854f784003e3b575684cc004fe - md5sums = 6c776f60394176fda2084bee667593f2 - md5sums = d16e8582bacf6fc98e669ed87f4d6f4a md5sums = 716f1c21a1020657928d4140d5563233 pkgname = firefox-kde-opensuse diff --git a/0001-Bug-1430274-Define-MOZ_ALSA-for-more-source-files.-r.patch b/0001-Bug-1430274-Define-MOZ_ALSA-for-more-source-files.-r.patch deleted file mode 100644 index 7c33f7a70d35..000000000000 --- a/0001-Bug-1430274-Define-MOZ_ALSA-for-more-source-files.-r.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 2877a352715ce7e30ef364722757c6ec380236b1 Mon Sep 17 00:00:00 2001 -Message-Id: <2877a352715ce7e30ef364722757c6ec380236b1.1518037075.git.jan.steffens@gmail.com> -From: Harald van Dijk <harald@gigawatt.nl> -Date: Thu, 18 Jan 2018 15:18:37 -0700 -Subject: [PATCH] Bug 1430274 - Define MOZ_ALSA for more source files. r=jld - ---- - security/sandbox/linux/moz.build | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build -index 681d658bfeb7..1a49b548af2d 100644 ---- a/security/sandbox/linux/moz.build -+++ b/security/sandbox/linux/moz.build -@@ -78,6 +78,9 @@ if CONFIG['MOZ_GMP_SANDBOX']: - '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. --- -2.16.1 - @@ -20,8 +20,8 @@ _pgo=true _pkgname=firefox pkgname=$_pkgname-kde-opensuse -pkgver=60.0.2 -pkgrel=4 +pkgver=61.0.1 +pkgrel=1 pkgdesc="Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE" arch=('i686' 'x86_64') license=('MPL' 'GPL' 'LGPL') @@ -31,7 +31,7 @@ depends=('mozilla-common' 'libxt' 'startup-notification' 'mime-types' 'libvpx' 'icu' 'libevent' 'nss>=3.28.3' 'nspr>=4.10.6' 'hunspell' 'sqlite' 'libnotify' 'kmozillahelper' 'ffmpeg' 'gtk3') -makedepends=('unzip' 'zip' 'diffutils' 'python2' 'yasm' 'mesa' 'imake' +makedepends=('unzip' 'zip' 'diffutils' 'python' 'yasm' 'mesa' 'imake' 'xorg-server-xvfb' 'libpulse' 'inetutils' 'autoconf2.13' 'rust' 'cargo' 'mercurial' 'llvm' 'clang' 'gtk2') @@ -42,7 +42,7 @@ optdepends=('networkmanager: Location detection via available WiFi networks' 'speech-dispatcher: Text-to-Speech') provides=("firefox=${pkgver}") conflicts=('firefox') -_patchrev=bf0d08380dcf +_patchrev=42510f8eee28 options=('!emptydirs' 'debug' 'strip') _patchurl=http://www.rosenauer.org/hg/mozilla/raw-file/$_patchrev _repo=https://hg.mozilla.org/mozilla-unified @@ -61,12 +61,6 @@ source=("hg+$_repo#tag=FIREFOX_${pkgver//./_}_RELEASE" unity-menubar.patch add_missing_pgo_rule.patch pgo_fix_missing_kdejs.patch - fix_pgo_bug1389436_explicitly_instantiate_gfxFont.patch - no-crmf.diff - - complete-csd-window-offset-mozilla-1457691.patch.xz - 0001-Bug-1435212-Add-support-for-FFmpeg-4.0.-r-bryce.patch.xz - https://dev.gentoo.org/~axs/mozilla/patchsets/source/firefox-60.0-patches-01.tar.xz ) @@ -123,14 +117,7 @@ prepare() { # add missing file Makefile for pgo builds patch -Np1 -i "$srcdir"/pgo_fix_missing_kdejs.patch - - # https://bugzilla.mozilla.org/show_bug.cgi?id=1371991 - patch -Np1 -i ../no-crmf.diff - - # https://bugzilla.mozilla.org/show_bug.cgi?id=1283299#c158 - patch -Np1 -i ../complete-csd-window-offset-mozilla-1457691.patch - # https://bugzilla.mozilla.org/show_bug.cgi?id=1435212 #patch -Np1 -i ../0001-Bug-1435212-Add-support-for-FFmpeg-4.0.-r-bryce.patch @@ -138,6 +125,8 @@ prepare() { for file in "$srcdir"/firefox/*.patch ; do case $file in *gentoo*) : ;; + *ffmpeg*) : ;; + *004_fix_lto_builds*) : ;; *) patch -Np1 -i "$file" ;; @@ -160,13 +149,8 @@ prepare() { build() { #export CXXFLAGS="${CFLAGS}" cd mozilla-unified - - export PATH="$srcdir/path:$PATH" - export PYTHON="/usr/bin/python2" export MOZ_SOURCE_REPO="$_repo" - # _FORTIFY_SOURCE causes configure failures - CPPFLAGS+=" -O2" # Hardening LDFLAGS+=" -Wl,-z,now" @@ -250,20 +234,16 @@ END ln -sf firefox "$pkgdir/usr/lib/firefox/firefox-bin" } md5sums=('SKIP' - '8831241577913001175641c092c9d3ea' + 'c29437a9ebf93ffb5876e5df80f650f5' '14e0f6237a79b85e60256f4808163160' 'c9385708f41599649e4e14fd3af506ce' '05bb69d25fb3572c618e3adf1ee7b670' '6e335a517c68488941340ee1c23f97b0' - 'df9f710c842d4847aae5bc667f97f4a2' - 'dbf69e423c18e08536d9999f0d405a7a' - '3640c50476625fc9e292074ebaf4fff9' + 'd7ce23a18da21c05cd756766e177834f' + '9a9a8cd8da7231e3bfc57132a7863021' + 'd501f3cf592451a6d377fa748b6967b6' '0661e259fe57df87fca791f4aeb78da0' - 'd0bb97636b07d521f279c01233f0cbdb' + 'b3c34d2c275f5373cfcbde17b74d2aa5' 'fe24f5ea463013bb7f1c12d12dce41b2' '3fa8bd22d97248de529780f5797178af' - 'b358b5ed3726ecd4ed054bdc09901982' - '5223d4854f784003e3b575684cc004fe' - '6c776f60394176fda2084bee667593f2' - 'd16e8582bacf6fc98e669ed87f4d6f4a' '716f1c21a1020657928d4140d5563233') diff --git a/complete-csd-window-offset-mozilla-1457691.patch.xz b/complete-csd-window-offset-mozilla-1457691.patch.xz Binary files differdeleted file mode 100644 index 9c6e88f7a476..000000000000 --- a/complete-csd-window-offset-mozilla-1457691.patch.xz +++ /dev/null diff --git a/fix_pgo_bug1389436_explicitly_instantiate_gfxFont.patch b/fix_pgo_bug1389436_explicitly_instantiate_gfxFont.patch deleted file mode 100644 index 0be9feab2568..000000000000 --- a/fix_pgo_bug1389436_explicitly_instantiate_gfxFont.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp ---- a/gfx/thebes/gfxFont.cpp -+++ b/gfx/thebes/gfxFont.cpp -@@ -2634,16 +2634,28 @@ gfxFont::GetShapedWord(DrawTarget *aDraw - ShapeText(aDrawTarget, aText, 0, aLength, aRunScript, aVertical, - aRounding, sw); - - NS_WARNING_ASSERTION(ok, "failed to shape word - expect garbled text"); - - return sw; - } - -+template gfxShapedWord* -+gfxFont::GetShapedWord(DrawTarget *aDrawTarget, -+ const uint8_t *aText, -+ uint32_t aLength, -+ uint32_t aHash, -+ Script aRunScript, -+ bool aVertical, -+ int32_t aAppUnitsPerDevUnit, -+ gfx::ShapedTextFlags aFlags, -+ RoundingFlags aRounding, -+ gfxTextPerfMetrics *aTextPerf); -+ - bool - gfxFont::CacheHashEntry::KeyEquals(const KeyTypePointer aKey) const - { - const gfxShapedWord* sw = mShapedWord.get(); - if (!sw) { - return false; - } - if (sw->GetLength() != aKey->mLength || diff --git a/mozconfig b/mozconfig index 30e92cb39cbf..dc4b1416fd62 100644 --- a/mozconfig +++ b/mozconfig @@ -1,9 +1,9 @@ ac_add_options --enable-application=browser ac_add_options --prefix=/usr -ac_add_options --enable-gold -ac_add_options --enable-pie -ac_add_options --enable-optimize="-O2" +ac_add_options --enable-linker=gold +ac_add_options --enable-hardening +ac_add_options --enable-optimize ac_add_options --enable-rust-simd ac_add_options --enable-release diff --git a/no-crmf.diff b/no-crmf.diff deleted file mode 100644 index 682ba3fc0fd2..000000000000 --- a/no-crmf.diff +++ /dev/null @@ -1,15 +0,0 @@ -diff --git i/old-configure.in w/old-configure.in -index 12170a47568f..dbbaa0bc9194 100644 ---- i/old-configure.in -+++ w/old-configure.in -@@ -1808,9 +1808,7 @@ if test -n "$_USE_SYSTEM_NSS"; then - AM_PATH_NSS(3.35, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])]) - fi - --if test -n "$MOZ_SYSTEM_NSS"; then -- NSS_LIBS="$NSS_LIBS -lcrmf" --else -+if test -z "$MOZ_SYSTEM_NSS"; then - NSS_CFLAGS="-I${DIST}/include/nss" - case "${OS_ARCH}" in - # Only few platforms have been tested with GYP diff --git a/unity-menubar.patch b/unity-menubar.patch index 3a3bf084ecbe..b0924f56a625 100644 --- a/unity-menubar.patch +++ b/unity-menubar.patch @@ -15,17 +15,17 @@ diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/bro !('@mozilla.org/widget/nativemenuservice;1' in Cc)) +#endif this.setAttribute('openedwithkey', - event.target.parentNode.openedWithKey);" - style="border:0px;padding:0px;margin:0px;-moz-appearance:none"> + event.target.parentNode.openedWithKey);"> <menu id="file-menu" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;"> <menupopup id="menu_FilePopup" onpopupshowing="updateUserContextUIVisibility();"> <menuitem id="menu_newNavigatorTab" + label="&tabCmd.label;" diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js -@@ -5542,21 +5542,27 @@ function onViewToolbarsPopupShowing(aEve +@@ -5573,21 +5573,27 @@ function onViewToolbarsPopupShowing(aEve if (deadItem.hasAttribute("toolbarId")) popup.removeChild(deadItem); } @@ -56,7 +56,7 @@ diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js diff --git a/browser/components/places/content/places.xul b/browser/components/places/content/places.xul --- a/browser/components/places/content/places.xul +++ b/browser/components/places/content/places.xul -@@ -156,17 +156,17 @@ +@@ -181,17 +181,17 @@ command="OrganizerCommand:Forward" tooltiptext="&forwardButton.tooltip;" disabled="true"/> @@ -75,10 +75,98 @@ diff --git a/browser/components/places/content/places.xul b/browser/components/p <menuitem id="newbookmark" command="placesCmd_new:bookmark" label="&cmd.new_bookmark.label;" +diff --git a/dom/xul/XULPopupElement.cpp b/dom/xul/XULPopupElement.cpp +--- a/dom/xul/XULPopupElement.cpp ++++ b/dom/xul/XULPopupElement.cpp +@@ -14,16 +14,20 @@ + #include "nsView.h" + #include "mozilla/AppUnits.h" + #include "mozilla/dom/DOMRect.h" + #include "mozilla/dom/Element.h" + #include "mozilla/dom/Event.h" + #include "mozilla/dom/XULPopupElement.h" + #include "mozilla/dom/XULPopupElementBinding.h" + ++#ifdef MOZ_WIDGET_GTK ++#include "nsNativeMenuAtoms.h" ++#endif ++ + namespace mozilla { + namespace dom { + + nsXULElement* + NS_NewXULPopupElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) + { + return new XULPopupElement(aNodeInfo); + } +@@ -189,16 +193,20 @@ XULPopupElement::SetAutoPosition(bool aS + } + + void + XULPopupElement::GetState(nsString& aState) + { + // set this here in case there's no frame for the popup + aState.AssignLiteral("closed"); + ++#ifdef MOZ_WIDGET_GTK ++ nsAutoString nativeState; ++#endif ++ + nsMenuPopupFrame *menuPopupFrame = do_QueryFrame(GetPrimaryFrame()); + if (menuPopupFrame) { + switch (menuPopupFrame->PopupState()) { + case ePopupShown: + aState.AssignLiteral("open"); + break; + case ePopupShowing: + case ePopupPositioning: +@@ -212,16 +220,21 @@ XULPopupElement::GetState(nsString& aSta + break; + case ePopupClosed: + break; + default: + NS_NOTREACHED("Bad popup state"); + break; + } + } ++#ifdef MOZ_WIDGET_GTK ++ else if (GetAttr(kNameSpaceID_None, nsNativeMenuAtoms::_moz_nativemenupopupstate, nativeState)) { ++ aState = nativeState; ++ } ++#endif + } + + nsINode* + XULPopupElement::GetTriggerNode() const + { + nsMenuPopupFrame *menuPopupFrame = do_QueryFrame(GetPrimaryFrame()); + return nsMenuPopupFrame::GetTriggerContent(menuPopupFrame); + } +diff --git a/dom/xul/moz.build b/dom/xul/moz.build +--- a/dom/xul/moz.build ++++ b/dom/xul/moz.build +@@ -59,12 +59,17 @@ LOCAL_INCLUDES += [ + '/dom/xbl', + '/dom/xml', + '/layout/base', + '/layout/generic', + '/layout/style', + '/layout/xul', + ] + ++if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: ++ LOCAL_INCLUDES += [ ++ '/widget/gtk', ++ ] ++ + FINAL_LIBRARY = 'xul' + + if CONFIG['CC_TYPE'] in ('clang', 'gcc'): + CXXFLAGS += ['-Wno-error=shadow'] diff --git a/layout/build/moz.build b/layout/build/moz.build --- a/layout/build/moz.build +++ b/layout/build/moz.build -@@ -66,16 +66,20 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co +@@ -65,16 +65,20 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co LOCAL_INCLUDES += [ '/dom/system/mac', ] @@ -102,8 +190,8 @@ diff --git a/layout/build/moz.build b/layout/build/moz.build diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp --- a/layout/build/nsLayoutStatics.cpp +++ b/layout/build/nsLayoutStatics.cpp -@@ -121,16 +121,20 @@ - #include "mozilla/StylePrefs.h" +@@ -108,16 +108,20 @@ + #include "mozilla/StaticPresData.h" #include "mozilla/dom/WebIDLGlobalNameHash.h" #include "mozilla/dom/ipc/IPCBlobInputStreamStorage.h" #include "mozilla/dom/U2FTokenManager.h" @@ -123,15 +211,15 @@ diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp nsrefcnt nsLayoutStatics::sLayoutStaticRefcnt = 0; nsresult -@@ -152,16 +156,19 @@ nsLayoutStatics::Initialize() - nsCSSPseudoClasses::AddRefAtoms(); - nsCSSPseudoElements::AddRefAtoms(); +@@ -136,16 +140,19 @@ nsLayoutStatics::Initialize() + + // Register static atoms. Note that nsGkAtoms must be initialized earlier + // than here, so it's done in NS_InitAtomTable() instead. + nsCSSAnonBoxes::RegisterStaticAtoms(); + nsCSSPseudoElements::RegisterStaticAtoms(); nsCSSKeywords::AddRefTable(); nsCSSProps::AddRefTable(); nsColorNames::AddRefTable(); - nsGkAtoms::AddRefAtoms(); - nsHTMLTags::RegisterAtoms(); - nsRDFAtoms::RegisterAtoms(); +#ifdef MOZ_WIDGET_GTK + nsNativeMenuAtoms::RegisterAtoms(); +#endif @@ -146,7 +234,7 @@ diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js -@@ -260,16 +260,19 @@ pref("dom.script_loader.bytecode_cache.e +@@ -272,16 +272,19 @@ pref("dom.script_loader.bytecode_cache.e // look at: ScriptLoader::ShouldCacheBytecode function. pref("dom.script_loader.bytecode_cache.strategy", 0); @@ -166,40 +254,10 @@ diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js // Duration of timeout of incremental search in menus (ms). 0 means infinite. pref("ui.menu.incremental_search.timeout", 1000); // If true, all popups won't hide automatically on blur -diff --git a/toolkit/content/widgets/popup.xml b/toolkit/content/widgets/popup.xml ---- a/toolkit/content/widgets/popup.xml -+++ b/toolkit/content/widgets/popup.xml -@@ -22,18 +22,24 @@ - <property name="position" onget="return this.getAttribute('position');" - onset="this.setAttribute('position', val); return val;"/> - <property name="popupBoxObject"> - <getter> - return this.boxObject; - </getter> - </property> - -- <property name="state" readonly="true" -- onget="return this.popupBoxObject.popupState"/> -+ <property name="state" readonly="true"> -+ <getter><![CDATA[ -+ if (this.hasAttribute('_moz-nativemenupopupstate')) -+ return this.getAttribute('_moz-nativemenupopupstate'); -+ else -+ return this.popupBoxObject.popupState; -+ ]]></getter> -+ </property> - - <property name="triggerNode" readonly="true" - onget="return this.popupBoxObject.triggerNode"/> - - <property name="anchorNode" readonly="true" - onget="return this.popupBoxObject.anchorNode"/> - - <method name="openPopup"> diff --git a/toolkit/content/xul.css b/toolkit/content/xul.css --- a/toolkit/content/xul.css +++ b/toolkit/content/xul.css -@@ -307,16 +307,28 @@ toolbar[type="menubar"][autohide="true"] +@@ -297,16 +297,28 @@ toolbar[type="menubar"][autohide="true"] toolbar[type="menubar"][autohide="true"][inactive="true"]:not([customizing="true"]) { min-height: 0 !important; height: 0 !important; @@ -250,7 +308,7 @@ diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build 'nsNativeThemeGTK.cpp', 'nsSound.cpp', 'nsToolkit.cpp', -@@ -54,6 +62,8 @@ +@@ -55,6 +63,8 @@ ] SOURCES += [ @@ -259,7 +317,7 @@ diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build 'nsWindow.cpp', # conflicts with X11 headers ] -@@ -124,6 +134,7 @@ +@@ -125,6 +135,7 @@ LOCAL_INCLUDES += [ '/layout/generic', @@ -267,6 +325,7 @@ diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build '/layout/xul', '/other-licenses/atk-1.0', '/toolkit/xre', + diff --git a/widget/gtk/nsDbusmenu.cpp b/widget/gtk/nsDbusmenu.cpp new file mode 100644 --- /dev/null @@ -445,7 +504,7 @@ diff --git a/widget/gtk/nsMenu.cpp b/widget/gtk/nsMenu.cpp new file mode 100644 --- /dev/null +++ b/widget/gtk/nsMenu.cpp -@@ -0,0 +1,854 @@ +@@ -0,0 +1,849 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -457,15 +516,12 @@ new file mode 100644 + +#include "mozilla/dom/Element.h" +#include "mozilla/Assertions.h" ++#include "mozilla/ComputedStyle.h" ++#include "mozilla/ComputedStyleInlines.h" +#include "mozilla/EventDispatcher.h" -+#include "mozilla/GeckoStyleContext.h" +#include "mozilla/GuardObjects.h" +#include "mozilla/MouseEvents.h" +#include "mozilla/Move.h" -+#include "mozilla/ServoStyleContext.h" -+#include "mozilla/ServoTypes.h" -+#include "mozilla/StyleSetHandle.h" -+#include "mozilla/StyleSetHandleInlines.h" +#include "nsAutoPtr.h" +#include "nsBindingManager.h" +#include "nsComponentManagerUtils.h" @@ -480,8 +536,6 @@ new file mode 100644 +#include "nsIRunnable.h" +#include "nsITimer.h" +#include "nsString.h" -+#include "nsStyleContext.h" -+#include "nsStyleContextInlines.h" +#include "nsStyleStruct.h" +#include "nsThreadUtils.h" +#include "nsXBLBinding.h" @@ -578,16 +632,16 @@ new file mode 100644 + return; + } + -+ RefPtr<nsStyleContext> sc = ++ RefPtr<ComputedStyle> style = + shell->StyleSet()->ResolveStyleFor(aContent->AsElement(), + nullptr, + LazyComputeBehavior::Allow); + -+ if (!sc) { ++ if (!style) { + return; + } + -+ const nsStyleDisplay* display = sc->StyleDisplay(); ++ const nsStyleDisplay* display = style->StyleDisplay(); + if (!display->mBinding) { + return; + } @@ -952,7 +1006,7 @@ new file mode 100644 +} + +void -+nsMenu::Update(nsStyleContext *aStyleContext) ++nsMenu::Update(ComputedStyle *aComputedStyle) +{ + if (mNeedsUpdate) { + mNeedsUpdate = false; @@ -961,8 +1015,8 @@ new file mode 100644 + UpdateSensitivity(); + } + -+ UpdateVisibility(aStyleContext); -+ UpdateIcon(aStyleContext); ++ UpdateVisibility(aComputedStyle); ++ UpdateIcon(aComputedStyle); +} + +nsMenuObject::PropertyFlags @@ -1004,11 +1058,11 @@ new file mode 100644 + UpdateLabel(); + } else if (aAttribute == nsGkAtoms::hidden || + aAttribute == nsGkAtoms::collapsed) { -+ RefPtr<nsStyleContext> sc = GetStyleContext(); -+ UpdateVisibility(sc); ++ RefPtr<ComputedStyle> style = GetComputedStyle(); ++ UpdateVisibility(style); + } else if (aAttribute == nsGkAtoms::image) { -+ RefPtr<nsStyleContext> sc = GetStyleContext(); -+ UpdateIcon(sc); ++ RefPtr<ComputedStyle> style = GetComputedStyle(); ++ UpdateIcon(style); + } +} + @@ -1304,7 +1358,7 @@ diff --git a/widget/gtk/nsMenu.h b/widget/gtk/nsMenu.h new file mode 100644 --- /dev/null +++ b/widget/gtk/nsMenu.h -@@ -0,0 +1,124 @@ +@@ -0,0 +1,123 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -1328,7 +1382,6 @@ new file mode 100644 +class nsAtom; +class nsIContent; +class nsITimer; -+class nsStyleContext; + +#define NSMENU_NUMBER_OF_POPUPSTATE_BITS 2U +#define NSMENU_NUMBER_OF_FLAGS 4U @@ -1398,7 +1451,7 @@ new file mode 100644 + nsIContent *aChild); + + void InitializeNativeData() override; -+ void Update(nsStyleContext *aStyleContext) override; ++ void Update(mozilla::ComputedStyle *aComputedStyle) override; + nsMenuObject::PropertyFlags SupportedProperties() const override; + + void OnAttributeChanged(nsIContent *aContent, nsAtom *aAttribute) override; @@ -1433,7 +1486,7 @@ diff --git a/widget/gtk/nsMenuBar.cpp b/widget/gtk/nsMenuBar.cpp new file mode 100644 --- /dev/null +++ b/widget/gtk/nsMenuBar.cpp -@@ -0,0 +1,558 @@ +@@ -0,0 +1,551 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -1452,9 +1505,7 @@ new file mode 100644 +#include "nsAutoPtr.h" +#include "nsContentUtils.h" +#include "nsIDocument.h" -+#include "nsIDOMEvent.h" +#include "nsIDOMEventListener.h" -+#include "nsIDOMEventTarget.h" +#include "nsIRunnable.h" +#include "nsIWidget.h" +#include "nsTArray.h" @@ -1550,14 +1601,10 @@ new file mode 100644 +NS_IMPL_ISUPPORTS(nsMenuBar::DocEventListener, nsIDOMEventListener) + +NS_IMETHODIMP -+nsMenuBar::DocEventListener::HandleEvent(nsIDOMEvent *aEvent) ++nsMenuBar::DocEventListener::HandleEvent(dom::Event *aEvent) +{ + nsAutoString type; -+ nsresult rv = aEvent->GetType(type); -+ if (NS_FAILED(rv)) { -+ NS_WARNING("Failed to determine event type"); -+ return rv; -+ } ++ aEvent->GetType(type); + + if (type.Equals(NS_LITERAL_STRING("focus"))) { + mOwner->Focus(); @@ -1565,8 +1612,7 @@ new file mode 100644 + mOwner->Blur(); + } + -+ RefPtr<dom::KeyboardEvent> keyEvent = -+ aEvent->InternalDOMEvent()->AsKeyboardEvent(); ++ RefPtr<dom::KeyboardEvent> keyEvent = aEvent->AsKeyboardEvent(); + if (!keyEvent) { + return NS_OK; + } @@ -2019,7 +2065,7 @@ new file mode 100644 +#include <gtk/gtk.h> + +class nsIContent; -+class nsIDOMEvent; ++class nsIDocument; +class nsIWidget; +class nsMenuBarDocEventListener; + @@ -2099,7 +2145,7 @@ new file mode 100644 + + GtkWidget *mTopLevel; + DbusmenuServer *mServer; -+ nsCOMPtr<nsIDOMEventTarget> mDocument; ++ nsCOMPtr<nsIDocument> mDocument; + RefPtr<DocEventListener> mEventListener; + + uint32_t mAccessKey; @@ -2363,7 +2409,7 @@ diff --git a/widget/gtk/nsMenuItem.cpp b/widget/gtk/nsMenuItem.cpp new file mode 100644 --- /dev/null +++ b/widget/gtk/nsMenuItem.cpp -@@ -0,0 +1,759 @@ +@@ -0,0 +1,767 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -2373,8 +2419,10 @@ new file mode 100644 + +#include "mozilla/ArrayUtils.h" +#include "mozilla/Assertions.h" ++#include "mozilla/ComputedStyle.h" +#include "mozilla/dom/Element.h" +#include "mozilla/dom/KeyboardEventBinding.h" ++#include "mozilla/dom/XULCommandEvent.h" +#include "mozilla/Move.h" +#include "mozilla/Preferences.h" +#include "mozilla/TextEvents.h" @@ -2382,17 +2430,14 @@ new file mode 100644 +#include "nsContentUtils.h" +#include "nsCRT.h" +#include "nsGkAtoms.h" ++#include "nsGlobalWindowInner.h" +#include "nsGtkUtils.h" +#include "nsIContent.h" +#include "nsIDocument.h" -+#include "nsIDOMEvent.h" -+#include "nsIDOMEventTarget.h" -+#include "nsIDOMXULCommandEvent.h" +#include "nsIRunnable.h" +#include "nsQueryObject.h" +#include "nsReadableUtils.h" +#include "nsString.h" -+#include "nsStyleContext.h" +#include "nsThreadUtils.h" + +#include "nsMenu.h" @@ -2722,22 +2767,31 @@ new file mode 100644 + } + + nsIDocument *doc = ContentNode()->OwnerDoc(); -+ nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(ContentNode()); -+ if (target) { -+ ErrorResult rv; -+ RefPtr<dom::Event> event = -+ doc->CreateEvent(NS_LITERAL_STRING("xulcommandevent"), -+ dom::CallerType::System, rv); -+ nsCOMPtr<nsIDOMXULCommandEvent> command = do_QueryObject(event); ++ ErrorResult rv; ++ RefPtr<dom::Event> event = ++ doc->CreateEvent(NS_LITERAL_STRING("xulcommandevent"), ++ dom::CallerType::System, rv); ++ if (!rv.Failed()) { ++ RefPtr<dom::XULCommandEvent> command = event->AsXULCommandEvent(); + if (command) { -+ command->InitCommandEvent(NS_LITERAL_STRING("command"), -+ true, true, doc->GetInnerWindow(), 0, -+ false, false, false, false, nullptr, 0); -+ -+ event->SetTrusted(true); -+ bool dummy; -+ target->DispatchEvent(event, &dummy); ++ command->InitCommandEvent(NS_LITERAL_STRING("command"), true, true, ++ nsGlobalWindowInner::Cast(doc->GetInnerWindow()), ++ 0, false, false, false, false, nullptr, 0, rv); ++ if (!rv.Failed()) { ++ event->SetTrusted(true); ++ ContentNode()->DispatchEvent(*event, rv); ++ if (rv.Failed()) { ++ NS_WARNING("Failed to dispatch event"); ++ rv.SuppressException(); ++ } ++ } else { ++ NS_WARNING("Failed to initialize command event"); ++ rv.SuppressException(); ++ } + } ++ } else { ++ NS_WARNING("CreateEvent failed"); ++ rv.SuppressException(); + } + + // This kinda sucks, but Unity doesn't send a closed event @@ -3005,7 +3059,7 @@ new file mode 100644 +} + +void -+nsMenuItem::Update(nsStyleContext *aStyleContext) ++nsMenuItem::Update(ComputedStyle *aComputedStyle) +{ + if (mNeedsUpdate) { + mNeedsUpdate = false; @@ -3016,8 +3070,8 @@ new file mode 100644 + UpdateSensitivity(); + } + -+ UpdateVisibility(aStyleContext); -+ UpdateIcon(aStyleContext); ++ UpdateVisibility(aComputedStyle); ++ UpdateIcon(aComputedStyle); +} + +bool @@ -3080,11 +3134,11 @@ new file mode 100644 + UpdateState(); + } else if (aAttribute == nsGkAtoms::hidden || + aAttribute == nsGkAtoms::collapsed) { -+ RefPtr<nsStyleContext> sc = GetStyleContext(); -+ UpdateVisibility(sc); ++ RefPtr<ComputedStyle> style = GetComputedStyle(); ++ UpdateVisibility(style); + } else if (aAttribute == nsGkAtoms::image) { -+ RefPtr<nsStyleContext> sc = GetStyleContext(); -+ UpdateIcon(sc); ++ RefPtr<ComputedStyle> style = GetComputedStyle(); ++ UpdateIcon(style); + } + } else if (aContent == mKeyContent && + (aAttribute == nsGkAtoms::key || @@ -3127,7 +3181,7 @@ diff --git a/widget/gtk/nsMenuItem.h b/widget/gtk/nsMenuItem.h new file mode 100644 --- /dev/null +++ b/widget/gtk/nsMenuItem.h -@@ -0,0 +1,81 @@ +@@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -3148,7 +3202,6 @@ new file mode 100644 + +class nsAtom; +class nsIContent; -+class nsStyleContext; +class nsMenuBar; +class nsMenuContainer; + @@ -3193,7 +3246,7 @@ new file mode 100644 + + void InitializeNativeData() override; + void UpdateContentAttributes() override; -+ void Update(nsStyleContext *aStyleContext) override; ++ void Update(mozilla::ComputedStyle *aComputedStyle) override; + bool IsCompatibleWithNativeData(DbusmenuMenuitem *aNativeData) const override; + nsMenuObject::PropertyFlags SupportedProperties() const override; + @@ -3228,6 +3281,7 @@ new file mode 100644 +#include "imgRequestProxy.h" +#include "mozilla/ArrayUtils.h" +#include "mozilla/Assertions.h" ++#include "mozilla/ComputedStyle.h" +#include "mozilla/dom/Element.h" +#include "mozilla/Preferences.h" +#include "nsAttrValue.h" @@ -3247,7 +3301,6 @@ new file mode 100644 +#include "nsServiceManagerUtils.h" +#include "nsString.h" +#include "nsStyleConsts.h" -+#include "nsStyleContext.h" +#include "nsStyleStruct.h" +#include "nsUnicharUtils.h" + @@ -3289,7 +3342,7 @@ new file mode 100644 + + nsMenuObjectIconLoader(nsMenuObject *aOwner) : mOwner(aOwner) { }; + -+ void LoadIcon(nsStyleContext *aStyleContext); ++ void LoadIcon(ComputedStyle *aComputedStyle); + void Destroy(); + +private: @@ -3386,7 +3439,7 @@ new file mode 100644 +} + +void -+nsMenuObjectIconLoader::LoadIcon(nsStyleContext *aStyleContext) ++nsMenuObjectIconLoader::LoadIcon(ComputedStyle *aComputedStyle) +{ + nsIDocument *doc = mOwner->ContentNode()->OwnerDoc(); + @@ -3406,11 +3459,11 @@ new file mode 100644 + } + + nsPresContext *pc = shell->GetPresContext(); -+ if (!pc || !aStyleContext) { ++ if (!pc || !aComputedStyle) { + return; + } + -+ const nsStyleList *list = aStyleContext->StyleList(); ++ const nsStyleList *list = aComputedStyle->StyleList(); + imageRequest = list->GetListStyleImage(); + if (imageRequest) { + imageRequest->GetURI(getter_AddRefs(uri)); @@ -3651,13 +3704,13 @@ new file mode 100644 +} + +void -+nsMenuObject::UpdateVisibility(nsStyleContext *aStyleContext) ++nsMenuObject::UpdateVisibility(ComputedStyle *aComputedStyle) +{ + bool vis = true; + -+ if (aStyleContext && -+ (aStyleContext->StyleDisplay()->mDisplay == StyleDisplay::None || -+ aStyleContext->StyleVisibility()->mVisible == ++ if (aComputedStyle && ++ (aComputedStyle->StyleDisplay()->mDisplay == StyleDisplay::None || ++ aComputedStyle->StyleVisibility()->mVisible == + NS_STYLE_VISIBILITY_COLLAPSE)) { + vis = false; + } @@ -3682,14 +3735,14 @@ new file mode 100644 +} + +void -+nsMenuObject::UpdateIcon(nsStyleContext *aStyleContext) ++nsMenuObject::UpdateIcon(ComputedStyle *aComputedStyle) +{ + if (ShouldShowIcon()) { + if (!mIconLoader) { + mIconLoader = new nsMenuObjectIconLoader(this); + } + -+ mIconLoader->LoadIcon(aStyleContext); ++ mIconLoader->LoadIcon(aComputedStyle); + } else { + if (mIconLoader) { + mIconLoader->Destroy(); @@ -3700,14 +3753,14 @@ new file mode 100644 + } +} + -+already_AddRefed<nsStyleContext> -+nsMenuObject::GetStyleContext() ++already_AddRefed<ComputedStyle> ++nsMenuObject::GetComputedStyle() +{ -+ RefPtr<nsStyleContext> sc = -+ nsComputedDOMStyle::GetStyleContextNoFlush( ++ RefPtr<ComputedStyle> style = ++ nsComputedDOMStyle::GetComputedStyleNoFlush( + mContent->AsElement(), nullptr); + -+ return sc.forget(); ++ return style.forget(); +} + +void @@ -3733,7 +3786,7 @@ new file mode 100644 +} + +void -+nsMenuObject::Update(nsStyleContext *aStyleContext) ++nsMenuObject::Update(ComputedStyle *aComputedStyle) +{ +} + @@ -3837,8 +3890,8 @@ new file mode 100644 + + UpdateContentAttributes(); + -+ RefPtr<nsStyleContext> sc = GetStyleContext(); -+ Update(sc); ++ RefPtr<ComputedStyle> style = GetComputedStyle(); ++ Update(style); +} + +/* static */ void @@ -3882,7 +3935,7 @@ diff --git a/widget/gtk/nsMenuObject.h b/widget/gtk/nsMenuObject.h new file mode 100644 --- /dev/null +++ b/widget/gtk/nsMenuObject.h -@@ -0,0 +1,169 @@ +@@ -0,0 +1,172 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -3899,8 +3952,11 @@ new file mode 100644 +#include "nsDbusmenu.h" +#include "nsNativeMenuDocListener.h" + ++namespace mozilla { ++class ComputedStyle; ++} ++ +class nsIContent; -+class nsStyleContext; +class nsMenuContainer; +class nsMenuObjectIconLoader; + @@ -3971,11 +4027,11 @@ new file mode 100644 + }; + + void UpdateLabel(); -+ void UpdateVisibility(nsStyleContext *aStyleContext); ++ void UpdateVisibility(mozilla::ComputedStyle *aComputedStyle); + void UpdateSensitivity(); -+ void UpdateIcon(nsStyleContext *aStyleContext); ++ void UpdateIcon(mozilla::ComputedStyle *aComputedStyle); + -+ already_AddRefed<nsStyleContext> GetStyleContext(); ++ already_AddRefed<mozilla::ComputedStyle> GetComputedStyle(); + +private: + friend class nsMenuObjectIconLoader; @@ -4002,7 +4058,7 @@ new file mode 100644 + // Update properties that should be refreshed when the container opens. + // This should be implemented by subclasses that have properties which + // need refreshing -+ virtual void Update(nsStyleContext *aStyleContext); ++ virtual void Update(mozilla::ComputedStyle *aComputedStyle); + + bool ShouldShowIcon() const; + void ClearIcon(); @@ -4065,11 +4121,11 @@ new file mode 100644 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "mozilla/Assertions.h" ++#include "mozilla/ComputedStyle.h" +#include "mozilla/Move.h" +#include "nsAutoPtr.h" +#include "nsCRT.h" +#include "nsGkAtoms.h" -+#include "nsStyleContext.h" + +#include "nsDbusmenu.h" + @@ -4087,9 +4143,9 @@ new file mode 100644 +} + +void -+nsMenuSeparator::Update(nsStyleContext *aContext) ++nsMenuSeparator::Update(ComputedStyle *aComputedStyle) +{ -+ UpdateVisibility(aContext); ++ UpdateVisibility(aComputedStyle); +} + +bool @@ -4120,8 +4176,8 @@ new file mode 100644 + + if (aAttribute == nsGkAtoms::hidden || + aAttribute == nsGkAtoms::collapsed) { -+ RefPtr<nsStyleContext> sc = GetStyleContext(); -+ UpdateVisibility(sc); ++ RefPtr<ComputedStyle> style = GetComputedStyle(); ++ UpdateVisibility(style); + } +} + @@ -4176,7 +4232,7 @@ new file mode 100644 + +private: + void InitializeNativeData() override; -+ void Update(nsStyleContext *aStyleContext) override; ++ void Update(mozilla::ComputedStyle *aComputedStyle) override; + bool IsCompatibleWithNativeData(DbusmenuMenuitem *aNativeData) const override; + nsMenuObject::PropertyFlags SupportedProperties() const override; + @@ -4205,7 +4261,7 @@ diff --git a/widget/gtk/nsNativeMenuAtoms.cpp b/widget/gtk/nsNativeMenuAtoms.cpp new file mode 100644 --- /dev/null +++ b/widget/gtk/nsNativeMenuAtoms.cpp -@@ -0,0 +1,39 @@ +@@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -4218,38 +4274,51 @@ new file mode 100644 + +#include "nsNativeMenuAtoms.h" + ++ ++namespace mozilla { ++namespace widget { ++namespace detail { ++ ++static constexpr NativeMenuAtoms gNativeMenuAtoms = { ++ #define WIDGET_ATOM(name_) NS_STATIC_ATOM_INIT_STRING(#name_) ++ #define WIDGET_ATOM2(name_, value_) NS_STATIC_ATOM_INIT_STRING(value_) ++ #include "nsNativeMenuAtomList.h" ++ #undef WIDGET_ATOM ++ #undef WIDGET_ATOM2 ++ ++ { ++ #define WIDGET_ATOM(name_) NS_STATIC_ATOM_INIT_ATOM(nsStaticAtom, NativeMenuAtoms, name_, #name_) ++ #define WIDGET_ATOM2(name_, value_) NS_STATIC_ATOM_INIT_ATOM(nsStaticAtom, NativeMenuAtoms, name_, value_) ++ #include "nsNativeMenuAtomList.h" ++ #undef WIDGET_ATOM ++ #undef WIDGET_ATOM2 ++ } ++}; ++ ++} ++} ++} ++ +using namespace mozilla; + -+#define WIDGET_ATOM(name_) NS_STATIC_ATOM_DEFN(nsNativeMenuAtoms, name_) -+#define WIDGET_ATOM2(name_, value_) NS_STATIC_ATOM_DEFN(nsNativeMenuAtoms, name_) -+#include "nsNativeMenuAtomList.h" -+#undef WIDGET_ATOM -+#undef WIDGET_ATOM2 ++const nsStaticAtom* const nsNativeMenuAtoms::sAtoms = widget::detail::gNativeMenuAtoms.mAtoms; + -+#define WIDGET_ATOM(name_) NS_STATIC_ATOM_BUFFER(name_, #name_) -+#define WIDGET_ATOM2(name_, value_) NS_STATIC_ATOM_BUFFER(name_, value_) ++#define WIDGET_ATOM(name_) NS_STATIC_ATOM_DEFN_PTR(nsStaticAtom, widget::detail::NativeMenuAtoms, widget::detail::gNativeMenuAtoms, nsNativeMenuAtoms, name_) ++#define WIDGET_ATOM2(name_, value_) NS_STATIC_ATOM_DEFN_PTR(nsStaticAtom, widget::detail::NativeMenuAtoms, widget::detail::gNativeMenuAtoms, nsNativeMenuAtoms, name_) +#include "nsNativeMenuAtomList.h" +#undef WIDGET_ATOM +#undef WIDGET_ATOM2 + -+static const nsStaticAtomSetup sAtomSetup[] = { -+ #define WIDGET_ATOM(name_) NS_STATIC_ATOM_SETUP(nsNativeMenuAtoms, name_) -+ #define WIDGET_ATOM2(name_, value_) NS_STATIC_ATOM_SETUP(nsNativeMenuAtoms, name_) -+ #include "nsNativeMenuAtomList.h" -+ #undef WIDGET_ATOM -+ #undef WIDGET_ATOM2 -+}; -+ +/* static */ void +nsNativeMenuAtoms::RegisterAtoms() +{ -+ NS_RegisterStaticAtoms(sAtomSetup); ++ NS_RegisterStaticAtoms(sAtoms, sAtomsLen); +} diff --git a/widget/gtk/nsNativeMenuAtoms.h b/widget/gtk/nsNativeMenuAtoms.h new file mode 100644 --- /dev/null +++ b/widget/gtk/nsNativeMenuAtoms.h -@@ -0,0 +1,27 @@ +@@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -4262,18 +4331,52 @@ new file mode 100644 + +class nsAtom; + ++namespace mozilla { ++namespace widget { ++namespace detail { ++ ++struct NativeMenuAtoms ++{ ++ #define WIDGET_ATOM(name_) NS_STATIC_ATOM_DECL_STRING(name_, #name_) ++ #define WIDGET_ATOM2(name_, value_) NS_STATIC_ATOM_DECL_STRING(name_, value_) ++ #include "nsNativeMenuAtomList.h" ++ #undef WIDGET_ATOM ++ #undef WIDGET_ATOM2 ++ ++ enum class Atoms { ++ #define WIDGET_ATOM(name_) NS_STATIC_ATOM_ENUM(name_) ++ #define WIDGET_ATOM2(name_, value_) NS_STATIC_ATOM_ENUM(name_) ++ #include "nsNativeMenuAtomList.h" ++ #undef WIDGET_ATOM ++ #undef WIDGET_ATOM2 ++ AtomsCount ++ }; ++ ++ const nsStaticAtom mAtoms[static_cast<size_t>(Atoms::AtomsCount)]; ++}; ++ ++} ++} ++} ++ +class nsNativeMenuAtoms +{ ++private: ++ static const nsStaticAtom* const sAtoms; ++ ++ static constexpr size_t sAtomsLen = ++ static_cast<size_t>(mozilla::widget::detail::NativeMenuAtoms::Atoms::AtomsCount); ++ +public: + nsNativeMenuAtoms() = delete; + + static void RegisterAtoms(); + -+#define WIDGET_ATOM(name_) NS_STATIC_ATOM_DECL(name_) -+#define WIDGET_ATOM2(name_, value_) NS_STATIC_ATOM_DECL(name_) -+#include "nsNativeMenuAtomList.h" -+#undef WIDGET_ATOM -+#undef WIDGET_ATOM2 ++ #define WIDGET_ATOM(name_) NS_STATIC_ATOM_DECL_PTR(nsStaticAtom, name_) ++ #define WIDGET_ATOM2(name_, value_) NS_STATIC_ATOM_DECL_PTR(nsStaticAtom, name_) ++ #include "nsNativeMenuAtomList.h" ++ #undef WIDGET_ATOM ++ #undef WIDGET_ATOM2 +}; + +#endif /* __nsNativeMenuAtoms_h__ */ @@ -5394,7 +5497,7 @@ new file mode 100644 diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp --- a/widget/gtk/nsWidgetFactory.cpp +++ b/widget/gtk/nsWidgetFactory.cpp -@@ -42,16 +42,18 @@ +@@ -43,16 +43,18 @@ #include "nsImageToPixbuf.h" #include "nsPrintDialogGTK.h" @@ -5413,7 +5516,7 @@ diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp #include "mozilla/gfx/2D.h" #include "mozilla/widget/ScreenManager.h" #include <gtk/gtk.h> -@@ -109,16 +111,19 @@ nsNativeThemeGTKConstructor(nsISupports +@@ -111,16 +113,19 @@ nsNativeThemeGTKConstructor(nsISupports namespace mozilla { namespace widget { // This constructor should really be shared with all platforms. @@ -5433,7 +5536,7 @@ diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintDialogServiceGTK, Init) #endif -@@ -221,16 +226,17 @@ NS_DEFINE_NAMED_CID(NS_PRINTSESSION_CID) +@@ -224,16 +229,17 @@ NS_DEFINE_NAMED_CID(NS_PRINTSESSION_CID) NS_DEFINE_NAMED_CID(NS_DEVICE_CONTEXT_SPEC_CID); NS_DEFINE_NAMED_CID(NS_PRINTDIALOGSERVICE_CID); #endif @@ -5451,7 +5554,7 @@ diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp { &kNS_APPSHELL_CID, false, nullptr, nsAppShellConstructor, Module::ALLOW_IN_GPU_PROCESS }, { &kNS_COLORPICKER_CID, false, nullptr, nsColorPickerConstructor, Module::MAIN_PROCESS_ONLY }, { &kNS_FILEPICKER_CID, false, nullptr, nsFilePickerConstructor, Module::MAIN_PROCESS_ONLY }, -@@ -256,16 +262,17 @@ static const mozilla::Module::CIDEntry k +@@ -260,16 +266,17 @@ static const mozilla::Module::CIDEntry k { &kNS_DEVICE_CONTEXT_SPEC_CID, false, nullptr, nsDeviceContextSpecGTKConstructor }, { &kNS_PRINTDIALOGSERVICE_CID, false, nullptr, nsPrintDialogServiceGTKConstructor }, #endif @@ -5469,7 +5572,7 @@ diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp { "@mozilla.org/widgets/child_window/gtk;1", &kNS_CHILD_CID }, { "@mozilla.org/widget/appshell/gtk;1", &kNS_APPSHELL_CID, Module::ALLOW_IN_GPU_PROCESS }, { "@mozilla.org/colorpicker;1", &kNS_COLORPICKER_CID, Module::MAIN_PROCESS_ONLY }, -@@ -293,16 +300,17 @@ static const mozilla::Module::ContractID +@@ -298,16 +305,17 @@ static const mozilla::Module::ContractID { "@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID }, { NS_PRINTDIALOGSERVICE_CONTRACTID, &kNS_PRINTDIALOGSERVICE_CID }, #endif @@ -5490,7 +5593,7 @@ diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp -@@ -62,16 +62,17 @@ +@@ -63,16 +63,17 @@ #ifdef MOZ_ENABLE_STARTUP_NOTIFICATION #define SN_API_NOT_YET_FROZEN @@ -5508,7 +5611,7 @@ diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp #include "nsGtkUtils.h" #include "nsIObserverService.h" #include "mozilla/layers/LayersTypes.h" -@@ -5113,16 +5114,21 @@ nsWindow::SetWindowDecoration(nsBorderSt +@@ -5219,16 +5220,21 @@ nsWindow::SetWindowDecoration(nsBorderSt } void @@ -5552,7 +5655,7 @@ diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h #include "Units.h" extern mozilla::LazyLogModule gWidgetLog; -@@ -158,16 +160,18 @@ public: +@@ -159,16 +161,18 @@ public: uint16_t aDuration, nsISupports* aData, nsIRunnable* aCallback) override; @@ -5571,7 +5674,7 @@ diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h // utility method, -1 if no change should be made, otherwise returns a // value that can be passed to gdk_window_set_decorations -@@ -590,11 +594,13 @@ private: +@@ -632,11 +636,13 @@ private: * all windows in a hierarchy. If the children are released after the top * level window is released, the children still have a valid pointer, * however, IME doesn't work at that time. @@ -5588,10 +5691,10 @@ diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h diff --git a/widget/moz.build b/widget/moz.build --- a/widget/moz.build +++ b/widget/moz.build -@@ -59,19 +59,19 @@ if toolkit == 'windows': - elif toolkit == 'cocoa': +@@ -60,19 +60,19 @@ elif toolkit == 'cocoa': XPIDL_SOURCES += [ 'nsIMacDockSupport.idl', + 'nsIMacSharingService.idl', 'nsIMacWebAppUtils.idl', 'nsIStandaloneNativeMenu.idl', 'nsISystemStatusBar.idl', @@ -5601,7 +5704,7 @@ diff --git a/widget/moz.build b/widget/moz.build - 'nsINativeMenuService.h', - ] + -+if toolkit in ('cocoa', 'gtk2', 'gtk3'): ++if toolkit in ('cocoa', 'gtk3'): + EXPORTS += ['nsINativeMenuService.h'] TEST_DIRS += ['tests'] @@ -5614,7 +5717,7 @@ diff --git a/widget/moz.build b/widget/moz.build diff --git a/xpfe/appshell/nsWebShellWindow.cpp b/xpfe/appshell/nsWebShellWindow.cpp --- a/xpfe/appshell/nsWebShellWindow.cpp +++ b/xpfe/appshell/nsWebShellWindow.cpp -@@ -66,17 +66,17 @@ +@@ -62,17 +62,17 @@ #include "mozilla/DebugOnly.h" #include "mozilla/EventDispatcher.h" #include "mozilla/MouseEvents.h" |