summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authornikatar2019-12-09 09:29:08 +0300
committernikatar2019-12-09 09:29:08 +0300
commit40e24ea6e8e202aaba5b1593d0b3861a48f9acbd (patch)
treebd693be33559f97f64ff05a832796ad00271a12e
parent58098d32a793e98c65a0231f55dafc6e76b4868f (diff)
downloadaur-40e24ea6e8e202aaba5b1593d0b3861a48f9acbd.tar.gz
68.3.0-1
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD34
-rw-r--r--rust-1.35.patch47
-rw-r--r--thunderbird-rust-1.39.patch170
-rw-r--r--unity-menubar.patch683
5 files changed, 481 insertions, 475 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f8657f086727..9be0c792cc6b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
pkgbase = thunderbird-appmenu
pkgdesc = Thunderbird from extra with appmenu patch
- pkgver = 60.8.0
+ pkgver = 68.3.0
pkgrel = 1
- url = https://aur.archlinux.org/packages/thunderbird-appmenu/
+ url = https://www.mozilla.org/thunderbird/
arch = x86_64
license = MPL
license = GPL
@@ -10,8 +10,10 @@ pkgbase = thunderbird-appmenu
makedepends = unzip
makedepends = zip
makedepends = diffutils
+ makedepends = python
makedepends = python2
makedepends = yasm
+ makedepends = nasm
makedepends = mesa
makedepends = imake
makedepends = libpulse
@@ -22,6 +24,8 @@ pkgbase = thunderbird-appmenu
makedepends = clang
makedepends = llvm
makedepends = gtk2
+ makedepends = cbindgen
+ makedepends = nodejs
depends = gtk3
depends = mozilla-common
depends = libxt
@@ -35,21 +39,21 @@ pkgbase = thunderbird-appmenu
depends = ttf-font
depends = icu
optdepends = libcanberra: sound support
- provides = thunderbird=60.8.0
+ provides = thunderbird=68.3.0
conflicts = thunderbird
options = !emptydirs
options = !makeflags
- source = https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/60.8.0/source/thunderbird-60.8.0.source.tar.xz
- source = https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/60.8.0/source/thunderbird-60.8.0.source.tar.xz.asc
- source = rust-1.35.patch
+ source = https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/68.3.0/source/thunderbird-68.3.0.source.tar.xz
+ source = https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/68.3.0/source/thunderbird-68.3.0.source.tar.xz.asc
+ source = thunderbird-rust-1.39.patch
source = thunderbird.desktop
source = unity-menubar.patch
validpgpkeys = 14F26682D0916CDD81E37B6D61B7B526D98F0353
- sha256sums = 1e7a13e64b63476d2235aaac6823fdab949af45cfcd5a25ee710cbae08c2f5d1
+ sha256sums = f68cb53deb6c1840cc3f2b1e842bac8ebaf090e9cd89afb376ba0e1ba62820aa
sha256sums = SKIP
- sha256sums = 3257987cc0ab0559c65561d523eb4d0e73b5edb86d9d18a2487818d9fca0bb30
+ sha256sums = 08834ef1c2dd685edd40dea20dfa9d4b889f5c387385ac329a162eeff6cf90be
sha256sums = 3534ea85d8e0e35dba5f40a7a07844df19f3a480e1358fc50c2502f122dab789
- sha256sums = 22786f52773b93046fdb12378f67343b1d7d3390e83a00ff4aa03948c2b1c9e2
+ sha256sums = bcb0dab3bbe5b2ca2bcc8e2d9856bc8583b603da6573618795dae0cf236c486f
pkgname = thunderbird-appmenu
diff --git a/PKGBUILD b/PKGBUILD
index e6a591c35952..9d79335fdc86 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,36 +1,39 @@
+### Original Thunderbird from extra ###
+# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Alexander Baldeck <alexander@archlinux.org>
# Contributor: Dale Blount <dale@archlinux.org>
# Contributor: Anders Bostrom <anders.bostrom@home.se>
-# Additional patching: Nikita Tarasov <nikatar@disroot.org>
+### Appmenu patching ###
+# PKGBUILD: Nikita Tarasov <nikatar@disroot.org>
_pkgname=thunderbird
pkgname=thunderbird-appmenu
-pkgver=60.8.0
+pkgver=68.3.0
pkgrel=1
pkgdesc="Thunderbird from extra with appmenu patch"
arch=(x86_64)
license=(MPL GPL LGPL)
-url="https://aur.archlinux.org/packages/thunderbird-appmenu/"
+url="https://www.mozilla.org/thunderbird/"
depends=(gtk3 mozilla-common libxt startup-notification mime-types dbus-glib alsa-lib
- nss hunspell sqlite ttf-font icu)
-makedepends=(unzip zip diffutils python2 yasm mesa imake libpulse inetutils xorg-server-xvfb
- autoconf2.13 rust clang llvm gtk2)
+ nss hunspell sqlite ttf-font icu) # libvpx
+makedepends=(unzip zip diffutils python python2 yasm nasm mesa imake libpulse inetutils xorg-server-xvfb
+ autoconf2.13 rust clang llvm gtk2 cbindgen nodejs)
optdepends=('libcanberra: sound support')
provides=("thunderbird=$pkgver")
conflicts=("thunderbird")
options=(!emptydirs !makeflags)
source=(https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz{,.asc}
- rust-1.35.patch
+ thunderbird-rust-1.39.patch
$_pkgname.desktop
unity-menubar.patch)
-sha256sums=('1e7a13e64b63476d2235aaac6823fdab949af45cfcd5a25ee710cbae08c2f5d1'
+sha256sums=('f68cb53deb6c1840cc3f2b1e842bac8ebaf090e9cd89afb376ba0e1ba62820aa'
'SKIP'
- '3257987cc0ab0559c65561d523eb4d0e73b5edb86d9d18a2487818d9fca0bb30'
+ '08834ef1c2dd685edd40dea20dfa9d4b889f5c387385ac329a162eeff6cf90be'
'3534ea85d8e0e35dba5f40a7a07844df19f3a480e1358fc50c2502f122dab789'
- '22786f52773b93046fdb12378f67343b1d7d3390e83a00ff4aa03948c2b1c9e2')
+ 'bcb0dab3bbe5b2ca2bcc8e2d9856bc8583b603da6573618795dae0cf236c486f')
validpgpkeys=(14F26682D0916CDD81E37B6D61B7B526D98F0353) # Mozilla Software Releases <release@mozilla.com>
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
@@ -48,10 +51,10 @@ _mozilla_api_key=16674381-f021-49de-8622-3021c5942aff
prepare() {
cd $_pkgname-$pkgver
- # # Fix build with rust 1.35 (Fedora)
- patch -Np1 -i ../rust-1.35.patch
+ # Fix build with rust 1.39 (Gentoo)
+ patch -p1 -i ../thunderbird-rust-1.39.patch
- # actual appmenu patch from ubuntu repos
+ # Actual appmenu patch from ubuntu repos
patch -Np1 -i ../unity-menubar.patch
echo -n "$_google_api_key" >google-api-key
@@ -86,9 +89,9 @@ ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --with-system-icu
ac_add_options --with-system-jpeg
+# ac_add_options --with-system-libvpx
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
-ac_add_options --enable-system-hunspell
ac_add_options --enable-system-sqlite
ac_add_options --enable-system-ffi
@@ -100,7 +103,6 @@ ac_add_options --disable-crashreporter
ac_add_options --disable-updater
ac_add_options --disable-gconf
END
-
}
build() {
@@ -140,7 +142,6 @@ about=Mozilla Thunderbird for Arch Linux
[Preferences]
app.distributor=archlinux
app.distributor.channel=$_pkgname
-app.partner.archlinux=archlinux
END
for i in 16 22 24 32 48 64 128 256; do
@@ -154,7 +155,6 @@ END
"$pkgdir/usr/share/applications/$_pkgname.desktop"
# Use system-provided dictionaries
- rm -r "$pkgdir/usr/lib/$_pkgname/dictionaries"
ln -Ts /usr/share/hunspell "$pkgdir/usr/lib/$_pkgname/dictionaries"
ln -Ts /usr/share/hyphen "$pkgdir/usr/lib/$_pkgname/hyphenation"
diff --git a/rust-1.35.patch b/rust-1.35.patch
deleted file mode 100644
index 746145fac95a..000000000000
--- a/rust-1.35.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-diff -up thunderbird-60.8.0/servo/components/style_traits/values.rs.rust-1.33-build thunderbird-60.8.0/servo/components/style_traits/values.rs
---- thunderbird-60.8.0/servo/components/style_traits/values.rs.rust-1.33-build 2019-07-03 17:25:28.000000000 +0200
-+++ thunderbird-60.8.0/servo/components/style_traits/values.rs 2019-07-11 13:38:53.687318154 +0200
-@@ -135,6 +135,7 @@ where
- }
- }
-
-+/// Some comment
- #[macro_export]
- macro_rules! serialize_function {
- ($dest: expr, $name: ident($( $arg: expr, )+)) => {
-@@ -404,6 +405,7 @@ impl_to_css_for_predefined_type!(::csspa
- impl_to_css_for_predefined_type!(::cssparser::Color);
- impl_to_css_for_predefined_type!(::cssparser::UnicodeRange);
-
-+/// Some comment
- #[macro_export]
- macro_rules! define_css_keyword_enum {
- (pub enum $name:ident { $($variant:ident = $css:expr,)+ }) => {
-diff -up thunderbird-60.8.0/servo/components/style/properties/properties.mako.rs.old thunderbird-60.8.0/servo/components/style/properties/properties.mako.rs
---- thunderbird-60.8.0/servo/components/style/properties/properties.mako.rs.old 2019-07-11 14:22:51.393784701 +0200
-+++ thunderbird-60.8.0/servo/components/style/properties/properties.mako.rs 2019-07-11 14:24:03.182578100 +0200
-@@ -55,6 +55,7 @@ use style_adjuster::StyleAdjuster;
-
- pub use self::declaration_block::*;
-
-+/// Neco
- #[cfg(feature = "gecko")]
- #[macro_export]
- macro_rules! property_name {
-@@ -3852,7 +3853,7 @@ impl fmt::Debug for AliasId {
- }
- }
-
--// NOTE(emilio): Callers are responsible to deal with prefs.
-+/// NOTE(emilio): Callers are responsible to deal with prefs.
- #[macro_export]
- macro_rules! css_properties_accessors {
- ($macro_name: ident) => {
-@@ -3875,6 +3876,7 @@ macro_rules! css_properties_accessors {
- }
- }
-
-+/// Neco
- #[macro_export]
- macro_rules! longhand_properties_idents {
- ($macro_name: ident) => {
diff --git a/thunderbird-rust-1.39.patch b/thunderbird-rust-1.39.patch
new file mode 100644
index 000000000000..bfb71cbb7887
--- /dev/null
+++ b/thunderbird-rust-1.39.patch
@@ -0,0 +1,170 @@
+Based on https://github.com/rust-lang/rust/issues/64710
+
+--- a/third_party/rust/bindgen/.cargo-checksum.json
++++ b/third_party/rust/bindgen/.cargo-checksum.json
+@@ -1 +1 @@
+-{"files":{"Cargo.toml":"9af635e7bad9021a49742a312faf6178b757dbd48aabc998931d6f491f14c179","LICENSE":"c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db","README.md":"5a1f556c6a57c0a6ccc65e19c27718e0f4b32381a8efcc80f6601b33c58c5d59","build.rs":"a9f6915c54d75f357ce32f96327bf4df53dc81a505b70831978f9dac6f43841d","src/callbacks.rs":"b24d7982332c6a35928f134184ddf4072fe4545a45546b97b9b0e0c1fbb77c08","src/clang.rs":"e9203eb5a1b432efebafcd011896e35e8c9145037bf99e7bb3709dc1b8e8e783","src/codegen/bitfield_unit.rs":"88b0604322dc449fc9284850eadc1f5d14b42fa747d4258bae0b6b9535f52dfd","src/codegen/bitfield_unit_tests.rs":"2073ac6a36e0bc9afaef5b1207966817c8fb7a1a9f6368c3b1b8f79822efbfba","src/codegen/error.rs":"2613af1d833377fd4a70719f4a09951d9d45dc9227827b9a2a938a1bcaaea2dd","src/codegen/helpers.rs":"fbd23e68dd51ccaddeb9761394d5df2db49baded0e2dccf6bbc52a2d6de502eb","src/codegen/impl_debug.rs":"f82969461d522fb758eca552ceaf189122a404cbb47fcc16008bfe52fc62aefa","src/codegen/impl_partialeq.rs":"d40d9ee2849c4d3d557b033c4d3af5e6de4a44347f67c0f016198086338811af","src/codegen/mod.rs":"238d989e13b7556e5d120a2bfe85b43332fba56cbe8df886d4c32e650fff1247","src/codegen/struct_layout.rs":"3fa5524aff82365ce292b0cc85080514c85a6dbd31bce90f001773b995dda28e","src/extra_assertions.rs":"494534bd4f18b80d89b180c8a93733e6617edcf7deac413e9a73fd6e7bc9ced7","src/features.rs":"c5fd7149f4a3b41fd4f89ade08505170942f4bc791bcb6a34fdddd3ae61856f8","src/ir/analysis/derive.rs":"325d4c1c1e6194e743f42a2316f1501b0ef852fe309f2e9cac3434825ad235f0","src/ir/analysis/has_destructor.rs":"63644f479738df35e531d3324ff892614083c3656e0747aa34d9f20dada878ec","src/ir/analysis/has_float.rs":"76162a309e4285a806755a08c687a3e7bc894a100a63da4e88584035e215b11d","src/ir/analysis/has_type_param_in_array.rs":"fdbc0af28a144c88ea2de83e6e6da5e1ffb40e3dd63fd7a708095d085bb06f94","src/ir/analysis/has_vtable.rs":"5788372d27bdbaaf0454bc17be31a5480918bc41a8a1c4832e8c61185c07f9cd","src/ir/analysis/mod.rs":"1f218e15c19f6666512908abc853fa7ff9ca5d0fafd94f026d9e4b0ce287ec3c","src/ir/analysis/sizedness.rs":"8dc10043d872e68e660ef96edca4d9733f95be45cdad4893462fa929b335014f","src/ir/analysis/template_params.rs":"6312c008bbc80f50e72a766756c8daddea0b6eeb31ec924b83a231df931e170e","src/ir/annotations.rs":"39a5ab19f4d5dfa617577e4a0d0d2b67b5369d480c7cca4b14d172458c9843f0","src/ir/comment.rs":"c48abe01c5af0f09f583a89f1394bc6c161b40f6c8f0f600bbfe3c907b47969b","src/ir/comp.rs":"ca439407faefbe3a198246f0a1dbdf4e40307e45eaaad317e85d1aab37bb31fc","src/ir/context.rs":"599226eb04d337a1b1b13af91af91bdb02dbd5f26f274cbc0ebc4489eb144fc0","src/ir/derive.rs":"34f9aa76b6c9c05136bb69dcd6455397faef571a567254d2c541d50a962994db","src/ir/dot.rs":"95ed2968fc3239d87892e9f1edf1ed6dd18630d949564961765967ea1d16960c","src/ir/enum_ty.rs":"9cc242d6b3c1866665594e8b306860ee39c0ea42d22198d46b7fded473fe3e84","src/ir/function.rs":"2d41d9df19f42b0c383f338be4c026c005853a8d1caf5f3e5a2f3a8dad202232","src/ir/int.rs":"07e0c7dbd2dd977177fae3acd2a14adf271c6cf9ff4b57cddc11d50734fd4801","src/ir/item.rs":"3bcdb69b793350e5744aec3577cdbb1e5068ece5220c38763cecd82dfb5e8f03","src/ir/item_kind.rs":"dbeae8c4fd0e5c9485d325aea040e056a1f2cd6d43fc927dee8fe1c0c59a7197","src/ir/layout.rs":"d49582081f5f86f7595afbe4845f38fb3b969a840b568f4a49b265e7d790bb5b","src/ir/mod.rs":"2eae90f207fad2e45957ec9287064992a419e3fc916aba84faff2ea25cbeb5ee","src/ir/module.rs":"c4d90bf38fe3672e01923734ccbdb7951ea929949d5f413a9c2aee12395a5094","src/ir/objc.rs":"758aa955a0c5d6ad82606c88a1f4cd1d93e666b71e82d43b18b1aaae96cf888a","src/ir/template.rs":"c0f8570b927dfd6a421fc4ce3094ec837a3ed936445225dbfac961e8e0842ae5","src/ir/traversal.rs":"ea751379a5aec02f93f8d2c61e18232776b1f000dbeae64b9a7195ba21a19dd6","src/ir/ty.rs":"952fb04cd6a71a2bca5c509aecacb42a1de0cae75824941541a38dc589f0993a","src/ir/var.rs":"8bdafb6d02f2c55ae11c28d88b19fb7a65ba8466da12ff039ae4c16c790b291e","src/lib.rs":"d5c8b404c515d30fc2d78b28eb84cff6b256f1f1e2dbd6aca280529bb2af6879","src/log_stubs.rs":"6dfdd908b7c6453da416cf232893768f9480e551ca4add0858ef88bf71ee6ceb","src/main.rs":"e519053bcdde6bc88f60f955246a02d53b3db1cc5ccd1612e6675b790b7460b0","src/options.rs":"041d635c8f6712ca32676a68f06d0245faed5577d9513786e058540ea2a69a7f","src/parse.rs":"be7d13cc84fae79ec7b3aa9e77063fa475a48d74a854423e2c72d75006a25202","src/regex_set.rs":"5cb72fc3714c0d79e9e942d003349c0775fafd7cd0c9603c65f5261883bbf9cf","src/time.rs":"3b763e6fee51d0eb01228dfe28bc28a9f692aff73b2a7b90a030902e0238fca6"},"package":"6bd7710ac8399ae1ebe1e3aac7c9047c4f39f2c94b33c997f482f49e96991f7c"}
+\ No newline at end of file
++{"files":{"Cargo.toml":"9af635e7bad9021a49742a312faf6178b757dbd48aabc998931d6f491f14c179","LICENSE":"c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db","README.md":"5a1f556c6a57c0a6ccc65e19c27718e0f4b32381a8efcc80f6601b33c58c5d59","build.rs":"a9f6915c54d75f357ce32f96327bf4df53dc81a505b70831978f9dac6f43841d","src/callbacks.rs":"b24d7982332c6a35928f134184ddf4072fe4545a45546b97b9b0e0c1fbb77c08","src/clang.rs":"e9203eb5a1b432efebafcd011896e35e8c9145037bf99e7bb3709dc1b8e8e783","src/codegen/bitfield_unit.rs":"88b0604322dc449fc9284850eadc1f5d14b42fa747d4258bae0b6b9535f52dfd","src/codegen/bitfield_unit_tests.rs":"2073ac6a36e0bc9afaef5b1207966817c8fb7a1a9f6368c3b1b8f79822efbfba","src/codegen/error.rs":"2613af1d833377fd4a70719f4a09951d9d45dc9227827b9a2a938a1bcaaea2dd","src/codegen/helpers.rs":"fbd23e68dd51ccaddeb9761394d5df2db49baded0e2dccf6bbc52a2d6de502eb","src/codegen/impl_debug.rs":"f82969461d522fb758eca552ceaf189122a404cbb47fcc16008bfe52fc62aefa","src/codegen/impl_partialeq.rs":"d40d9ee2849c4d3d557b033c4d3af5e6de4a44347f67c0f016198086338811af","src/codegen/mod.rs":"238d989e13b7556e5d120a2bfe85b43332fba56cbe8df886d4c32e650fff1247","src/codegen/struct_layout.rs":"3fa5524aff82365ce292b0cc85080514c85a6dbd31bce90f001773b995dda28e","src/extra_assertions.rs":"494534bd4f18b80d89b180c8a93733e6617edcf7deac413e9a73fd6e7bc9ced7","src/features.rs":"c5fd7149f4a3b41fd4f89ade08505170942f4bc791bcb6a34fdddd3ae61856f8","src/ir/analysis/derive.rs":"325d4c1c1e6194e743f42a2316f1501b0ef852fe309f2e9cac3434825ad235f0","src/ir/analysis/has_destructor.rs":"63644f479738df35e531d3324ff892614083c3656e0747aa34d9f20dada878ec","src/ir/analysis/has_float.rs":"76162a309e4285a806755a08c687a3e7bc894a100a63da4e88584035e215b11d","src/ir/analysis/has_type_param_in_array.rs":"fdbc0af28a144c88ea2de83e6e6da5e1ffb40e3dd63fd7a708095d085bb06f94","src/ir/analysis/has_vtable.rs":"8c92a52c0f859c7bec7bfbc36b9d18f904baab0c8c9dc1b3e7af34de1a0b0da4","src/ir/analysis/mod.rs":"1f218e15c19f6666512908abc853fa7ff9ca5d0fafd94f026d9e4b0ce287ec3c","src/ir/analysis/sizedness.rs":"71f1a37f75b971ea5b0d8457473cc410947dbf706cb6d2c0338916910b78a675","src/ir/analysis/template_params.rs":"6312c008bbc80f50e72a766756c8daddea0b6eeb31ec924b83a231df931e170e","src/ir/annotations.rs":"39a5ab19f4d5dfa617577e4a0d0d2b67b5369d480c7cca4b14d172458c9843f0","src/ir/comment.rs":"c48abe01c5af0f09f583a89f1394bc6c161b40f6c8f0f600bbfe3c907b47969b","src/ir/comp.rs":"ca439407faefbe3a198246f0a1dbdf4e40307e45eaaad317e85d1aab37bb31fc","src/ir/context.rs":"599226eb04d337a1b1b13af91af91bdb02dbd5f26f274cbc0ebc4489eb144fc0","src/ir/derive.rs":"e5581852eec87918901a129284b4965aefc8a19394187a8095779a084f28fabe","src/ir/dot.rs":"95ed2968fc3239d87892e9f1edf1ed6dd18630d949564961765967ea1d16960c","src/ir/enum_ty.rs":"9cc242d6b3c1866665594e8b306860ee39c0ea42d22198d46b7fded473fe3e84","src/ir/function.rs":"2d41d9df19f42b0c383f338be4c026c005853a8d1caf5f3e5a2f3a8dad202232","src/ir/int.rs":"07e0c7dbd2dd977177fae3acd2a14adf271c6cf9ff4b57cddc11d50734fd4801","src/ir/item.rs":"3bcdb69b793350e5744aec3577cdbb1e5068ece5220c38763cecd82dfb5e8f03","src/ir/item_kind.rs":"dbeae8c4fd0e5c9485d325aea040e056a1f2cd6d43fc927dee8fe1c0c59a7197","src/ir/layout.rs":"d49582081f5f86f7595afbe4845f38fb3b969a840b568f4a49b265e7d790bb5b","src/ir/mod.rs":"2eae90f207fad2e45957ec9287064992a419e3fc916aba84faff2ea25cbeb5ee","src/ir/module.rs":"c4d90bf38fe3672e01923734ccbdb7951ea929949d5f413a9c2aee12395a5094","src/ir/objc.rs":"758aa955a0c5d6ad82606c88a1f4cd1d93e666b71e82d43b18b1aaae96cf888a","src/ir/template.rs":"c0f8570b927dfd6a421fc4ce3094ec837a3ed936445225dbfac961e8e0842ae5","src/ir/traversal.rs":"ea751379a5aec02f93f8d2c61e18232776b1f000dbeae64b9a7195ba21a19dd6","src/ir/ty.rs":"952fb04cd6a71a2bca5c509aecacb42a1de0cae75824941541a38dc589f0993a","src/ir/var.rs":"8bdafb6d02f2c55ae11c28d88b19fb7a65ba8466da12ff039ae4c16c790b291e","src/lib.rs":"d5c8b404c515d30fc2d78b28eb84cff6b256f1f1e2dbd6aca280529bb2af6879","src/log_stubs.rs":"6dfdd908b7c6453da416cf232893768f9480e551ca4add0858ef88bf71ee6ceb","src/main.rs":"e519053bcdde6bc88f60f955246a02d53b3db1cc5ccd1612e6675b790b7460b0","src/options.rs":"041d635c8f6712ca32676a68f06d0245faed5577d9513786e058540ea2a69a7f","src/parse.rs":"be7d13cc84fae79ec7b3aa9e77063fa475a48d74a854423e2c72d75006a25202","src/regex_set.rs":"5cb72fc3714c0d79e9e942d003349c0775fafd7cd0c9603c65f5261883bbf9cf","src/time.rs":"3b763e6fee51d0eb01228dfe28bc28a9f692aff73b2a7b90a030902e0238fca6"},"package":"6bd7710ac8399ae1ebe1e3aac7c9047c4f39f2c94b33c997f482f49e96991f7c"}
+\ No newline at end of file
+--- a/third_party/rust/bindgen/src/ir/analysis/has_vtable.rs
++++ b/third_party/rust/bindgen/src/ir/analysis/has_vtable.rs
+@@ -9,17 +9,17 @@ use std::ops;
+ use {HashMap, Entry};
+
+ /// The result of the `HasVtableAnalysis` for an individual item.
+-#[derive(Copy, Clone, Debug, PartialEq, Eq, Ord)]
++#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
+ pub enum HasVtableResult {
+- /// The item has a vtable, but the actual vtable pointer is in a base
+- /// member.
+- BaseHasVtable,
++ /// The item does not have a vtable pointer.
++ No,
+
+ /// The item has a vtable and the actual vtable pointer is within this item.
+ SelfHasVtable,
+
+- /// The item does not have a vtable pointer.
+- No
++ /// The item has a vtable, but the actual vtable pointer is in a base
++ /// member.
++ BaseHasVtable,
+ }
+
+ impl Default for HasVtableResult {
+@@ -28,21 +28,6 @@ impl Default for HasVtableResult {
+ }
+ }
+
+-impl cmp::PartialOrd for HasVtableResult {
+- fn partial_cmp(&self, rhs: &Self) -> Option<cmp::Ordering> {
+- use self::HasVtableResult::*;
+-
+- match (*self, *rhs) {
+- (x, y) if x == y => Some(cmp::Ordering::Equal),
+- (BaseHasVtable, _) => Some(cmp::Ordering::Greater),
+- (_, BaseHasVtable) => Some(cmp::Ordering::Less),
+- (SelfHasVtable, _) => Some(cmp::Ordering::Greater),
+- (_, SelfHasVtable) => Some(cmp::Ordering::Less),
+- _ => unreachable!(),
+- }
+- }
+-}
+-
+ impl HasVtableResult {
+ /// Take the least upper bound of `self` and `rhs`.
+ pub fn join(self, rhs: Self) -> Self {
+--- a/third_party/rust/bindgen/src/ir/analysis/sizedness.rs
++++ b/third_party/rust/bindgen/src/ir/analysis/sizedness.rs
+@@ -22,13 +22,14 @@ use {HashMap, Entry};
+ ///
+ /// We initially assume that all types are `ZeroSized` and then update our
+ /// understanding as we learn more about each type.
+-#[derive(Copy, Clone, Debug, PartialEq, Eq, Ord)]
++#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
+ pub enum SizednessResult {
+- /// Has some size that is known to be greater than zero. That doesn't mean
+- /// it has a static size, but it is not zero sized for sure. In other words,
+- /// it might contain an incomplete array or some other dynamically sized
+- /// type.
+- NonZeroSized,
++ /// The type is zero-sized.
++ ///
++ /// This means that if it is a C++ type, and is not being used as a base
++ /// member, then we must add an `_address` byte to enforce the
++ /// unique-address-per-distinct-object-instance rule.
++ ZeroSized,
+
+ /// Whether this type is zero-sized or not depends on whether a type
+ /// parameter is zero-sized or not.
+@@ -52,12 +53,11 @@ pub enum SizednessResult {
+ /// https://github.com/rust-lang-nursery/rust-bindgen/issues/586
+ DependsOnTypeParam,
+
+- /// The type is zero-sized.
+- ///
+- /// This means that if it is a C++ type, and is not being used as a base
+- /// member, then we must add an `_address` byte to enforce the
+- /// unique-address-per-distinct-object-instance rule.
+- ZeroSized,
++ /// Has some size that is known to be greater than zero. That doesn't mean
++ /// it has a static size, but it is not zero sized for sure. In other words,
++ /// it might contain an incomplete array or some other dynamically sized
++ /// type.
++ NonZeroSized,
+ }
+
+ impl Default for SizednessResult {
+@@ -66,21 +66,6 @@ impl Default for SizednessResult {
+ }
+ }
+
+-impl cmp::PartialOrd for SizednessResult {
+- fn partial_cmp(&self, rhs: &Self) -> Option<cmp::Ordering> {
+- use self::SizednessResult::*;
+-
+- match (*self, *rhs) {
+- (x, y) if x == y => Some(cmp::Ordering::Equal),
+- (NonZeroSized, _) => Some(cmp::Ordering::Greater),
+- (_, NonZeroSized) => Some(cmp::Ordering::Less),
+- (DependsOnTypeParam, _) => Some(cmp::Ordering::Greater),
+- (_, DependsOnTypeParam) => Some(cmp::Ordering::Less),
+- _ => unreachable!(),
+- }
+- }
+-}
+-
+ impl SizednessResult {
+ /// Take the least upper bound of `self` and `rhs`.
+ pub fn join(self, rhs: Self) -> Self {
+--- a/third_party/rust/bindgen/src/ir/derive.rs
++++ b/third_party/rust/bindgen/src/ir/derive.rs
+@@ -92,10 +92,10 @@ pub trait CanDeriveOrd {
+ ///
+ /// Initially we assume that we can derive trait for all types and then
+ /// update our understanding as we learn more about each type.
+-#[derive(Debug, Copy, Clone, PartialEq, Eq, Ord)]
++#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
+ pub enum CanDerive {
+- /// No, we cannot.
+- No,
++ /// Yes, we can derive automatically.
++ Yes,
+
+ /// The only thing that stops us from automatically deriving is that
+ /// array with more than maximum number of elements is used.
+@@ -103,8 +103,8 @@ pub enum CanDerive {
+ /// This means we probably can "manually" implement such trait.
+ Manually,
+
+- /// Yes, we can derive automatically.
+- Yes,
++ /// No, we cannot.
++ No,
+ }
+
+ impl Default for CanDerive {
+@@ -113,22 +113,6 @@ impl Default for CanDerive {
+ }
+ }
+
+-impl cmp::PartialOrd for CanDerive {
+- fn partial_cmp(&self, rhs: &Self) -> Option<cmp::Ordering> {
+- use self::CanDerive::*;
+-
+- let ordering = match (*self, *rhs) {
+- (x, y) if x == y => cmp::Ordering::Equal,
+- (No, _) => cmp::Ordering::Greater,
+- (_, No) => cmp::Ordering::Less,
+- (Manually, _) => cmp::Ordering::Greater,
+- (_, Manually) => cmp::Ordering::Less,
+- _ => unreachable!()
+- };
+- Some(ordering)
+- }
+-}
+-
+ impl CanDerive {
+ /// Take the least upper bound of `self` and `rhs`.
+ pub fn join(self, rhs: Self) -> Self {
diff --git a/unity-menubar.patch b/unity-menubar.patch
index cb5f2a6d6c7d..9b5c3560df77 100644
--- a/unity-menubar.patch
+++ b/unity-menubar.patch
@@ -10,13 +10,13 @@
!('@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;"
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
-@@ -5557,11 +5557,17 @@ function onViewToolbarsPopupShowing(aEve
+@@ -7008,11 +7008,17 @@ function onViewToolbarsPopupShowing(aEve
- let toolbarNodes = gNavToolbox.childNodes;
+ let toolbarNodes = gNavToolbox.querySelectorAll("toolbar");
+ let shellShowingMenubar = document.documentElement.getAttribute("shellshowingmenubar") == "true";
+
@@ -29,12 +29,12 @@
+ continue;
+ }
+
- let menuItem = document.createElement("menuitem");
- let hidingAttribute = toolbar.getAttribute("type") == "menubar" ?
- "autohide" : "collapsed";
+ let menuItem = document.createXULElement("menuitem");
+ let hidingAttribute =
+ toolbar.getAttribute("type") == "menubar" ? "autohide" : "collapsed";
--- a/browser/components/places/content/places.xul
+++ b/browser/components/places/content/places.xul
-@@ -161,7 +161,7 @@
+@@ -166,7 +166,7 @@
<toolbarbutton type="menu" class="tabbable"
onpopupshowing="document.getElementById('placeContent').focus()"
#else
@@ -43,9 +43,48 @@
<menu accesskey="&organize.accesskey;" class="menu-iconic"
#endif
id="organizeButton" label="&organize.label;"
+--- a/dom/xul/XULPopupElement.cpp
++++ b/dom/xul/XULPopupElement.cpp
+@@ -156,6 +156,10 @@ void XULPopupElement::GetState(nsString&
+ // 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()) {
+@@ -179,6 +183,11 @@ void XULPopupElement::GetState(nsString&
+ break;
+ }
+ }
++#ifdef MOZ_WIDGET_GTK
++ else if (GetAttr(kNameSpaceID_None, nsGkAtoms::_moz_nativemenupopupstate, nativeState)) {
++ aState = nativeState;
++ }
++#endif
+ }
+
+ nsINode* XULPopupElement::GetTriggerNode() const {
+--- a/dom/xul/moz.build
++++ b/dom/xul/moz.build
+@@ -78,6 +78,11 @@ LOCAL_INCLUDES += [
+
+ include('/ipc/chromium/chromium-config.mozbuild')
+
++if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
++ LOCAL_INCLUDES += [
++ '/widget/gtk',
++ ]
++
+ FINAL_LIBRARY = 'xul'
+
+ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
--- a/layout/build/moz.build
+++ b/layout/build/moz.build
-@@ -71,6 +71,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'an
+@@ -70,6 +70,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'an
'/dom/system',
'/dom/system/android',
]
@@ -54,34 +93,11 @@
+ '/widget/gtk',
+ ]
- if CONFIG['MOZ_WEBSPEECH']:
- LOCAL_INCLUDES += [
---- a/layout/build/nsLayoutStatics.cpp
-+++ b/layout/build/nsLayoutStatics.cpp
-@@ -126,6 +126,10 @@
- #include "nsHostObjectProtocolHandler.h"
- #include "nsThreadManager.h"
-
-+#ifdef MOZ_WIDGET_GTK
-+#include "nsNativeMenuAtoms.h"
-+#endif
-+
- using namespace mozilla;
- using namespace mozilla::net;
- using namespace mozilla::dom;
-@@ -154,6 +158,9 @@ nsresult nsLayoutStatics::Initialize() {
- nsGkAtoms::AddRefAtoms();
- nsHTMLTags::RegisterAtoms();
- nsRDFAtoms::RegisterAtoms();
-+#ifdef MOZ_WIDGET_GTK
-+ nsNativeMenuAtoms::RegisterAtoms();
-+#endif
-
- NS_SetStaticAtomsDone();
-
+ XPCOM_MANIFESTS += [
+ 'components.conf',
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
-@@ -265,6 +265,9 @@ pref("dom.script_loader.bytecode_cache.s
+@@ -246,6 +246,9 @@ pref("dom.window.event.enabled", true);
pref("browser.sessionhistory.max_total_viewers", -1);
pref("ui.use_native_colors", true);
@@ -89,30 +105,11 @@
+pref("ui.use_unity_menubar", true);
+#endif
pref("ui.click_hold_context_menus", false);
-
- // Pop up context menu on mouseup instead of mousedown, if that's the OS default.
---- a/toolkit/content/widgets/popup.xml
-+++ b/toolkit/content/widgets/popup.xml
-@@ -27,8 +27,14 @@
- </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"/>
+ // 0 = false, 1 = true, 2 = autodetect.
+ pref("ui.android.mouse_as_touch", 1);
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
-@@ -312,6 +312,18 @@ toolbar[type="menubar"][autohide="true"]
+@@ -215,6 +215,18 @@ toolbar[type="menubar"] {
}
%endif
@@ -133,37 +130,25 @@
}
--- a/widget/gtk/moz.build
+++ b/widget/gtk/moz.build
-@@ -39,10 +39,18 @@ UNIFIED_SOURCES += [
- 'nsAppShell.cpp',
- 'nsBidiKeyboard.cpp',
- 'nsColorPicker.cpp',
+@@ -53,6 +53,15 @@ UNIFIED_SOURCES += [
+ ]
+
+ SOURCES += [
+ 'nsDbusmenu.cpp',
- 'nsFilePicker.cpp',
- 'nsGtkKeyUtils.cpp',
- 'nsImageToPixbuf.cpp',
- 'nsLookAndFeel.cpp',
++ 'nsMenu.cpp', # conflicts with X11 headers
+ 'nsMenuBar.cpp',
+ 'nsMenuContainer.cpp',
+ 'nsMenuItem.cpp',
+ 'nsMenuObject.cpp',
+ 'nsMenuSeparator.cpp',
-+ 'nsNativeMenuAtoms.cpp',
+ 'nsNativeMenuDocListener.cpp',
- 'nsNativeThemeGTK.cpp',
- 'nsSound.cpp',
- 'nsToolkit.cpp',
-@@ -54,6 +62,8 @@ UNIFIED_SOURCES += [
- ]
-
- SOURCES += [
-+ 'nsMenu.cpp', # conflicts with X11 headers
+ 'nsNativeMenuService.cpp',
'nsWindow.cpp', # conflicts with X11 headers
]
-@@ -124,6 +134,7 @@ FINAL_LIBRARY = 'xul'
-
+@@ -127,6 +136,7 @@ FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
+ '/layout/base',
'/layout/generic',
+ '/layout/style',
'/layout/xul',
@@ -171,7 +156,7 @@
'/widget',
--- /dev/null
+++ b/widget/gtk/nsDbusmenu.cpp
-@@ -0,0 +1,63 @@
+@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
@@ -226,10 +211,8 @@
+ }
+
+ LOAD_LIBRARY(DbusmenuGlib, "libdbusmenu-glib.so.4")
-+#if (MOZ_WIDGET_GTK == 3)
++#ifdef MOZ_WIDGET_GTK
+ LOAD_LIBRARY(DbusmenuGtk, "libdbusmenu-gtk3.so.4")
-+#else
-+ LOAD_LIBRARY(DbusmenuGtk, "libdbusmenu-gtk.so.4")
+#endif
+#undef LOAD_LIBRARY
+
@@ -341,7 +324,7 @@
+#endif /* __nsDbusmenu_h__ */
--- /dev/null
+++ b/widget/gtk/nsMenu.cpp
-@@ -0,0 +1,854 @@
+@@ -0,0 +1,843 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
@@ -351,17 +334,16 @@
+
+#define _IMPL_NS_LAYOUT
+
++#include "mozilla/dom/Document.h"
+#include "mozilla/dom/Element.h"
+#include "mozilla/Assertions.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 "mozilla/PresShell.h"
++#include "mozilla/PresShellInlines.h"
+#include "nsAutoPtr.h"
+#include "nsBindingManager.h"
+#include "nsComponentManagerUtils.h"
@@ -371,19 +353,14 @@
+#include "nsGtkUtils.h"
+#include "nsAtom.h"
+#include "nsIContent.h"
-+#include "nsIDocument.h"
-+#include "nsIPresShell.h"
+#include "nsIRunnable.h"
+#include "nsITimer.h"
+#include "nsString.h"
-+#include "nsStyleContext.h"
-+#include "nsStyleContextInlines.h"
+#include "nsStyleStruct.h"
+#include "nsThreadUtils.h"
+#include "nsXBLBinding.h"
+#include "nsXBLService.h"
+
-+#include "nsNativeMenuAtoms.h"
+#include "nsNativeMenuDocListener.h"
+
+#include <glib-object.h>
@@ -468,22 +445,20 @@
+static void
+AttachXBLBindings(nsIContent *aContent)
+{
-+ nsIDocument *doc = aContent->OwnerDoc();
-+ nsIPresShell *shell = doc->GetShell();
++ dom::Document *doc = aContent->OwnerDoc();
++ PresShell *shell = doc->GetPresShell();
+ if (!shell) {
+ return;
+ }
+
-+ RefPtr<nsStyleContext> sc =
-+ shell->StyleSet()->ResolveStyleFor(aContent->AsElement(),
-+ nullptr,
-+ LazyComputeBehavior::Allow);
++ RefPtr<ComputedStyle> style =
++ shell->StyleSet()->ResolveStyleLazily(*aContent->AsElement());
+
-+ if (!sc) {
++ if (!style) {
+ return;
+ }
+
-+ const nsStyleDisplay* display = sc->StyleDisplay();
++ const nsStyleDisplay* display = style->StyleDisplay();
+ if (!display->mBinding) {
+ return;
+ }
@@ -494,11 +469,10 @@
+ }
+
+ RefPtr<nsXBLBinding> binding;
-+ bool dummy;
+ nsresult rv = xbl->LoadBindings(aContent->AsElement(),
+ display->mBinding->GetURI(),
-+ display->mBinding->mExtraData->GetPrincipal(),
-+ getter_AddRefs(binding), &dummy);
++ display->mBinding->ExtraData()->Principal(),
++ getter_AddRefs(binding));
+ if ((NS_FAILED(rv) && rv != NS_ERROR_XBL_BLOCKED) || !binding) {
+ return;
+ }
@@ -532,11 +506,11 @@
+
+ if (state.IsEmpty()) {
+ mPopupContent->AsElement()->UnsetAttr(
-+ kNameSpaceID_None, nsNativeMenuAtoms::_moz_nativemenupopupstate,
++ kNameSpaceID_None, nsGkAtoms::_moz_nativemenupopupstate,
+ false);
+ } else {
+ mPopupContent->AsElement()->SetAttr(
-+ kNameSpaceID_None, nsNativeMenuAtoms::_moz_nativemenupopupstate,
++ kNameSpaceID_None, nsGkAtoms::_moz_nativemenupopupstate,
+ state, false);
+ }
+}
@@ -680,7 +654,7 @@
+ continue;
+ }
+
-+ AppendChild(Move(child));
++ AppendChild(std::move(child));
+ }
+}
+
@@ -693,9 +667,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;
+ }
@@ -755,7 +727,7 @@
+ EnsureNoPlaceholderItem();
+ }
+
-+ nsMenuContainer::InsertChildAfter(Move(aChild), aPrevSibling,
++ nsMenuContainer::InsertChildAfter(std::move(aChild), aPrevSibling,
+ !IsInBatchedUpdate());
+ StructureMutated();
+}
@@ -767,11 +739,11 @@
+ EnsureNoPlaceholderItem();
+ }
+
-+ nsMenuContainer::AppendChild(Move(aChild), !IsInBatchedUpdate());
++ nsMenuContainer::AppendChild(std::move(aChild), !IsInBatchedUpdate());
+ StructureMutated();
+}
+
-+bool
++bool
+nsMenu::IsInBatchedUpdate() const
+{
+ return mBatchedUpdateState != eBatchedUpdateState_Inactive;
@@ -809,7 +781,7 @@
+ UniquePtr<nsMenuObject> child = CreateChild(aChild);
+
+ if (child) {
-+ InsertChildAfter(Move(child), aPrevSibling);
++ InsertChildAfter(std::move(child), aPrevSibling);
+ }
+ } else {
+ Build();
@@ -848,7 +820,7 @@
+}
+
+void
-+nsMenu::Update(nsStyleContext *aStyleContext)
++nsMenu::Update(ComputedStyle *aComputedStyle)
+{
+ if (mNeedsUpdate) {
+ mNeedsUpdate = false;
@@ -857,8 +829,8 @@
+ UpdateSensitivity();
+ }
+
-+ UpdateVisibility(aStyleContext);
-+ UpdateIcon(aStyleContext);
++ UpdateVisibility(aComputedStyle);
++ UpdateIcon(aComputedStyle);
+}
+
+nsMenuObject::PropertyFlags
@@ -894,17 +866,17 @@
+
+ if (aAttribute == nsGkAtoms::disabled) {
+ UpdateSensitivity();
-+ } else if (aAttribute == nsGkAtoms::label ||
++ } else if (aAttribute == nsGkAtoms::label ||
+ aAttribute == nsGkAtoms::accesskey ||
+ aAttribute == nsGkAtoms::crop) {
+ 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);
+ }
+}
+
@@ -1198,7 +1170,7 @@
+
--- /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:
+ */
@@ -1222,7 +1194,6 @@
+class nsAtom;
+class nsIContent;
+class nsITimer;
-+class nsStyleContext;
+
+#define NSMENU_NUMBER_OF_POPUPSTATE_BITS 2U
+#define NSMENU_NUMBER_OF_FLAGS 4U
@@ -1292,7 +1263,7 @@
+ 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;
@@ -1325,7 +1296,7 @@
+#endif /* __nsMenu_h__ */
--- /dev/null
+++ b/widget/gtk/nsMenuBar.cpp
-@@ -0,0 +1,558 @@
+@@ -0,0 +1,550 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
@@ -1335,6 +1306,7 @@
+
+#include "mozilla/Assertions.h"
+#include "mozilla/DebugOnly.h"
++#include "mozilla/dom/Document.h"
+#include "mozilla/dom/Element.h"
+#include "mozilla/dom/Event.h"
+#include "mozilla/dom/KeyboardEvent.h"
@@ -1343,17 +1315,13 @@
+#include "mozilla/Preferences.h"
+#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"
+#include "nsUnicharUtils.h"
+
+#include "nsMenu.h"
-+#include "nsNativeMenuAtoms.h"
+#include "nsNativeMenuService.h"
+
+#include <gdk/gdk.h>
@@ -1442,14 +1410,10 @@
+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();
@@ -1457,8 +1421,7 @@
+ mOwner->Blur();
+ }
+
-+ RefPtr<dom::KeyboardEvent> keyEvent =
-+ aEvent->InternalDOMEvent()->AsKeyboardEvent();
++ RefPtr<dom::KeyboardEvent> keyEvent = aEvent->AsKeyboardEvent();
+ if (!keyEvent) {
+ return NS_OK;
+ }
@@ -1531,13 +1494,13 @@
+ mDocument = do_QueryInterface(ContentNode()->OwnerDoc());
+
+ mAccessKey = Preferences::GetInt("ui.key.menuAccessKey");
-+ if (mAccessKey == dom::KeyboardEventBinding::DOM_VK_SHIFT) {
++ if (mAccessKey == dom::KeyboardEvent_Binding::DOM_VK_SHIFT) {
+ mAccessKeyMask = eModifierShift;
-+ } else if (mAccessKey == dom::KeyboardEventBinding::DOM_VK_CONTROL) {
++ } else if (mAccessKey == dom::KeyboardEvent_Binding::DOM_VK_CONTROL) {
+ mAccessKeyMask = eModifierCtrl;
-+ } else if (mAccessKey == dom::KeyboardEventBinding::DOM_VK_ALT) {
++ } else if (mAccessKey == dom::KeyboardEvent_Binding::DOM_VK_ALT) {
+ mAccessKeyMask = eModifierAlt;
-+ } else if (mAccessKey == dom::KeyboardEventBinding::DOM_VK_META) {
++ } else if (mAccessKey == dom::KeyboardEvent_Binding::DOM_VK_META) {
+ mAccessKeyMask = eModifierMeta;
+ } else {
+ mAccessKeyMask = eModifierAlt;
@@ -1559,7 +1522,7 @@
+ continue;
+ }
+
-+ AppendChild(Move(child));
++ AppendChild(std::move(child));
+ }
+}
+
@@ -1587,7 +1550,7 @@
+nsMenuBar::SetShellShowingMenuBar(bool aShowing)
+{
+ ContentNode()->OwnerDoc()->GetRootElement()->SetAttr(
-+ kNameSpaceID_None, nsNativeMenuAtoms::shellshowingmenubar,
++ kNameSpaceID_None, nsGkAtoms::shellshowingmenubar,
+ aShowing ? NS_LITERAL_STRING("true") : NS_LITERAL_STRING("false"),
+ true);
+}
@@ -1596,7 +1559,7 @@
+nsMenuBar::Focus()
+{
+ ContentNode()->AsElement()->SetAttr(kNameSpaceID_None,
-+ nsNativeMenuAtoms::openedwithkey,
++ nsGkAtoms::openedwithkey,
+ NS_LITERAL_STRING("false"), true);
+}
+
@@ -1674,7 +1637,7 @@
+ }
+
+ ContentNode()->AsElement()->SetAttr(kNameSpaceID_None,
-+ nsNativeMenuAtoms::openedwithkey,
++ nsGkAtoms::openedwithkey,
+ NS_LITERAL_STRING("true"), true);
+ static_cast<nsMenu *>(found)->OpenMenu();
+
@@ -1726,7 +1689,7 @@
+ return;
+ }
+
-+ InsertChildAfter(Move(child), aPrevSibling);
++ InsertChildAfter(std::move(child), aPrevSibling);
+}
+
+void
@@ -1800,7 +1763,7 @@
+ return nullptr;
+ }
+
-+ return Move(menubar);
++ return menubar;
+}
+
+nsMenuObject::EType
@@ -1860,7 +1823,7 @@
+
+ // Clear this. Not sure if we really need to though
+ ContentNode()->AsElement()->SetAttr(kNameSpaceID_None,
-+ nsNativeMenuAtoms::openedwithkey,
++ nsGkAtoms::openedwithkey,
+ NS_LITERAL_STRING("false"), true);
+
+ DocListener()->Start();
@@ -1909,12 +1872,12 @@
+#include <gtk/gtk.h>
+
+class nsIContent;
-+class nsIDOMEvent;
+class nsIWidget;
+class nsMenuBarDocEventListener;
+
+namespace mozilla {
+namespace dom {
++class Document;
+class KeyboardEvent;
+}
+}
@@ -1989,7 +1952,7 @@
+
+ GtkWidget *mTopLevel;
+ DbusmenuServer *mServer;
-+ nsCOMPtr<nsIDOMEventTarget> mDocument;
++ nsCOMPtr<mozilla::dom::Document> mDocument;
+ RefPtr<DocEventListener> mEventListener;
+
+ uint32_t mAccessKey;
@@ -2077,7 +2040,7 @@
+ }
+
+ UniquePtr<nsMenuObject> res = ctor(this, aContent);
-+ return Move(res);
++ return res;
+}
+
+size_t
@@ -2140,7 +2103,7 @@
+ index));
+ }
+
-+ MOZ_ALWAYS_TRUE(mChildren.InsertElementAt(index, Move(aChild)));
++ MOZ_ALWAYS_TRUE(mChildren.InsertElementAt(index, std::move(aChild)));
+}
+
+void
@@ -2154,7 +2117,7 @@
+ aChild->GetNativeData()));
+ }
+
-+ MOZ_ALWAYS_TRUE(mChildren.AppendElement(Move(aChild)));
++ MOZ_ALWAYS_TRUE(mChildren.AppendElement(std::move(aChild)));
+}
+
+bool
@@ -2247,7 +2210,7 @@
+#endif /* __nsMenuContainer_h__ */
--- /dev/null
+++ b/widget/gtk/nsMenuItem.cpp
-@@ -0,0 +1,763 @@
+@@ -0,0 +1,764 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
@@ -2257,8 +2220,10 @@
+
+#include "mozilla/ArrayUtils.h"
+#include "mozilla/Assertions.h"
++#include "mozilla/dom/Document.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"
@@ -2266,17 +2231,13 @@
+#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"
@@ -2286,9 +2247,7 @@
+
+#include <gdk/gdk.h>
+#include <gdk/gdkkeysyms.h>
-+#if (MOZ_WIDGET_GTK == 3)
+#include <gdk/gdkkeysyms-compat.h>
-+#endif
+#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
+
@@ -2433,7 +2392,7 @@
+ { NS_VK_F23, GDK_F23 },
+ { NS_VK_F24, GDK_F24 },
+
-+ // context menu key, keysym 0xff67, typically keycode 117 on 105-key (Microsoft)
++ // context menu key, keysym 0xff67, typically keycode 117 on 105-key (Microsoft)
+ // x86 keyboards, located between right 'Windows' key and right Ctrl key
+ { NS_VK_CONTEXT_MENU, GDK_Menu },
+ { NS_VK_SLEEP, GDK_Sleep },
@@ -2605,23 +2564,32 @@
+ true);
+ }
+
-+ 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);
++ dom::Document *doc = ContentNode()->OwnerDoc();
++ 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
@@ -2657,7 +2625,7 @@
+ dbusmenu_menuitem_property_set_int(GetNativeData(),
+ DBUSMENU_MENUITEM_PROP_TOGGLE_STATE,
+ mIsChecked ?
-+ DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED :
++ DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED :
+ DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED);
+}
+
@@ -2665,7 +2633,7 @@
+nsMenuItem::UpdateTypeAndState()
+{
+ static mozilla::dom::Element::AttrValuesArray attrs[] =
-+ { &nsGkAtoms::checkbox, &nsGkAtoms::radio, nullptr };
++ { nsGkAtoms::checkbox, nsGkAtoms::radio, nullptr };
+ int32_t type = ContentNode()->AsElement()->FindAttrValueIn(kNameSpaceID_None,
+ nsGkAtoms::type,
+ attrs, eCaseMatters);
@@ -2696,7 +2664,7 @@
+void
+nsMenuItem::UpdateAccel()
+{
-+ nsIDocument *doc = ContentNode()->GetUncomposedDoc();
++ dom::Document *doc = ContentNode()->GetUncomposedDoc();
+ if (doc) {
+ nsCOMPtr<nsIContent> oldKeyContent;
+ oldKeyContent.swap(mKeyContent);
@@ -2744,9 +2712,9 @@
+ modifier |= GDK_CONTROL_MASK;
+ } else if (nsCRT::strcmp(token, "accel") == 0) {
+ int32_t accel = Preferences::GetInt("ui.key.accelKey");
-+ if (accel == dom::KeyboardEventBinding::DOM_VK_META) {
++ if (accel == dom::KeyboardEvent_Binding::DOM_VK_META) {
+ modifier |= GDK_META_MASK;
-+ } else if (accel == dom::KeyboardEventBinding::DOM_VK_ALT) {
++ } else if (accel == dom::KeyboardEvent_Binding::DOM_VK_ALT) {
+ modifier |= GDK_MOD1_MASK;
+ } else {
+ modifier |= GDK_CONTROL_MASK;
@@ -2826,15 +2794,11 @@
+ for (uint32_t i = 0; i < count; ++i) {
+ nsIContent *sibling = parent->GetChildAt_Deprecated(i);
+
-+ if (!sibling->IsElement()) {
-+ continue;
-+ }
-+
+ nsAutoString otherName;
+ sibling->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::name,
+ otherName);
+
-+ if (sibling != ContentNode() && otherName == name &&
++ if (sibling != ContentNode() && otherName == name &&
+ sibling->AsElement()->AttrValueIs(kNameSpaceID_None,
+ nsGkAtoms::type,
+ nsGkAtoms::radio,
@@ -2857,7 +2821,7 @@
+void
+nsMenuItem::UpdateContentAttributes()
+{
-+ nsIDocument *doc = ContentNode()->GetUncomposedDoc();
++ dom::Document *doc = ContentNode()->GetUncomposedDoc();
+ if (!doc) {
+ return;
+ }
@@ -2893,7 +2857,7 @@
+}
+
+void
-+nsMenuItem::Update(nsStyleContext *aStyleContext)
++nsMenuItem::Update(ComputedStyle *aComputedStyle)
+{
+ if (mNeedsUpdate) {
+ mNeedsUpdate = false;
@@ -2904,8 +2868,8 @@
+ UpdateSensitivity();
+ }
+
-+ UpdateVisibility(aStyleContext);
-+ UpdateIcon(aStyleContext);
++ UpdateVisibility(aComputedStyle);
++ UpdateIcon(aComputedStyle);
+}
+
+bool
@@ -2968,11 +2932,11 @@
+ 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 ||
@@ -3013,7 +2977,7 @@
+}
--- /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:
+ */
@@ -3034,7 +2998,6 @@
+
+class nsAtom;
+class nsIContent;
-+class nsStyleContext;
+class nsMenuBar;
+class nsMenuContainer;
+
@@ -3079,7 +3042,7 @@
+
+ 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;
+
@@ -3097,7 +3060,7 @@
+#endif /* __nsMenuItem_h__ */
--- /dev/null
+++ b/widget/gtk/nsMenuObject.cpp
-@@ -0,0 +1,664 @@
+@@ -0,0 +1,663 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
@@ -3112,18 +3075,19 @@
+#include "imgRequestProxy.h"
+#include "mozilla/ArrayUtils.h"
+#include "mozilla/Assertions.h"
++#include "mozilla/dom/Document.h"
+#include "mozilla/dom/Element.h"
+#include "mozilla/Preferences.h"
++#include "mozilla/PresShell.h"
++#include "mozilla/PresShellInlines.h"
+#include "nsAttrValue.h"
+#include "nsComputedDOMStyle.h"
+#include "nsContentUtils.h"
+#include "nsGkAtoms.h"
+#include "nsIContent.h"
+#include "nsIContentPolicy.h"
-+#include "nsIDocument.h"
+#include "nsILoadGroup.h"
+#include "nsImageToPixbuf.h"
-+#include "nsIPresShell.h"
+#include "nsIURI.h"
+#include "nsNetUtil.h"
+#include "nsPresContext.h"
@@ -3131,12 +3095,10 @@
+#include "nsServiceManagerUtils.h"
+#include "nsString.h"
+#include "nsStyleConsts.h"
-+#include "nsStyleContext.h"
+#include "nsStyleStruct.h"
+#include "nsUnicharUtils.h"
+
+#include "nsMenuContainer.h"
-+#include "nsNativeMenuAtoms.h"
+#include "nsNativeMenuDocListener.h"
+
+#include <gdk/gdk.h>
@@ -3173,7 +3135,7 @@
+
+ nsMenuObjectIconLoader(nsMenuObject *aOwner) : mOwner(aOwner) { };
+
-+ void LoadIcon(nsStyleContext *aStyleContext);
++ void LoadIcon(ComputedStyle *aComputedStyle);
+ void Destroy();
+
+private:
@@ -3270,9 +3232,9 @@
+}
+
+void
-+nsMenuObjectIconLoader::LoadIcon(nsStyleContext *aStyleContext)
++nsMenuObjectIconLoader::LoadIcon(ComputedStyle *aComputedStyle)
+{
-+ nsIDocument *doc = mOwner->ContentNode()->OwnerDoc();
++ dom::Document *doc = mOwner->ContentNode()->OwnerDoc();
+
+ nsCOMPtr<nsIURI> uri;
+ nsIntRect imageRect;
@@ -3284,17 +3246,17 @@
+ uriString)) {
+ NS_NewURI(getter_AddRefs(uri), uriString);
+ } else {
-+ nsIPresShell *shell = doc->GetShell();
++ PresShell *shell = doc->GetPresShell();
+ if (!shell) {
+ return;
+ }
+
+ 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));
@@ -3316,7 +3278,7 @@
+ }
+
+ bool same;
-+ if (mURI && NS_SUCCEEDED(mURI->Equals(uri, &same)) && same &&
++ if (mURI && NS_SUCCEEDED(mURI->Equals(uri, &same)) && same &&
+ (!imageRequest || imageRect == mImageRect)) {
+ return;
+ }
@@ -3501,9 +3463,9 @@
+ length = label.Length();
+
+ static mozilla::dom::Element::AttrValuesArray strings[] = {
-+ &nsGkAtoms::left, &nsGkAtoms::start,
-+ &nsGkAtoms::center, &nsGkAtoms::right,
-+ &nsGkAtoms::end, nullptr
++ nsGkAtoms::left, nsGkAtoms::start,
++ nsGkAtoms::center, nsGkAtoms::right,
++ nsGkAtoms::end, nullptr
+ };
+
+ int32_t type = mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
@@ -3535,13 +3497,13 @@
+}
+
+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;
+ }
@@ -3566,14 +3528,14 @@
+}
+
+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();
@@ -3584,14 +3546,14 @@
+ }
+}
+
-+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
@@ -3617,7 +3579,7 @@
+}
+
+void
-+nsMenuObject::Update(nsStyleContext *aStyleContext)
++nsMenuObject::Update(ComputedStyle *aComputedStyle)
+{
+}
+
@@ -3635,7 +3597,7 @@
+ }
+
+ for (uint32_t i = 0; i < classes->GetAtomCount(); ++i) {
-+ if (classes->AtomAt(i) == nsNativeMenuAtoms::menuitem_with_favicon) {
++ if (classes->AtomAt(i) == nsGkAtoms::menuitem_with_favicon) {
+ return true;
+ }
+ }
@@ -3721,8 +3683,8 @@
+
+ UpdateContentAttributes();
+
-+ RefPtr<nsStyleContext> sc = GetStyleContext();
-+ Update(sc);
++ RefPtr<ComputedStyle> style = GetComputedStyle();
++ Update(style);
+}
+
+/* static */ void
@@ -3776,13 +3738,13 @@
+#define __nsMenuObject_h__
+
+#include "mozilla/Attributes.h"
++#include "mozilla/ComputedStyleInlines.h"
+#include "nsCOMPtr.h"
+
+#include "nsDbusmenu.h"
+#include "nsNativeMenuDocListener.h"
+
+class nsIContent;
-+class nsStyleContext;
+class nsMenuContainer;
+class nsMenuObjectIconLoader;
+
@@ -3853,12 +3815,12 @@
+ };
+
+ void UpdateLabel();
-+ void UpdateVisibility(nsStyleContext *aStyleContext);
++ void UpdateVisibility(mozilla::ComputedStyle *aComputedStyle);
+ void UpdateSensitivity();
-+ void UpdateIcon(nsStyleContext *aStyleContext);
++ void UpdateIcon(mozilla::ComputedStyle *aComputedStyle);
++
++ already_AddRefed<mozilla::ComputedStyle> GetComputedStyle();
+
-+ already_AddRefed<nsStyleContext> GetStyleContext();
-+
+private:
+ friend class nsMenuObjectIconLoader;
+
@@ -3884,7 +3846,7 @@
+ // 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();
@@ -3936,7 +3898,7 @@
+#endif /* __nsMenuObject_h__ */
--- /dev/null
+++ b/widget/gtk/nsMenuSeparator.cpp
-@@ -0,0 +1,85 @@
+@@ -0,0 +1,84 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
@@ -3949,7 +3911,6 @@
+#include "nsAutoPtr.h"
+#include "nsCRT.h"
+#include "nsGkAtoms.h"
-+#include "nsStyleContext.h"
+
+#include "nsDbusmenu.h"
+
@@ -3967,9 +3928,9 @@
+}
+
+void
-+nsMenuSeparator::Update(nsStyleContext *aContext)
++nsMenuSeparator::Update(ComputedStyle *aComputedStyle)
+{
-+ UpdateVisibility(aContext);
++ UpdateVisibility(aComputedStyle);
+}
+
+bool
@@ -4000,8 +3961,8 @@
+
+ if (aAttribute == nsGkAtoms::hidden ||
+ aAttribute == nsGkAtoms::collapsed) {
-+ RefPtr<nsStyleContext> sc = GetStyleContext();
-+ UpdateVisibility(sc);
++ RefPtr<ComputedStyle> style = GetComputedStyle();
++ UpdateVisibility(style);
+ }
+}
+
@@ -4054,7 +4015,7 @@
+
+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;
+
@@ -4063,93 +4024,6 @@
+
+#endif /* __nsMenuSeparator_h__ */
--- /dev/null
-+++ b/widget/gtk/nsNativeMenuAtomList.h
-@@ -0,0 +1,12 @@
-+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-+/* vim:expandtab:shiftwidth=4:tabstop=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/. */
-+
-+WIDGET_ATOM2(menuitem_with_favicon, "menuitem-with-favicon")
-+WIDGET_ATOM2(_moz_menubarkeeplocal, "_moz-menubarkeeplocal")
-+WIDGET_ATOM2(_moz_nativemenupopupstate, "_moz-nativemenupopupstate")
-+WIDGET_ATOM(openedwithkey)
-+WIDGET_ATOM(shellshowingmenubar)
---- /dev/null
-+++ b/widget/gtk/nsNativeMenuAtoms.cpp
-@@ -0,0 +1,39 @@
-+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-+/* vim:expandtab:shiftwidth=4:tabstop=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/. */
-+
-+#include "nsAtom.h"
-+#include "nsStaticAtom.h"
-+
-+#include "nsNativeMenuAtoms.h"
-+
-+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
-+
-+#define WIDGET_ATOM(name_) NS_STATIC_ATOM_BUFFER(name_, #name_)
-+#define WIDGET_ATOM2(name_, value_) NS_STATIC_ATOM_BUFFER(name_, value_)
-+#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);
-+}
---- /dev/null
-+++ b/widget/gtk/nsNativeMenuAtoms.h
-@@ -0,0 +1,27 @@
-+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-+/* vim:expandtab:shiftwidth=4:tabstop=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/. */
-+
-+#ifndef __nsNativeMenuAtoms_h__
-+#define __nsNativeMenuAtoms_h__
-+
-+class nsAtom;
-+
-+class nsNativeMenuAtoms
-+{
-+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
-+};
-+
-+#endif /* __nsNativeMenuAtoms_h__ */
---- /dev/null
+++ b/widget/gtk/nsNativeMenuDocListener.cpp
@@ -0,0 +1,350 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
@@ -4161,11 +4035,11 @@
+
+#include "mozilla/Assertions.h"
+#include "mozilla/DebugOnly.h"
++#include "mozilla/dom/Document.h"
+#include "mozilla/dom/Element.h"
+#include "nsContentUtils.h"
+#include "nsAtom.h"
+#include "nsIContent.h"
-+#include "nsIDocument.h"
+
+#include "nsMenuContainer.h"
+
@@ -4293,7 +4167,7 @@
+ m->mChild = aChild;
+
+ ScheduleFlush(this);
-+}
++}
+
+void
+nsNativeMenuDocListener::NodeWillBeDestroyed(const nsINode *aNode)
@@ -4385,7 +4259,7 @@
+ DoContentRemoved(m->mTarget, m->mChild);
+ break;
+ default:
-+ NS_NOTREACHED("Invalid type");
++ MOZ_ASSERT_UNREACHABLE("Invalid type");
+ }
+
+ mPendingMutations.RemoveElementAt(0);
@@ -4430,7 +4304,7 @@
+ gPendingListeners->RemoveElementAt(0);
+ }
+ }
-+
++
+ MOZ_ASSERT(sUpdateBlockersCount > 0, "Negative update blockers count!");
+ sUpdateBlockersCount--;
+}
@@ -4504,7 +4378,7 @@
+}
--- /dev/null
+++ b/widget/gtk/nsNativeMenuDocListener.h
-@@ -0,0 +1,152 @@
+@@ -0,0 +1,157 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
@@ -4525,9 +4399,14 @@
+
+class nsAtom;
+class nsIContent;
-+class nsIDocument;
+class nsNativeMenuChangeObserver;
+
++namespace mozilla {
++namespace dom {
++class Document;
++}
++}
++
+/*
+ * This class keeps a mapping of content nodes to observers and forwards DOM
+ * mutations to these. There is exactly one of these for every menubar.
@@ -4621,7 +4500,7 @@
+ static void RemoveUpdateBlocker();
+
+ nsCOMPtr<nsIContent> mRootNode;
-+ nsIDocument *mDocument;
++ mozilla::dom::Document *mDocument;
+ nsIContent *mLastSource;
+ nsNativeMenuChangeObserver *mLastTarget;
+ nsTArray<nsAutoPtr<MutationRecord> > mPendingMutations;
@@ -4659,7 +4538,7 @@
+#endif /* __nsNativeMenuDocListener_h__ */
--- /dev/null
+++ b/widget/gtk/nsNativeMenuService.cpp
-@@ -0,0 +1,508 @@
+@@ -0,0 +1,505 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
@@ -4683,7 +4562,6 @@
+
+#include "nsDbusmenu.h"
+#include "nsMenuBar.h"
-+#include "nsNativeMenuAtoms.h"
+#include "nsNativeMenuDocListener.h"
+
+#include <glib-object.h>
@@ -4699,8 +4577,6 @@
+extern PangoLayout* gPangoLayout;
+extern nsNativeMenuDocListenerTArray* gPendingListeners;
+
-+static const nsTArray<nsMenuBar *>::index_type NoIndex = nsTArray<nsMenuBar *>::NoIndex;
-+
+#if not GLIB_CHECK_VERSION(2,26,0)
+enum GBusType {
+ G_BUS_TYPE_STARTER = -1,
@@ -5097,10 +4973,10 @@
+ NS_ENSURE_ARG(aParent);
+ NS_ENSURE_ARG(aMenuBarNode);
+
-+ if (aMenuBarNode->AsElement()->AttrValueIs(kNameSpaceID_None,
-+ nsNativeMenuAtoms::_moz_menubarkeeplocal,
-+ nsGkAtoms::_true,
-+ eCaseMatters)) {
++ if (aMenuBarNode->AttrValueIs(kNameSpaceID_None,
++ nsGkAtoms::_moz_menubarkeeplocal,
++ nsGkAtoms::_true,
++ eCaseMatters)) {
+ return NS_OK;
+ }
+
@@ -5121,7 +4997,7 @@
+ mMenuBars.AppendElement(menubar.get());
+ RegisterNativeMenuBar(menubar.get());
+
-+ static_cast<nsWindow *>(aParent)->SetMenuBar(Move(menubar));
++ static_cast<nsWindow *>(aParent)->SetMenuBar(std::move(menubar));
+
+ return NS_OK;
+}
@@ -5255,75 +5131,30 @@
+};
+
+#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 "nsNativeThemeGTK.h"
- #include "HeadlessThemeGTK.h"
-
-@@ -114,6 +116,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)
-@@ -218,6 +223,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_WINDOW_CID, false, nullptr, nsWindowConstructor},
-@@ -264,6 +270,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[] = {
-@@ -306,6 +313,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
-@@ -67,6 +67,7 @@
+@@ -71,6 +71,7 @@
#include "mozilla/Assertions.h"
#include "mozilla/Likely.h"
+#include "mozilla/Move.h"
#include "mozilla/Preferences.h"
#include "nsIPrefService.h"
- #include "nsIGConfService.h"
-@@ -4653,6 +4654,10 @@ void nsWindow::HideWindowChrome(bool aSh
+ #include "nsIServiceManager.h"
+@@ -5067,6 +5068,10 @@ void nsWindow::HideWindowChrome(bool aSh
SetWindowDecoration(aShouldHide ? eBorderStyle_none : mBorderStyle);
}
+void nsWindow::SetMenuBar(UniquePtr<nsMenuBar> aMenuBar) {
-+ mMenuBar = mozilla::Move(aMenuBar);
++ mMenuBar = std::move(aMenuBar);
+}
+
bool nsWindow::CheckForRollup(gdouble aMouseX, gdouble aMouseY, bool aIsWheel,
bool aAlwaysRollup) {
- nsIRollupListener *rollupListener = GetActiveRollupListener();
+ nsIRollupListener* rollupListener = GetActiveRollupListener();
--- a/widget/gtk/nsWindow.h
+++ b/widget/gtk/nsWindow.h
-@@ -40,6 +40,8 @@
+@@ -38,6 +38,8 @@
#include "IMContextWrapper.h"
@@ -5332,7 +5163,7 @@
#undef LOG
#ifdef MOZ_LOGGING
-@@ -157,6 +159,8 @@ class nsWindow final : public nsBaseWidg
+@@ -171,6 +173,8 @@ class nsWindow final : public nsBaseWidg
nsIScreen* aTargetScreen = nullptr) override;
virtual void HideWindowChrome(bool aShouldHide) override;
@@ -5341,7 +5172,7 @@
/**
* GetLastUserInputTime returns a timestamp for the most recent user input
* event. This is intended for pointer grab requests (including drags).
-@@ -583,6 +587,8 @@ class nsWindow final : public nsBaseWidg
+@@ -633,6 +637,8 @@ class nsWindow final : public nsBaseWidg
mozilla::UniquePtr<mozilla::CurrentX11TimeGetter> mCurrentTimeGetter;
static CSDSupportLevel sCSDSupportLevel;
@@ -5352,15 +5183,15 @@
#endif /* __nsWindow_h__ */
--- a/widget/moz.build
+++ b/widget/moz.build
-@@ -64,9 +64,9 @@ elif toolkit == 'cocoa':
- 'nsISystemStatusBar.idl',
- 'nsITaskbarProgress.idl',
+@@ -68,9 +68,9 @@ elif toolkit == 'cocoa':
+ 'nsITouchBarInput.idl',
+ 'nsITouchBarUpdater.idl',
]
- EXPORTS += [
- 'nsINativeMenuService.h',
- ]
+
-+if toolkit in ('cocoa', 'gtk2', 'gtk3'):
++if toolkit in ('cocoa', 'gtk3'):
+ EXPORTS += ['nsINativeMenuService.h']
TEST_DIRS += ['tests']
@@ -5373,6 +5204,54 @@
-#ifdef XP_MACOSX
+#if defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
- #include "nsINativeMenuService.h"
- #define USE_NATIVE_MENUS
+ # include "nsINativeMenuService.h"
+ # define USE_NATIVE_MENUS
#endif
+--- /dev/null
++++ b/xpcom/ds/NativeMenuAtoms.py
+@@ -0,0 +1,9 @@
++from Atom import Atom
++
++NATIVE_MENU_ATOMS = [
++ Atom("menuitem_with_favicon", "menuitem-with-favicon"),
++ Atom("_moz_menubarkeeplocal", "_moz-menubarkeeplocal"),
++ Atom("_moz_nativemenupopupstate", "_moz-nativemenupopupstate"),
++ Atom("openedwithkey", "openedwithkey"),
++ Atom("shellshowingmenubar", "shellshowingmenubar"),
++]
+--- a/xpcom/ds/StaticAtoms.py
++++ b/xpcom/ds/StaticAtoms.py
+@@ -7,6 +7,7 @@
+ from Atom import Atom, InheritingAnonBoxAtom, NonInheritingAnonBoxAtom
+ from Atom import PseudoElementAtom
+ from HTMLAtoms import HTML_PARSER_ATOMS
++from NativeMenuAtoms import NATIVE_MENU_ATOMS
+ import sys
+
+ # Static atom definitions, used to generate nsGkAtomList.h.
+@@ -2477,7 +2478,7 @@ STATIC_ATOMS = [
+ InheritingAnonBoxAtom("AnonBox_mozSVGForeignContent", ":-moz-svg-foreign-content"),
+ InheritingAnonBoxAtom("AnonBox_mozSVGText", ":-moz-svg-text"),
+ # END ATOMS
+-] + HTML_PARSER_ATOMS
++] + HTML_PARSER_ATOMS + NATIVE_MENU_ATOMS
+
+
+ def verify():
+--- a/widget/gtk/components.conf
++++ b/widget/gtk/components.conf
+@@ -82,6 +82,14 @@ Classes = [
+ 'headers': ['/widget/gtk/nsApplicationChooser.h'],
+ 'processes': ProcessSelector.MAIN_PROCESS_ONLY,
+ },
++ {
++ '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'):