diff options
-rw-r--r-- | .SRCINFO | 44 | ||||
-rw-r--r-- | 0001-bz-1468911.patch.xz | bin | 126052 -> 0 bytes | |||
-rw-r--r-- | 2009_rust-1.33-support.patch.xz | bin | 0 -> 664 bytes | |||
-rw-r--r-- | 2010_rust-1.33-support.patch.xz | bin | 0 -> 127264 bytes | |||
-rw-r--r-- | 2011_rust-1.33-support.patch.xz | bin | 0 -> 24176 bytes | |||
-rw-r--r-- | 2014_spectre_variant2_bug1542958.patch | 82 | ||||
-rw-r--r-- | 2015_spectre_variant2_bug1542958.patch | 32 | ||||
-rw-r--r-- | 7002_system_av1_support.patch | 74 | ||||
-rw-r--r-- | PKGBUILD | 52 | ||||
-rw-r--r-- | mozconfig | 1 | ||||
-rw-r--r-- | unity-menubar.patch | 88 |
11 files changed, 288 insertions, 85 deletions
@@ -1,8 +1,8 @@ # Generated by mksrcinfo v8 -# Fri May 10 08:54:52 UTC 2019 +# Wed May 22 07:55:58 UTC 2019 pkgbase = firefox-kde-opensuse pkgdesc = Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE - pkgver = 66.0.5 + pkgver = 67.0 pkgrel = 1 url = https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox arch = i686 @@ -50,21 +50,25 @@ pkgbase = firefox-kde-opensuse depends = kmozillahelper depends = ffmpeg depends = gtk3 + depends = dav1d + depends = aom + depends = harfbuzz + depends = graphite optdepends = networkmanager: Location detection via available WiFi networks optdepends = speech-dispatcher: Text-to-Speech optdepends = pulseaudio: Audio support - provides = firefox=66.0.5 + provides = firefox=67.0 conflicts = firefox options = !emptydirs - source = hg+https://hg.mozilla.org/mozilla-unified#tag=FIREFOX_66_0_5_RELEASE + source = hg+https://hg.mozilla.org/mozilla-unified#tag=FIREFOX_67_0_RELEASE source = mozconfig source = firefox.desktop source = vendor.js source = kde.js - source = firefox-branded-icons-eca1c1f2fe50.patch::http://www.rosenauer.org/hg/mozilla/raw-file/eca1c1f2fe50/firefox-branded-icons.patch - source = firefox-kde-eca1c1f2fe50.patch::http://www.rosenauer.org/hg/mozilla/raw-file/eca1c1f2fe50/firefox-kde.patch - source = mozilla-kde-eca1c1f2fe50.patch::http://www.rosenauer.org/hg/mozilla/raw-file/eca1c1f2fe50/mozilla-kde.patch - source = mozilla-nongnome-proxies-eca1c1f2fe50.patch::http://www.rosenauer.org/hg/mozilla/raw-file/eca1c1f2fe50/mozilla-nongnome-proxies.patch + source = firefox-branded-icons-3942c205588b.patch::http://www.rosenauer.org/hg/mozilla/raw-file/3942c205588b/firefox-branded-icons.patch + source = firefox-kde-3942c205588b.patch::http://www.rosenauer.org/hg/mozilla/raw-file/3942c205588b/firefox-kde.patch + source = mozilla-kde-3942c205588b.patch::http://www.rosenauer.org/hg/mozilla/raw-file/3942c205588b/mozilla-kde.patch + source = mozilla-nongnome-proxies-3942c205588b.patch::http://www.rosenauer.org/hg/mozilla/raw-file/3942c205588b/mozilla-nongnome-proxies.patch source = unity-menubar.patch source = add_missing_pgo_rule.patch source = pgo_fix_missing_kdejs.patch @@ -73,17 +77,22 @@ pkgbase = firefox-kde-opensuse source = mozilla-1516803.patch source = mozilla-1516081.patch source = pgo.patch - source = 0001-bz-1468911.patch.xz + source = 2009_rust-1.33-support.patch.xz + source = 2010_rust-1.33-support.patch.xz + source = 2011_rust-1.33-support.patch.xz + source = 7002_system_av1_support.patch + source = 2014_spectre_variant2_bug1542958.patch + source = 2015_spectre_variant2_bug1542958.patch md5sums = SKIP - md5sums = 7a93c5b10defc17661cb13138d38b6bc + md5sums = 15a351d5936fb76a779d3afa2baa1308 md5sums = 14e0f6237a79b85e60256f4808163160 md5sums = 5cee310a9040ccc5abcf29742b84aeb8 md5sums = 05bb69d25fb3572c618e3adf1ee7b670 md5sums = d7ce23a18da21c05cd756766e177834f - md5sums = acb2d5930350fb287709283103cfffe2 - md5sums = 7dbeb468613520beba5de17471487e6c - md5sums = f1c5db18b8910b80f1933af1f4fe7c2b - md5sums = 97cb13d3dfb6222d09070d2c22019deb + md5sums = 1fd3db31015977eb77960716d6d2dbe6 + md5sums = 270eed48793b9358702e7de6185c32be + md5sums = 73e7380641d8c3bf78a51ef2f95f69f2 + md5sums = 4cd539459e253f53f631ccca51650a87 md5sums = fe24f5ea463013bb7f1c12d12dce41b2 md5sums = 3fa8bd22d97248de529780f5797178af md5sums = 554514bf00a7927a85280f19e52a55fb @@ -91,7 +100,12 @@ pkgbase = firefox-kde-opensuse md5sums = becf6bf9ceb6008401832c855ccadff9 md5sums = 79d27c8896913c7d87b148240995ab69 md5sums = f867ae41a722630cc5567e2dcc51676d - md5sums = 47a4608970217485250b7e9bc59609e3 + md5sums = ef358dae95d487740dda8114df4d5f90 + md5sums = f343dc6520abb0be8eb77da17256ce21 + md5sums = 4594ded5cdcdaae038bc49645643f914 + md5sums = df439e02304d302009c320a540f01dbe + md5sums = f0e6dccbb32695d2d9057dacd650822c + md5sums = cca2f77b28b5fd53cbc919045006ab0a pkgname = firefox-kde-opensuse diff --git a/0001-bz-1468911.patch.xz b/0001-bz-1468911.patch.xz Binary files differdeleted file mode 100644 index 7bffaac360cd..000000000000 --- a/0001-bz-1468911.patch.xz +++ /dev/null diff --git a/2009_rust-1.33-support.patch.xz b/2009_rust-1.33-support.patch.xz Binary files differnew file mode 100644 index 000000000000..8836f2802ff1 --- /dev/null +++ b/2009_rust-1.33-support.patch.xz diff --git a/2010_rust-1.33-support.patch.xz b/2010_rust-1.33-support.patch.xz Binary files differnew file mode 100644 index 000000000000..6e7a185d136c --- /dev/null +++ b/2010_rust-1.33-support.patch.xz diff --git a/2011_rust-1.33-support.patch.xz b/2011_rust-1.33-support.patch.xz Binary files differnew file mode 100644 index 000000000000..3b194a8c65a5 --- /dev/null +++ b/2011_rust-1.33-support.patch.xz diff --git a/2014_spectre_variant2_bug1542958.patch b/2014_spectre_variant2_bug1542958.patch new file mode 100644 index 000000000000..1f77056c5592 --- /dev/null +++ b/2014_spectre_variant2_bug1542958.patch @@ -0,0 +1,82 @@ +# HG changeset patch +# Parent d30cb471a35b400d3db84e24b0d653b82fedd458 +Bug 1542958 - avoid malloc/delete[] mismatches in elfhack; r=glandium + +We were allocating ElfSection's data with `new[]` and modifying it with +`realloc` in some places, which causes allocator mismatches. +Consistently manage the data with `malloc`, `realloc`, and `free` instead. + +Differential Revision: https://phabricator.services.mozilla.com/D27327 + +diff --git a/build/unix/elfhack/elf.cpp b/build/unix/elfhack/elf.cpp +--- a/build/unix/elfhack/elf.cpp ++++ b/build/unix/elfhack/elf.cpp +@@ -492,17 +492,20 @@ ElfSection::ElfSection(Elf_Shdr &s, std: + : parent->getSection(shdr.sh_link)), + next(nullptr), + previous(nullptr), + index(-1) { + if ((file == nullptr) || (shdr.sh_type == SHT_NULL) || + (shdr.sh_type == SHT_NOBITS)) + data = nullptr; + else { +- data = new char[shdr.sh_size]; ++ data = static_cast<char *>(malloc(shdr.sh_size)); ++ if (!data) { ++ throw std::runtime_error("Could not malloc ElfSection data"); ++ } + int pos = file->tellg(); + file->seekg(shdr.sh_offset); + file->read(data, shdr.sh_size); + file->seekg(pos); + } + if (shdr.sh_name == 0) + name = nullptr; + else { +diff --git a/build/unix/elfhack/elfhack.cpp b/build/unix/elfhack/elfhack.cpp +--- a/build/unix/elfhack/elfhack.cpp ++++ b/build/unix/elfhack/elfhack.cpp +@@ -174,17 +174,20 @@ class ElfRelHackCode_Section : public El + addr = (addr | ((*c)->getAddrAlign() - 1)) + 1; + (*c)->getShdr().sh_addr = addr; + // We need to align this section depending on the greater + // alignment required by code sections. + if (shdr.sh_addralign < (*c)->getAddrAlign()) + shdr.sh_addralign = (*c)->getAddrAlign(); + } + shdr.sh_size = code.back()->getAddr() + code.back()->getSize(); +- data = new char[shdr.sh_size]; ++ data = static_cast<char *>(malloc(shdr.sh_size)); ++ if (!data) { ++ throw std::runtime_error("Could not malloc ElfSection data"); ++ } + char *buf = data; + for (c = code.begin(); c != code.end(); ++c) { + memcpy(buf, (*c)->getData(), (*c)->getSize()); + buf += (*c)->getSize(); + } + name = elfhack_text; + } + +diff --git a/build/unix/elfhack/elfxx.h b/build/unix/elfhack/elfxx.h +--- a/build/unix/elfhack/elfxx.h ++++ b/build/unix/elfhack/elfxx.h +@@ -320,17 +320,17 @@ class ElfSection { + public: + typedef union { + ElfSection *section; + int index; + } SectionInfo; + + ElfSection(Elf_Shdr &s, std::ifstream *file, Elf *parent); + +- virtual ~ElfSection() { delete[] data; } ++ virtual ~ElfSection() { free(data); } + + const char *getName() { return name; } + unsigned int getType() { return shdr.sh_type; } + unsigned int getFlags() { return shdr.sh_flags; } + unsigned int getAddr(); + unsigned int getSize() { return shdr.sh_size; } + unsigned int getAddrAlign() { return shdr.sh_addralign; } + unsigned int getEntSize() { return shdr.sh_entsize; } diff --git a/2015_spectre_variant2_bug1542958.patch b/2015_spectre_variant2_bug1542958.patch new file mode 100644 index 000000000000..5a3a97c42578 --- /dev/null +++ b/2015_spectre_variant2_bug1542958.patch @@ -0,0 +1,32 @@ +# HG changeset patch +# Parent f5febee8d7dc9cf6ba776d6a8550f87eb343f998 +Bug 1542958 - fix code section adjustments in elfhack; r=glandium + +We were never adjusting `last` in this loop, so we were computing the +wrong addresses for all sections beyond the first. Which in turn meant +that we would compute the wrong size for the section data we needed to +allocate. + +Differential Revision: https://phabricator.services.mozilla.com/D28195 + +diff --git a/build/unix/elfhack/elfhack.cpp b/build/unix/elfhack/elfhack.cpp +--- a/build/unix/elfhack/elfhack.cpp ++++ b/build/unix/elfhack/elfhack.cpp +@@ -172,16 +172,17 @@ class ElfRelHackCode_Section : public El + unsigned int addr = last->getShdr().sh_addr + last->getSize(); + if (addr & ((*c)->getAddrAlign() - 1)) + addr = (addr | ((*c)->getAddrAlign() - 1)) + 1; + (*c)->getShdr().sh_addr = addr; + // We need to align this section depending on the greater + // alignment required by code sections. + if (shdr.sh_addralign < (*c)->getAddrAlign()) + shdr.sh_addralign = (*c)->getAddrAlign(); ++ last = *c; + } + shdr.sh_size = code.back()->getAddr() + code.back()->getSize(); + data = static_cast<char *>(malloc(shdr.sh_size)); + if (!data) { + throw std::runtime_error("Could not malloc ElfSection data"); + } + char *buf = data; + for (c = code.begin(); c != code.end(); ++c) { diff --git a/7002_system_av1_support.patch b/7002_system_av1_support.patch new file mode 100644 index 000000000000..562028317d31 --- /dev/null +++ b/7002_system_av1_support.patch @@ -0,0 +1,74 @@ +Add ability to use system-av1 (media-libs/libaom and media-libs/dav1d) instead of bundled. + +--- a/config/external/moz.build ++++ b/config/external/moz.build +@@ -37,8 +37,9 @@ if not CONFIG['MOZ_SYSTEM_LIBVPX']: + external_dirs += ['media/libvpx'] + + if CONFIG['MOZ_AV1']: +- external_dirs += ['media/libaom'] +- external_dirs += ['media/libdav1d'] ++ if not CONFIG['MOZ_SYSTEM_AV1']: ++ external_dirs += ['media/libaom'] ++ external_dirs += ['media/libdav1d'] + + if not CONFIG['MOZ_SYSTEM_PNG']: + external_dirs += ['media/libpng'] +--- a/config/system-headers.mozbuild ++++ b/config/system-headers.mozbuild +@@ -1316,6 +1316,14 @@ if CONFIG['MOZ_ENABLE_CONTENTMANAGER']: + 'SelectSingleContentItemPage.h', + ] + ++if CONFIG['MOZ_SYSTEM_AV1']: ++ system_headers += [ ++ 'aom/aom_decoder.h', ++ 'aom/aomdx.h', ++ 'aom/aom_image.h', ++ 'dav1d/dav1d.h', ++ ] ++ + if CONFIG['MOZ_SYSTEM_LIBVPX']: + system_headers += [ + 'vpx_mem/vpx_mem.h', +--- a/dom/media/platforms/moz.build ++++ b/dom/media/platforms/moz.build +@@ -78,6 +78,11 @@ if CONFIG['MOZ_AV1']: + 'agnostic/AOMDecoder.cpp', + 'agnostic/DAV1DDecoder.cpp', + ] ++ if CONFIG['MOZ_SYSTEM_AV1']: ++ CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBAOM_CFLAGS'] ++ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBAOM_LIBS'] ++ CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS'] ++ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS'] + + if CONFIG['MOZ_OMX']: + EXPORTS += [ +--- a/toolkit/moz.configure ++++ b/toolkit/moz.configure +@@ -464,6 +464,24 @@ def av1(value, target, c_compiler): + set_config('MOZ_AV1', av1) + set_define('MOZ_AV1', av1) + ++option('--with-system-av1', ++ help="Use system av1 (located with pkgconfig)") ++ ++system_libaom_info = pkg_check_modules('MOZ_SYSTEM_LIBAOM', 'aom >= 1.0.0', ++ when='--with-system-av1') ++ ++system_libdav1d_info = pkg_check_modules('MOZ_SYSTEM_LIBDAV1D', 'dav1d >= 0.1.1', ++ when='--with-system-av1') ++ ++@depends(system_libaom_info, system_libdav1d_info) ++def system_av1(system_libaom_info, system_libdav1d_info): ++ has_av1_libs = False ++ if system_libaom_info and system_libdav1d_info: ++ has_av1_libs = True ++ return has_av1_libs ++ ++set_config('MOZ_SYSTEM_AV1', depends_if(system_av1)(lambda _: True)) ++ + # Built-in fragmented MP4 support. + # ============================================================== + option('--disable-fmp4', env='MOZ_FMP4', @@ -14,9 +14,12 @@ _pgo=true # http://bazaar.launchpad.net/~mozillateam/firefox/firefox-trunk.head # /view/head:/debian/patches/unity-menubar.patch +# patches from gentoo: +# https://dev.gentoo.org/~anarchy/mozilla/patchsets/firefox-67.0-patches-05.tar.xz + _pkgname=firefox pkgname=$_pkgname-kde-opensuse -pkgver=66.0.5 +pkgver=67.0 pkgrel=1 pkgdesc="Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE" arch=('i686' 'x86_64') @@ -25,7 +28,13 @@ url="https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox" depends=('mozilla-common' 'libxt' 'startup-notification' 'mime-types' 'dbus-glib' 'hicolor-icon-theme' 'libvpx' 'icu' 'libevent' 'nss>=3.28.3' 'nspr>=4.10.6' 'hunspell' - 'sqlite' 'libnotify' 'kmozillahelper' 'ffmpeg' 'gtk3') + 'sqlite' 'libnotify' 'kmozillahelper' 'ffmpeg' 'gtk3' + # system av1 + 'dav1d' 'aom' + # system harfbuzz + 'harfbuzz' + # system graphite + 'graphite') makedepends=('unzip' 'zip' 'diffutils' 'python2-setuptools' 'yasm' 'mesa' 'imake' 'xorg-server-xvfb' 'libpulse' 'inetutils' 'autoconf2.13' 'rust' @@ -37,7 +46,7 @@ optdepends=('networkmanager: Location detection via available WiFi networks' 'pulseaudio: Audio support') provides=("firefox=${pkgver}") conflicts=('firefox') -_patchrev=eca1c1f2fe50 +_patchrev=3942c205588b options=('!emptydirs') _patchurl=http://www.rosenauer.org/hg/mozilla/raw-file/$_patchrev _repo=https://hg.mozilla.org/mozilla-unified @@ -62,7 +71,15 @@ source=("hg+$_repo#tag=FIREFOX_${pkgver//./_}_RELEASE" mozilla-1516081.patch pgo.patch # https://bugzilla.mozilla.org/show_bug.cgi?id=1521249 - 0001-bz-1468911.patch.xz + 2009_rust-1.33-support.patch.xz + 2010_rust-1.33-support.patch.xz + 2011_rust-1.33-support.patch.xz + # use sytem av1 + 7002_system_av1_support.patch + # https://bugzilla.mozilla.org/show_bug.cgi?id=1542958 + # note: fixes compile errrors when using elf migrartion + 2014_spectre_variant2_bug1542958.patch + 2015_spectre_variant2_bug1542958.patch ) # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) @@ -106,12 +123,20 @@ prepare() { patch -Np1 -i "$srcdir"/2000_system_harfbuzz_support.patch patch -Np1 -i "$srcdir"/2001_system_graphite2_support.patch + patch -Np1 -i "$srcdir"/7002_system_av1_support.patch # https://bugzilla.mozilla.org/show_bug.cgi?id=1521249 # patch -Np1 -i ../0001-bz-1468911.patch patch is to large for the AUR - xzcat "$srcdir"/0001-bz-1468911.patch.xz | patch -Np1 + xzcat "$srcdir"/2009_rust-1.33-support.patch.xz | patch -Np1 + xzcat "$srcdir"/2010_rust-1.33-support.patch.xz | patch -Np1 + xzcat "$srcdir"/2011_rust-1.33-support.patch.xz | patch -Np1 + # https://bugzilla.mozilla.org/show_bug.cgi?id=1542958 + # note: fixes compile errrors when using elf migrartion + patch -Np1 -i "$srcdir"/2014_spectre_variant2_bug1542958.patch + patch -Np1 -i "$srcdir"/2015_spectre_variant2_bug1542958.patch + if [[ $_pgo ]] ; then # https://bugzilla.mozilla.org/show_bug.cgi?id=1516803 patch -Np1 -i "$srcdir"/mozilla-1516803.patch @@ -206,15 +231,15 @@ END ln -sf firefox "$pkgdir/usr/lib/firefox/firefox-bin" } md5sums=('SKIP' - '7a93c5b10defc17661cb13138d38b6bc' + '15a351d5936fb76a779d3afa2baa1308' '14e0f6237a79b85e60256f4808163160' '5cee310a9040ccc5abcf29742b84aeb8' '05bb69d25fb3572c618e3adf1ee7b670' 'd7ce23a18da21c05cd756766e177834f' - 'acb2d5930350fb287709283103cfffe2' - '7dbeb468613520beba5de17471487e6c' - 'f1c5db18b8910b80f1933af1f4fe7c2b' - '97cb13d3dfb6222d09070d2c22019deb' + '1fd3db31015977eb77960716d6d2dbe6' + '270eed48793b9358702e7de6185c32be' + '73e7380641d8c3bf78a51ef2f95f69f2' + '4cd539459e253f53f631ccca51650a87' 'fe24f5ea463013bb7f1c12d12dce41b2' '3fa8bd22d97248de529780f5797178af' '554514bf00a7927a85280f19e52a55fb' @@ -222,4 +247,9 @@ md5sums=('SKIP' 'becf6bf9ceb6008401832c855ccadff9' '79d27c8896913c7d87b148240995ab69' 'f867ae41a722630cc5567e2dcc51676d' - '47a4608970217485250b7e9bc59609e3') + 'ef358dae95d487740dda8114df4d5f90' + 'f343dc6520abb0be8eb77da17256ce21' + '4594ded5cdcdaae038bc49645643f914' + 'df439e02304d302009c320a540f01dbe' + 'f0e6dccbb32695d2d9057dacd650822c' + 'cca2f77b28b5fd53cbc919045006ab0a') diff --git a/mozconfig b/mozconfig index 414132dff4ff..0d89dc1b1162 100644 --- a/mozconfig +++ b/mozconfig @@ -33,6 +33,7 @@ ac_add_options --with-system-graphite2 ac_add_options --enable-system-sqlite ac_add_options --enable-system-ffi ac_add_options --enable-system-pixman +ac_add_options --enable-system-av1 ac_add_options --disable-libproxy #ac_add_options --enable-shared-js diff --git a/unity-menubar.patch b/unity-menubar.patch index 9147edcbc985..a8cbd9530c46 100644 --- a/unity-menubar.patch +++ b/unity-menubar.patch @@ -14,7 +14,7 @@ <menu id="file-menu" label="&fileMenu.label;" --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js -@@ -5595,11 +5595,17 @@ function onViewToolbarsPopupShowing(aEve +@@ -5776,11 +5776,17 @@ function onViewToolbarsPopupShowing(aEve let toolbarNodes = gNavToolbox.querySelectorAll("toolbar"); @@ -34,7 +34,7 @@ "autohide" : "collapsed"; --- a/browser/components/places/content/places.xul +++ b/browser/components/places/content/places.xul -@@ -171,7 +171,7 @@ +@@ -173,7 +173,7 @@ <toolbarbutton type="menu" class="tabbable" onpopupshowing="document.getElementById('placeContent').focus()" #else @@ -93,11 +93,11 @@ + '/widget/gtk', + ] - if CONFIG['MOZ_WEBSPEECH']: - LOCAL_INCLUDES += [ + XPCOM_MANIFESTS += [ + 'components.conf', --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js -@@ -275,6 +275,9 @@ pref("dom.window.event.enabled", true); +@@ -277,6 +277,9 @@ pref("dom.window.event.enabled", true); pref("browser.sessionhistory.max_total_viewers", -1); pref("ui.use_native_colors", true); @@ -109,7 +109,7 @@ // Pop up context menu on mouseup instead of mousedown, if that's the OS default. --- a/toolkit/content/xul.css +++ b/toolkit/content/xul.css -@@ -250,6 +250,18 @@ toolbar[type="menubar"] { +@@ -244,6 +244,18 @@ toolbar[type="menubar"] { } %endif @@ -130,7 +130,7 @@ } --- a/widget/gtk/moz.build +++ b/widget/gtk/moz.build -@@ -52,6 +52,15 @@ UNIFIED_SOURCES += [ +@@ -53,6 +53,15 @@ UNIFIED_SOURCES += [ ] SOURCES += [ @@ -146,7 +146,7 @@ 'nsWindow.cpp', # conflicts with X11 headers ] -@@ -119,6 +128,7 @@ FINAL_LIBRARY = 'xul' +@@ -124,6 +133,7 @@ FINAL_LIBRARY = 'xul' LOCAL_INCLUDES += [ '/layout/base', '/layout/generic', @@ -324,7 +324,7 @@ +#endif /* __nsDbusmenu_h__ */ --- /dev/null +++ b/widget/gtk/nsMenu.cpp -@@ -0,0 +1,847 @@ +@@ -0,0 +1,845 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -669,9 +669,7 @@ + for (uint32_t i = 0; i < ContentNode()->GetChildCount(); ++i) { + nsIContent *child = ContentNode()->GetChildAt_Deprecated(i); + -+ int32_t dummy; -+ nsAtom* tag = child->OwnerDoc()->BindingManager()->ResolveTag(child, &dummy); -+ if (tag == nsGkAtoms::menupopup) { ++ if (child->NodeInfo()->NameAtom() == nsGkAtoms::menupopup) { + mPopupContent = child; + break; + } @@ -5140,51 +5138,6 @@ +}; + +#endif /* __nsNativeMenuService_h__ */ ---- a/widget/gtk/nsWidgetFactory.cpp -+++ b/widget/gtk/nsWidgetFactory.cpp -@@ -48,6 +48,8 @@ - # include "GfxInfoX11.h" - #endif - -+#include "nsNativeMenuService.h" -+ - #include "nsIComponentRegistrar.h" - #include "nsComponentManagerUtils.h" - #include "mozilla/gfx/2D.h" -@@ -81,6 +83,9 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxI - } // namespace mozilla - #endif - -+NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsNativeMenuService, -+ nsNativeMenuService::GetInstanceForServiceManager) -+ - #ifdef NS_PRINTING - NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecGTK) - NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSettingsServiceGTK, Init) -@@ -182,6 +187,7 @@ NS_DEFINE_NAMED_CID(NS_IMAGE_TO_PIXBUF_C - NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID); - NS_DEFINE_NAMED_CID(NS_GFXINFO_CID); - #endif -+NS_DEFINE_NAMED_CID(NS_NATIVEMENUSERVICE_CID); - - static const mozilla::Module::CIDEntry kWidgetCIDs[] = { - {&kNS_APPSHELL_CID, false, nullptr, nsAppShellConstructor, -@@ -225,6 +231,7 @@ static const mozilla::Module::CIDEntry k - {&kNS_IDLE_SERVICE_CID, false, nullptr, nsIdleServiceGTKConstructor}, - {&kNS_GFXINFO_CID, false, nullptr, mozilla::widget::GfxInfoConstructor}, - #endif -+ {&kNS_NATIVEMENUSERVICE_CID, true, nullptr, nsNativeMenuServiceConstructor}, - {nullptr}}; - - static const mozilla::Module::ContractIDEntry kWidgetContracts[] = { -@@ -263,6 +270,7 @@ static const mozilla::Module::ContractID - {"@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID}, - {"@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID}, - #endif -+ {"@mozilla.org/widget/nativemenuservice;1", &kNS_NATIVEMENUSERVICE_CID}, - {nullptr}}; - - static void nsWidgetGtk2ModuleDtor() { --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -70,6 +70,7 @@ @@ -5195,7 +5148,7 @@ #include "mozilla/Preferences.h" #include "nsIPrefService.h" #include "nsIGConfService.h" -@@ -4765,6 +4766,10 @@ void nsWindow::HideWindowChrome(bool aSh +@@ -4843,6 +4844,10 @@ void nsWindow::HideWindowChrome(bool aSh SetWindowDecoration(aShouldHide ? eBorderStyle_none : mBorderStyle); } @@ -5226,7 +5179,7 @@ /** * GetLastUserInputTime returns a timestamp for the most recent user input * event. This is intended for pointer grab requests (including drags). -@@ -616,6 +620,8 @@ class nsWindow final : public nsBaseWidg +@@ -622,6 +626,8 @@ class nsWindow final : public nsBaseWidg mozilla::UniquePtr<mozilla::CurrentX11TimeGetter> mCurrentTimeGetter; static CSDSupportLevel sCSDSupportLevel; @@ -5292,3 +5245,20 @@ def verify(): +--- a/widget/gtk/components.conf ++++ b/widget/gtk/components.conf +@@ -75,6 +75,14 @@ Classes = [ + 'type': 'nsTransferable', + 'headers': ['/widget/nsTransferable.h'], + }, ++ { ++ 'cid': '{0B3FE5AA-BC72-4303-85AE-76365DF1251D}', ++ 'contract_ids': ['@mozilla.org/widget/nativemenuservice;1'], ++ 'singleton': True, ++ 'type': 'nsNativeMenuService', ++ 'constructor': 'nsNativeMenuService::GetInstanceForServiceManager', ++ 'headers': ['/widget/gtk/nsNativeMenuService.h'], ++ }, + ] + + if defined('MOZ_X11'): |