diff options
author | Björn Bidar | 2018-03-15 15:20:43 +0100 |
---|---|---|
committer | Björn Bidar | 2018-03-15 15:20:43 +0100 |
commit | ca113af76d116c9d094bf24778605ab8c147b453 (patch) | |
tree | c4164d2a0eb9029efa1a97ad2bf58a27fc855997 | |
parent | 5837bc01ac51a340a2c387551cf13ac4a40764b4 (diff) | |
download | aur-ca113af76d116c9d094bf24778605ab8c147b453.tar.gz |
upkg, removed mentions of gtk2, added gtk3-wayland options instead
-rw-r--r-- | .SRCINFO | 35 | ||||
-rw-r--r-- | PKGBUILD | 61 | ||||
-rw-r--r-- | firefox-install-dir.patch | 12 | ||||
-rw-r--r-- | no-crmf.diff | 6 | ||||
-rw-r--r-- | unity-menubar.patch | 568 |
5 files changed, 195 insertions, 487 deletions
@@ -1,8 +1,8 @@ # Generated by mksrcinfo v8 -# Sun Feb 11 05:07:38 UTC 2018 +# Thu Mar 15 14:20:00 UTC 2018 pkgbase = firefox-kde-opensuse pkgdesc = Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE - pkgver = 58.0.2 + pkgver = 59.0 pkgrel = 1 url = https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox arch = i686 @@ -25,7 +25,6 @@ pkgbase = firefox-kde-opensuse makedepends = cargo makedepends = mercurial makedepends = llvm - depends = gtk2 depends = mozilla-common depends = libxt depends = startup-notification @@ -46,48 +45,40 @@ pkgbase = firefox-kde-opensuse depends = gtk3 optdepends = networkmanager: Location detection via available WiFi networks optdepends = speech-dispatcher: Text-to-Speech - provides = firefox=58.0.2 + provides = firefox=59.0 conflicts = firefox options = !emptydirs options = strip - source = hg+https://hg.mozilla.org/mozilla-unified#tag=FIREFOX_58_0_2_RELEASE + source = hg+https://hg.mozilla.org/mozilla-unified#tag=FIREFOX_59_0_RELEASE source = mozconfig source = firefox.desktop - source = firefox-install-dir.patch source = vendor.js source = kde.js source = firefox-fixed-loading-icon.png - source = firefox-branded-icons-d14085eee2b2.patch::http://www.rosenauer.org/hg/mozilla/raw-file/d14085eee2b2/firefox-branded-icons.patch - source = firefox-kde-d14085eee2b2.patch::http://www.rosenauer.org/hg/mozilla/raw-file/d14085eee2b2/firefox-kde.patch - source = firefox-no-default-ualocale-d14085eee2b2.patch::http://www.rosenauer.org/hg/mozilla/raw-file/d14085eee2b2/firefox-no-default-ualocale.patch - source = mozilla-kde-d14085eee2b2.patch::http://www.rosenauer.org/hg/mozilla/raw-file/d14085eee2b2/mozilla-kde.patch - source = mozilla-nongnome-proxies-d14085eee2b2.patch::http://www.rosenauer.org/hg/mozilla/raw-file/d14085eee2b2/mozilla-nongnome-proxies.patch + source = firefox-branded-icons-d61b64679bb4.patch::http://www.rosenauer.org/hg/mozilla/raw-file/d61b64679bb4/firefox-branded-icons.patch + source = firefox-kde-d61b64679bb4.patch::http://www.rosenauer.org/hg/mozilla/raw-file/d61b64679bb4/firefox-kde.patch + source = mozilla-kde-d61b64679bb4.patch::http://www.rosenauer.org/hg/mozilla/raw-file/d61b64679bb4/mozilla-kde.patch + source = mozilla-nongnome-proxies-d61b64679bb4.patch::http://www.rosenauer.org/hg/mozilla/raw-file/d61b64679bb4/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 = firefox-install-dir.patch source = no-crmf.diff - source = 0001-Bug-1430274-Define-MOZ_ALSA-for-more-source-files.-r.patch md5sums = SKIP md5sums = 6e7ef23754f23c32adaf686a760d369a md5sums = 14e0f6237a79b85e60256f4808163160 - md5sums = dbf14588e85812ee769bd735823a0146 md5sums = aa9f776d2187cba09de65cbb02b39ca0 md5sums = 05bb69d25fb3572c618e3adf1ee7b670 md5sums = 6e335a517c68488941340ee1c23f97b0 - md5sums = af659b0f4f5b904480bf97843fa3502b - md5sums = fa564c666987df18683c1cb53a3834a9 - md5sums = 82f7f100d4b01677ed748679565d8b1a - md5sums = 1975dde6770233eb17a16beea317d947 + md5sums = df9f710c842d4847aae5bc667f97f4a2 + md5sums = 1b373a938f8dd92fc93a31e4746f3609 + md5sums = e594a05742a6dbb1496e62563c4b87f8 md5sums = 0661e259fe57df87fca791f4aeb78da0 - md5sums = 38b6df4dbce5df03e46eefe41202d74b + md5sums = d75eda715db340eb28e3a0417e2846a2 md5sums = fe24f5ea463013bb7f1c12d12dce41b2 md5sums = 3fa8bd22d97248de529780f5797178af md5sums = b358b5ed3726ecd4ed054bdc09901982 - md5sums = dbf14588e85812ee769bd735823a0146 - md5sums = 196edf030efc516e3de5ae3aa01e9851 - md5sums = cf8b9644eb0ae7820ccc2e775fb68d6e + md5sums = 5223d4854f784003e3b575684cc004fe pkgname = firefox-kde-opensuse @@ -5,8 +5,8 @@ # enable this if you run out of memory during linking #_lowmem=true -# enable gtk3 (warning: flash or any other plugin crashes frequently) -_gtk3=true +# enable gtk3 wayland (experimental) +_gtk3_wayland=false # try to build with PGO # currently broken @@ -20,19 +20,16 @@ _pgo=true _pkgname=firefox pkgname=$_pkgname-kde-opensuse -pkgver=58.0.2 +pkgver=59.0 pkgrel=1 pkgdesc="Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE" arch=('i686' 'x86_64') license=('MPL' 'GPL' 'LGPL') url="https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox" -depends=('gtk2' 'mozilla-common' 'libxt' 'startup-notification' 'mime-types' +depends=('mozilla-common' 'libxt' 'startup-notification' 'mime-types' 'dbus-glib' 'alsa-lib' 'hicolor-icon-theme' 'libvpx' 'icu' 'libevent' 'nss>=3.28.3' 'nspr>=4.10.6' 'hunspell' - 'sqlite' 'libnotify' 'kmozillahelper' 'ffmpeg' ) -if [ $_gtk3 ] ; then - depends+=('gtk3') -fi + 'sqlite' 'libnotify' 'kmozillahelper' 'ffmpeg' 'gtk3') makedepends=('unzip' 'zip' 'diffutils' 'python2' 'yasm' 'mesa' 'imake' 'xorg-server-xvfb' 'libpulse' 'inetutils' 'autoconf2.13' 'rust' @@ -41,16 +38,19 @@ optdepends=('networkmanager: Location detection via available WiFi networks' 'speech-dispatcher: Text-to-Speech') provides=("firefox=${pkgver}") conflicts=('firefox') -_patchrev=d14085eee2b2 +_patchrev=d61b64679bb4 options=('!emptydirs' 'strip') _patchurl=http://www.rosenauer.org/hg/mozilla/raw-file/$_patchrev _repo=https://hg.mozilla.org/mozilla-unified source=("hg+$_repo#tag=FIREFOX_${pkgver//./_}_RELEASE" - mozconfig firefox.desktop firefox-install-dir.patch vendor.js kde.js firefox-fixed-loading-icon.png + mozconfig + firefox.desktop + vendor.js + kde.js + firefox-fixed-loading-icon.png # Firefox patchset firefox-branded-icons-$_patchrev.patch::$_patchurl/firefox-branded-icons.patch firefox-kde-$_patchrev.patch::$_patchurl/firefox-kde.patch - firefox-no-default-ualocale-$_patchrev.patch::$_patchurl/firefox-no-default-ualocale.patch # Gecko/toolkit patchset mozilla-kde-$_patchrev.patch::$_patchurl/mozilla-kde.patch mozilla-nongnome-proxies-$_patchrev.patch::$_patchurl/mozilla-nongnome-proxies.patch @@ -58,8 +58,7 @@ source=("hg+$_repo#tag=FIREFOX_${pkgver//./_}_RELEASE" add_missing_pgo_rule.patch pgo_fix_missing_kdejs.patch fix_pgo_bug1389436_explicitly_instantiate_gfxFont.patch - firefox-install-dir.patch no-crmf.diff - 0001-Bug-1430274-Define-MOZ_ALSA-for-more-source-files.-r.patch + no-crmf.diff ) @@ -84,9 +83,13 @@ prepare() { cp "$srcdir/mozconfig" .mozconfig - patch -Np1 -i "$srcdir/firefox-install-dir.patch" + if [ $_gtk3_wayland = true ] ; then + echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" \ + >> .mozconfig + fi + + - echo -n "$_google_api_key" >google-api-key echo "ac_add_options --with-google-api-keyfile=\"$PWD/google-api-key\"" >>.mozconfig @@ -101,7 +104,6 @@ prepare() { patch -Np1 -i "$srcdir/mozilla-kde-$_patchrev.patch" patch -Np1 -i "$srcdir/firefox-kde-$_patchrev.patch" - patch -Np1 -i "$srcdir/firefox-no-default-ualocale-$_patchrev.patch" patch -Np1 -i "$srcdir/firefox-branded-icons-$_patchrev.patch" # add globalmenu support @@ -113,13 +115,6 @@ prepare() { # add missing file Makefile for pgo builds patch -Np1 -i "$srcdir"/pgo_fix_missing_kdejs.patch - # configure script misdetects the preprocessor without an optimization level - # https://bugs.archlinux.org/task/34644 - # sed -i '/ac_cpp=/s/$CPPFLAGS/& -O2/' configure - - # https://bugs.archlinux.org/task/57285 - patch -Np1 -i "$srcdir"/0001-Bug-1430274-Define-MOZ_ALSA-for-more-source-files.-r.patch - # https://bugzilla.mozilla.org/show_bug.cgi?id=1371991 patch -Np1 -i ../no-crmf.diff @@ -188,15 +183,11 @@ app.distributor.channel=$pkgname app.partner.archlinux=archlinux END - for i in 16 22 24 32 48 256; do + for i in 16 22 24 32 48 64 128 256; do install -Dm644 browser/branding/official/default$i.png \ "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/firefox.png" done - install -Dm644 browser/branding/official/content/icon64.png \ - "$pkgdir/usr/share/icons/hicolor/64x64/apps/firefox.png" - install -Dm644 browser/branding/official/mozicon128.png \ - "$pkgdir/usr/share/icons/hicolor/128x128/apps/firefox.png" install -Dm644 browser/branding/official/content/about-logo.png \ "$pkgdir/usr/share/icons/hicolor/192x192/apps/firefox.png" install -Dm644 browser/branding/official/content/about-logo@2x.png \ @@ -220,19 +211,15 @@ END md5sums=('SKIP' '6e7ef23754f23c32adaf686a760d369a' '14e0f6237a79b85e60256f4808163160' - 'dbf14588e85812ee769bd735823a0146' 'aa9f776d2187cba09de65cbb02b39ca0' '05bb69d25fb3572c618e3adf1ee7b670' '6e335a517c68488941340ee1c23f97b0' - 'af659b0f4f5b904480bf97843fa3502b' - 'fa564c666987df18683c1cb53a3834a9' - '82f7f100d4b01677ed748679565d8b1a' - '1975dde6770233eb17a16beea317d947' + 'df9f710c842d4847aae5bc667f97f4a2' + '1b373a938f8dd92fc93a31e4746f3609' + 'e594a05742a6dbb1496e62563c4b87f8' '0661e259fe57df87fca791f4aeb78da0' - '38b6df4dbce5df03e46eefe41202d74b' + 'd75eda715db340eb28e3a0417e2846a2' 'fe24f5ea463013bb7f1c12d12dce41b2' '3fa8bd22d97248de529780f5797178af' 'b358b5ed3726ecd4ed054bdc09901982' - 'dbf14588e85812ee769bd735823a0146' - '196edf030efc516e3de5ae3aa01e9851' - 'cf8b9644eb0ae7820ccc2e775fb68d6e') + '5223d4854f784003e3b575684cc004fe') diff --git a/firefox-install-dir.patch b/firefox-install-dir.patch deleted file mode 100644 index 51fe4ba0a855..000000000000 --- a/firefox-install-dir.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-29.0/mozilla-release/config/baseconfig.mk.orig firefox-29.0/mozilla-release/config/baseconfig.mk ---- mozilla-release/config/baseconfig.mk.orig 2014-04-22 15:38:52.948165295 +0200 -+++ mozilla-release/config/baseconfig.mk 2014-04-22 15:42:20.387481673 +0200 -@@ -4,7 +4,7 @@ - # whether a normal build is happening or whether the check is running. - includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) - idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) --installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) -+installdir = $(libdir)/$(MOZ_APP_NAME) - sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION) - ifndef TOP_DIST - TOP_DIST = dist diff --git a/no-crmf.diff b/no-crmf.diff index 242304eb4182..682ba3fc0fd2 100644 --- a/no-crmf.diff +++ b/no-crmf.diff @@ -1,9 +1,9 @@ diff --git i/old-configure.in w/old-configure.in -index 0a06e470d2085922..d41c8e9d5dd2dbfb 100644 +index 12170a47568f..dbbaa0bc9194 100644 --- i/old-configure.in +++ w/old-configure.in -@@ -2020,9 +2020,7 @@ if test -n "$_USE_SYSTEM_NSS"; then - AM_PATH_NSS(3.31, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])]) +@@ -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 diff --git a/unity-menubar.patch b/unity-menubar.patch index 51c3cbd8f646..5f08a5cb3ab4 100644 --- a/unity-menubar.patch +++ b/unity-menubar.patch @@ -1,11 +1,6 @@ -diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc --- a/browser/base/content/browser-menubar.inc +++ b/browser/base/content/browser-menubar.inc -@@ -1,16 +1,20 @@ - # -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - # This Source Code Form is subject to the terms of the Mozilla Public - # License, v. 2.0. If a copy of the MPL was not distributed with this - # file, You can obtain one at http://mozilla.org/MPL/2.0/. +@@ -5,7 +5,11 @@ <menubar id="main-menubar" onpopupshowing="if (event.target.parentNode.parentNode == this && @@ -17,42 +12,9 @@ diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/bro this.setAttribute('openedwithkey', event.target.parentNode.openedWithKey);" style="border:0px;padding:0px;margin:0px;-moz-appearance:none"> - <menu id="file-menu" label="&fileMenu.label;" - accesskey="&fileMenu.accesskey;"> - <menupopup id="menu_FilePopup" - onpopupshowing="updateUserContextUIVisibility();"> - <menuitem id="menu_newNavigatorTab" -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 -@@ -5373,16 +5373,18 @@ nsBrowserAccess.prototype = { - return CanCloseWindow(); - }, - }; - - function getTogglableToolbars() { - let toolbarNodes = Array.slice(gNavToolbox.childNodes); - toolbarNodes = toolbarNodes.concat(gNavToolbox.externalToolbars); - toolbarNodes = toolbarNodes.filter(node => node.getAttribute("toolbarname")); -+ if (document.documentElement.getAttribute("shellshowingmenubar") == "true") -+ toolbarNodes = toolbarNodes.filter(node => node.id != "toolbar-menubar"); - return toolbarNodes; - } - - function onViewToolbarsPopupShowing(aEvent, aInsertPoint) { - var popup = aEvent.target; - if (popup != aEvent.currentTarget) - return; - -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 -@@ -153,17 +153,17 @@ - command="OrganizerCommand:Forward" - tooltiptext="&forwardButton.tooltip;" - disabled="true"/> - - #ifdef XP_MACOSX +@@ -160,7 +160,7 @@ <toolbarbutton type="menu" class="tabbable" onpopupshowing="document.getElementById('placeContent').focus()" #else @@ -61,20 +23,9 @@ diff --git a/browser/components/places/content/places.xul b/browser/components/p <menu accesskey="&organize.accesskey;" class="menu-iconic" #endif id="organizeButton" label="&organize.label;" - tooltiptext="&organize.tooltip;"> - <menupopup id="organizeButtonPopup"> - <menuitem id="newbookmark" - command="placesCmd_new:bookmark" - label="&cmd.new_bookmark.label;" -diff --git a/layout/build/moz.build b/layout/build/moz.build --- a/layout/build/moz.build +++ b/layout/build/moz.build -@@ -69,16 +69,20 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co - LOCAL_INCLUDES += [ - '/dom/system/mac', - ] - elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': - LOCAL_INCLUDES += [ +@@ -72,6 +72,10 @@ '/dom/system', '/dom/system/android', ] @@ -85,22 +36,11 @@ diff --git a/layout/build/moz.build b/layout/build/moz.build if CONFIG['MOZ_WEBSPEECH']: LOCAL_INCLUDES += [ - '/dom/media/webspeech/recognition', - '/dom/media/webspeech/synth', - ] - - if CONFIG['MOZ_SECUREELEMENT']: -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/ServoBindings.h" - #include "mozilla/StaticPresData.h" - #include "mozilla/StylePrefs.h" - #include "mozilla/dom/WebIDLGlobalNameHash.h" - #include "mozilla/dom/ipc/IPCBlobInputStreamStorage.h" - #include "mozilla/dom/U2FTokenManager.h" - #include "mozilla/dom/PointerEventHandler.h" +@@ -125,6 +125,10 @@ + #include "nsHostObjectProtocolHandler.h" + #include "nsThreadManager.h" +#ifdef MOZ_WIDGET_GTK +#include "nsNativeMenuAtoms.h" @@ -109,17 +49,7 @@ diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp using namespace mozilla; using namespace mozilla::net; using namespace mozilla::dom; - using namespace mozilla::dom::ipc; - - nsrefcnt nsLayoutStatics::sLayoutStaticRefcnt = 0; - - nsresult -@@ -152,16 +156,19 @@ nsLayoutStatics::Initialize() - nsCSSPseudoClasses::AddRefAtoms(); - nsCSSPseudoElements::AddRefAtoms(); - nsCSSKeywords::AddRefTable(); - nsCSSProps::AddRefTable(); - nsColorNames::AddRefTable(); +@@ -156,6 +160,9 @@ nsGkAtoms::AddRefAtoms(); nsHTMLTags::RegisterAtoms(); nsRDFAtoms::RegisterAtoms(); @@ -129,20 +59,9 @@ diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp NS_SealStaticAtomTable(); - StartupJSEnvironment(); - rv = nsRegion::InitStatic(); - if (NS_FAILED(rv)) { - NS_ERROR("Could not initialize nsRegion"); - return rv; -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 -@@ -228,16 +228,19 @@ pref("dom.script_loader.bytecode_cache.e - // look at: ScriptLoader::ShouldCacheBytecode function. - pref("dom.script_loader.bytecode_cache.strategy", 0); - - // Fastback caching - if this pref is negative, then we calculate the number - // of content viewers to cache based on the amount of available memory. +@@ -239,6 +239,9 @@ pref("browser.sessionhistory.max_total_viewers", -1); pref("ui.use_native_colors", true); @@ -152,20 +71,9 @@ diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js pref("ui.click_hold_context_menus", false); // Pop up context menu on mouseup instead of mousedown, if that's the OS default. - // Note: ignored on Windows (context menus always use mouseup) - pref("ui.context_menus.after_mouseup", false); - // 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; +@@ -27,8 +27,14 @@ </getter> </property> @@ -182,20 +90,9 @@ diff --git a/toolkit/content/widgets/popup.xml b/toolkit/content/widgets/popup.x <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 -@@ -309,16 +309,28 @@ toolbar[type="menubar"][autohide="true"] - toolbar[type="menubar"][autohide="true"][inactive="true"]:not([customizing="true"]) { - min-height: 0 !important; - height: 0 !important; - -moz-appearance: none !important; - border-style: none !important; +@@ -313,6 +313,18 @@ } %endif @@ -214,15 +111,9 @@ diff --git a/toolkit/content/xul.css b/toolkit/content/xul.css toolbarseparator { -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbardecoration"); } - - toolbarspacer { - -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbardecoration"); - } - -diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build --- a/widget/gtk/moz.build +++ b/widget/gtk/moz.build -@@ -33,10 +33,18 @@ +@@ -39,10 +39,18 @@ 'nsAppShell.cpp', 'nsBidiKeyboard.cpp', 'nsColorPicker.cpp', @@ -241,7 +132,7 @@ diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build 'nsNativeThemeGTK.cpp', 'nsSound.cpp', 'nsToolkit.cpp', -@@ -48,6 +56,8 @@ +@@ -54,6 +62,8 @@ ] SOURCES += [ @@ -250,17 +141,14 @@ diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build 'nsWindow.cpp', # conflicts with X11 headers ] -@@ -112,6 +122,7 @@ +@@ -124,6 +134,7 @@ LOCAL_INCLUDES += [ '/layout/generic', + '/layout/style', '/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 + '/widget', --- /dev/null +++ b/widget/gtk/nsDbusmenu.cpp @@ -0,0 +1,63 @@ @@ -327,8 +215,6 @@ new file mode 100644 + + return NS_OK; +} -diff --git a/widget/gtk/nsDbusmenu.h b/widget/gtk/nsDbusmenu.h -new file mode 100644 --- /dev/null +++ b/widget/gtk/nsDbusmenu.h @@ -0,0 +1,101 @@ @@ -433,11 +319,9 @@ new file mode 100644 +#define dbusmenu_menuitem_property_set_shortcut nsDbusmenuFunctions::s_dbusmenu_menuitem_property_set_shortcut + +#endif /* __nsDbusmenu_h__ */ -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,852 @@ +@@ -0,0 +1,854 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -591,7 +475,8 @@ new file mode 100644 + + RefPtr<nsXBLBinding> binding; + bool dummy; -+ nsresult rv = xbl->LoadBindings(aContent, display->mBinding->GetURI(), ++ nsresult rv = xbl->LoadBindings(aContent->AsElement(), ++ display->mBinding->GetURI(), + display->mBinding->mExtraData->GetPrincipal(), + getter_AddRefs(binding), &dummy); + if ((NS_FAILED(rv) && rv != NS_ERROR_XBL_BLOCKED) || !binding) { @@ -626,13 +511,13 @@ new file mode 100644 + } + + if (state.IsEmpty()) { -+ mPopupContent->UnsetAttr(kNameSpaceID_None, -+ nsNativeMenuAtoms::_moz_nativemenupopupstate, -+ false); ++ mPopupContent->AsElement()->UnsetAttr( ++ kNameSpaceID_None, nsNativeMenuAtoms::_moz_nativemenupopupstate, ++ false); + } else { -+ mPopupContent->SetAttr(kNameSpaceID_None, -+ nsNativeMenuAtoms::_moz_nativemenupopupstate, -+ state, false); ++ mPopupContent->AsElement()->SetAttr( ++ kNameSpaceID_None, nsNativeMenuAtoms::_moz_nativemenupopupstate, ++ state, false); + } +} + @@ -725,8 +610,8 @@ new file mode 100644 + SetPopupState(ePopupState_Showing); + DispatchMouseEvent(mPopupContent, eXULPopupShowing); + -+ ContentNode()->SetAttr(kNameSpaceID_None, nsGkAtoms::open, -+ NS_LITERAL_STRING("true"), true); ++ ContentNode()->AsElement()->SetAttr(kNameSpaceID_None, nsGkAtoms::open, ++ NS_LITERAL_STRING("true"), true); + } + + if (!self) { @@ -767,7 +652,7 @@ new file mode 100644 + + uint32_t count = mPopupContent->GetChildCount(); + for (uint32_t i = 0; i < count; ++i) { -+ nsIContent *childContent = mPopupContent->GetChildAt(i); ++ nsIContent *childContent = mPopupContent->GetChildAt_Deprecated(i); + + UniquePtr<nsMenuObject> child = CreateChild(childContent); + @@ -786,7 +671,7 @@ new file mode 100644 + oldPopupContent.swap(mPopupContent); + + for (uint32_t i = 0; i < ContentNode()->GetChildCount(); ++i) { -+ nsIContent *child = ContentNode()->GetChildAt(i); ++ nsIContent *child = ContentNode()->GetChildAt_Deprecated(i); + + int32_t dummy; + nsAtom* tag = child->OwnerDoc()->BindingManager()->ResolveTag(child, &dummy); @@ -887,10 +772,10 @@ new file mode 100644 +{ + bool isVisible = dbusmenu_menuitem_property_get_bool(GetNativeData(), + DBUSMENU_MENUITEM_PROP_VISIBLE); -+ bool isDisabled = ContentNode()->AttrValueIs(kNameSpaceID_None, -+ nsGkAtoms::disabled, -+ nsGkAtoms::_true, -+ eCaseMatters); ++ bool isDisabled = ContentNode()->AsElement()->AttrValueIs(kNameSpaceID_None, ++ nsGkAtoms::disabled, ++ nsGkAtoms::_true, ++ eCaseMatters); + + return (isVisible && !isDisabled); +} @@ -1287,11 +1172,10 @@ new file mode 100644 + SetPopupState(ePopupState_Closed); + DispatchMouseEvent(mPopupContent, eXULPopupHidden); + -+ ContentNode()->UnsetAttr(kNameSpaceID_None, nsGkAtoms::open, true); ++ ContentNode()->AsElement()->UnsetAttr(kNameSpaceID_None, nsGkAtoms::open, ++ true); +} + -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 @@ @@ -1419,11 +1303,9 @@ new file mode 100644 +}; + +#endif /* __nsMenu_h__ */ -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,576 @@ +@@ -0,0 +1,579 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -1465,7 +1347,7 @@ new file mode 100644 +ShouldHandleKeyEvent(nsIDOMEvent *aEvent) +{ + bool handled, trusted = false; -+ aEvent->GetPreventDefault(&handled); ++ aEvent->GetDefaultPrevented(&handled); + aEvent->GetIsTrusted(&trusted); + + if (handled || !trusted) { @@ -1647,7 +1529,7 @@ new file mode 100644 +{ + uint32_t count = ContentNode()->GetChildCount(); + for (uint32_t i = 0; i < count; ++i) { -+ nsIContent *childContent = ContentNode()->GetChildAt(i); ++ nsIContent *childContent = ContentNode()->GetChildAt_Deprecated(i); + + UniquePtr<nsMenuObject> child = CreateChild(childContent); + @@ -1691,8 +1573,9 @@ new file mode 100644 +void +nsMenuBar::Focus() +{ -+ ContentNode()->SetAttr(kNameSpaceID_None, nsNativeMenuAtoms::openedwithkey, -+ NS_LITERAL_STRING("false"), true); ++ ContentNode()->AsElement()->SetAttr(kNameSpaceID_None, ++ nsNativeMenuAtoms::openedwithkey, ++ NS_LITERAL_STRING("false"), true); +} + +void @@ -1765,9 +1648,9 @@ new file mode 100644 + uint32_t count = ChildCount(); + for (uint32_t i = 0; i < count; ++i) { + nsAutoString accesskey; -+ ChildAt(i)->ContentNode()->GetAttr(kNameSpaceID_None, -+ nsGkAtoms::accesskey, -+ accesskey); ++ ChildAt(i)->ContentNode()->AsElement()->GetAttr(kNameSpaceID_None, ++ nsGkAtoms::accesskey, ++ accesskey); + const nsAutoString::char_type *key = accesskey.BeginReading(); + if (*key == chu || *key == chl) { + found = ChildAt(i); @@ -1779,8 +1662,9 @@ new file mode 100644 + return NS_OK; + } + -+ ContentNode()->SetAttr(kNameSpaceID_None, nsNativeMenuAtoms::openedwithkey, -+ NS_LITERAL_STRING("true"), true); ++ ContentNode()->AsElement()->SetAttr(kNameSpaceID_None, ++ nsNativeMenuAtoms::openedwithkey, ++ NS_LITERAL_STRING("true"), true); + static_cast<nsMenu *>(found)->OpenMenu(); + + aEvent->StopPropagation(); @@ -1976,8 +1860,9 @@ new file mode 100644 + false); + + // Clear this. Not sure if we really need to though -+ ContentNode()->SetAttr(kNameSpaceID_None, nsNativeMenuAtoms::openedwithkey, -+ NS_LITERAL_STRING("false"), true); ++ ContentNode()->AsElement()->SetAttr(kNameSpaceID_None, ++ nsNativeMenuAtoms::openedwithkey, ++ NS_LITERAL_STRING("false"), true); + + DocListener()->Start(); + Build(); @@ -2000,8 +1885,6 @@ new file mode 100644 + DocListener()->Stop(); + DisconnectDocumentEventListeners(); +} -diff --git a/widget/gtk/nsMenuBar.h b/widget/gtk/nsMenuBar.h -new file mode 100644 --- /dev/null +++ b/widget/gtk/nsMenuBar.h @@ -0,0 +1,106 @@ @@ -2111,8 +1994,6 @@ new file mode 100644 +}; + +#endif /* __nsMenuBar_h__ */ -diff --git a/widget/gtk/nsMenuContainer.cpp b/widget/gtk/nsMenuContainer.cpp -new file mode 100644 --- /dev/null +++ b/widget/gtk/nsMenuContainer.cpp @@ -0,0 +1,171 @@ @@ -2287,8 +2168,6 @@ new file mode 100644 + + return aContent; +} -diff --git a/widget/gtk/nsMenuContainer.h b/widget/gtk/nsMenuContainer.h -new file mode 100644 --- /dev/null +++ b/widget/gtk/nsMenuContainer.h @@ -0,0 +1,70 @@ @@ -2362,11 +2241,9 @@ new file mode 100644 +}; + +#endif /* __nsMenuContainer_h__ */ -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,737 @@ +@@ -0,0 +1,759 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -2710,14 +2587,18 @@ new file mode 100644 + // after we have finished + nsNativeMenuDocListener::BlockUpdatesScope updatesBlocker; + -+ if (!ContentNode()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::autocheck, -+ nsGkAtoms::_false, eCaseMatters) && ++ if (!ContentNode()->AsElement()->AttrValueIs(kNameSpaceID_None, ++ nsGkAtoms::autocheck, ++ nsGkAtoms::_false, ++ eCaseMatters) && + (mType == eMenuItemType_CheckBox || + (mType == eMenuItemType_Radio && !mIsChecked))) { -+ ContentNode()->SetAttr(kNameSpaceID_None, nsGkAtoms::checked, -+ mIsChecked ? -+ NS_LITERAL_STRING("false") : NS_LITERAL_STRING("true"), -+ true); ++ ContentNode()->AsElement()->SetAttr(kNameSpaceID_None, ++ nsGkAtoms::checked, ++ mIsChecked ? ++ NS_LITERAL_STRING("false") ++ : NS_LITERAL_STRING("true"), ++ true); + } + + nsIDocument *doc = ContentNode()->OwnerDoc(); @@ -2752,8 +2633,9 @@ new file mode 100644 +nsMenuItem::CopyAttrFromNodeIfExists(nsIContent *aContent, nsAtom *aAttribute) +{ + nsAutoString value; -+ if (aContent->GetAttr(kNameSpaceID_None, aAttribute, value)) { -+ ContentNode()->SetAttr(kNameSpaceID_None, aAttribute, value, true); ++ if (aContent->AsElement()->GetAttr(kNameSpaceID_None, aAttribute, value)) { ++ ContentNode()->AsElement()->SetAttr(kNameSpaceID_None, aAttribute, ++ value, true); + } +} + @@ -2764,10 +2646,10 @@ new file mode 100644 + return; + } + -+ mIsChecked = ContentNode()->AttrValueIs(kNameSpaceID_None, -+ nsGkAtoms::checked, -+ nsGkAtoms::_true, -+ eCaseMatters); ++ mIsChecked = ContentNode()->AsElement()->AttrValueIs(kNameSpaceID_None, ++ nsGkAtoms::checked, ++ nsGkAtoms::_true, ++ eCaseMatters); + dbusmenu_menuitem_property_set_int(GetNativeData(), + DBUSMENU_MENUITEM_PROP_TOGGLE_STATE, + mIsChecked ? @@ -2778,11 +2660,11 @@ new file mode 100644 +void +nsMenuItem::UpdateTypeAndState() +{ -+ static nsIContent::AttrValuesArray attrs[] = ++ static mozilla::dom::Element::AttrValuesArray attrs[] = + { &nsGkAtoms::checkbox, &nsGkAtoms::radio, nullptr }; -+ int32_t type = ContentNode()->FindAttrValueIn(kNameSpaceID_None, -+ nsGkAtoms::type, -+ attrs, eCaseMatters); ++ int32_t type = ContentNode()->AsElement()->FindAttrValueIn(kNameSpaceID_None, ++ nsGkAtoms::type, ++ attrs, eCaseMatters); + + if (type >= 0 && type < 2) { + if (type == 0) { @@ -2816,7 +2698,8 @@ new file mode 100644 + oldKeyContent.swap(mKeyContent); + + nsAutoString key; -+ ContentNode()->GetAttr(kNameSpaceID_None, nsGkAtoms::key, key); ++ ContentNode()->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::key, ++ key); + if (!key.IsEmpty()) { + mKeyContent = doc->GetElementById(key); + } @@ -2838,7 +2721,8 @@ new file mode 100644 + } + + nsAutoString modifiers; -+ mKeyContent->GetAttr(kNameSpaceID_None, nsGkAtoms::modifiers, modifiers); ++ mKeyContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::modifiers, ++ modifiers); + + uint32_t modifier = 0; + @@ -2872,7 +2756,8 @@ new file mode 100644 + } + + nsAutoString keyStr; -+ mKeyContent->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyStr); ++ mKeyContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::key, ++ keyStr); + + guint key = 0; + if (!keyStr.IsEmpty()) { @@ -2880,7 +2765,8 @@ new file mode 100644 + } + + if (key == 0) { -+ mKeyContent->GetAttr(kNameSpaceID_None, nsGkAtoms::keycode, keyStr); ++ mKeyContent->AsElement()->GetAttr(kNameSpaceID_None, ++ nsGkAtoms::keycode, keyStr); + if (!keyStr.IsEmpty()) { + key = ConvertGeckoKeyNameToGDKKeyval(keyStr); + } @@ -2915,14 +2801,17 @@ new file mode 100644 +void +nsMenuItem::UncheckSiblings() +{ -+ if (!ContentNode()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type, -+ nsGkAtoms::radio, eCaseMatters)) { ++ if (!ContentNode()->AsElement()->AttrValueIs(kNameSpaceID_None, ++ nsGkAtoms::type, ++ nsGkAtoms::radio, ++ eCaseMatters)) { + // If we're not a radio button, we don't care + return; + } + + nsAutoString name; -+ ContentNode()->GetAttr(kNameSpaceID_None, nsGkAtoms::name, name); ++ ContentNode()->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::name, ++ name); + + nsIContent *parent = ContentNode()->GetParent(); + if (!parent) { @@ -2931,15 +2820,19 @@ new file mode 100644 + + uint32_t count = parent->GetChildCount(); + for (uint32_t i = 0; i < count; ++i) { -+ nsIContent *sibling = parent->GetChildAt(i); ++ nsIContent *sibling = parent->GetChildAt_Deprecated(i); + + nsAutoString otherName; -+ sibling->GetAttr(kNameSpaceID_None, nsGkAtoms::name, otherName); ++ sibling->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::name, ++ otherName); + + if (sibling != ContentNode() && otherName == name && -+ sibling->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type, -+ nsGkAtoms::radio, eCaseMatters)) { -+ sibling->UnsetAttr(kNameSpaceID_None, nsGkAtoms::checked, true); ++ sibling->AsElement()->AttrValueIs(kNameSpaceID_None, ++ nsGkAtoms::type, ++ nsGkAtoms::radio, ++ eCaseMatters)) { ++ sibling->AsElement()->UnsetAttr(kNameSpaceID_None, ++ nsGkAtoms::checked, true); + } + } +} @@ -2962,7 +2855,8 @@ new file mode 100644 + } + + nsAutoString command; -+ ContentNode()->GetAttr(kNameSpaceID_None, nsGkAtoms::command, command); ++ ContentNode()->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::command, ++ command); + if (command.IsEmpty()) { + return; + } @@ -2972,12 +2866,16 @@ new file mode 100644 + return; + } + -+ if (commandContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled, -+ nsGkAtoms::_true, eCaseMatters)) { -+ ContentNode()->SetAttr(kNameSpaceID_None, nsGkAtoms::disabled, -+ NS_LITERAL_STRING("true"), true); ++ if (commandContent->AsElement()->AttrValueIs(kNameSpaceID_None, ++ nsGkAtoms::disabled, ++ nsGkAtoms::_true, ++ eCaseMatters)) { ++ ContentNode()->AsElement()->SetAttr(kNameSpaceID_None, ++ nsGkAtoms::disabled, ++ NS_LITERAL_STRING("true"), true); + } else { -+ ContentNode()->UnsetAttr(kNameSpaceID_None, nsGkAtoms::disabled, true); ++ ContentNode()->AsElement()->UnsetAttr(kNameSpaceID_None, ++ nsGkAtoms::disabled, true); + } + + CopyAttrFromNodeIfExists(commandContent, nsGkAtoms::checked); @@ -3031,8 +2929,9 @@ new file mode 100644 + "Received an event that wasn't meant for us!"); + + if (aContent == ContentNode() && aAttribute == nsGkAtoms::checked && -+ aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::checked, -+ nsGkAtoms::_true, eCaseMatters)) { ++ aContent->AsElement()->AttrValueIs(kNameSpaceID_None, ++ nsGkAtoms::checked, ++ nsGkAtoms::_true, eCaseMatters)) { + nsContentUtils::AddScriptRunner( + new nsMenuItemUncheckSiblingsRunnable(this)); + } @@ -3104,8 +3003,6 @@ new file mode 100644 +{ + return eType_MenuItem; +} -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 @@ @@ -3190,11 +3087,9 @@ new file mode 100644 +}; + +#endif /* __nsMenuItem_h__ */ -diff --git a/widget/gtk/nsMenuObject.cpp b/widget/gtk/nsMenuObject.cpp -new file mode 100644 --- /dev/null +++ b/widget/gtk/nsMenuObject.cpp -@@ -0,0 +1,666 @@ +@@ -0,0 +1,669 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -3376,8 +3271,9 @@ new file mode 100644 + imgRequestProxy *imageRequest = nullptr; + + nsAutoString uriString; -+ if (mOwner->ContentNode()->GetAttr(kNameSpaceID_None, nsGkAtoms::image, -+ uriString)) { ++ if (mOwner->ContentNode()->AsElement()->GetAttr(kNameSpaceID_None, ++ nsGkAtoms::image, ++ uriString)) { + NS_NewURI(getter_AddRefs(uri), uriString); + } else { + nsIPresShell *shell = doc->GetShell(); @@ -3540,10 +3436,11 @@ new file mode 100644 + // label="_Foo__Bar" for dbusmenu + + nsAutoString label; -+ mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, label); ++ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::label, label); + + nsAutoString accesskey; -+ mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, accesskey); ++ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, ++ accesskey); + + const nsAutoString::char_type *akey = accesskey.BeginReading(); + char16_t keyLower = ToLowerCase(*akey); @@ -3595,15 +3492,15 @@ new file mode 100644 + int target = MAX_WIDTH - GetEllipsisWidth(); + length = label.Length(); + -+ static nsIContent::AttrValuesArray strings[] = { ++ static mozilla::dom::Element::AttrValuesArray strings[] = { + &nsGkAtoms::left, &nsGkAtoms::start, + &nsGkAtoms::center, &nsGkAtoms::right, + &nsGkAtoms::end, nullptr + }; + -+ int32_t type = mContent->FindAttrValueIn(kNameSpaceID_None, -+ nsGkAtoms::crop, -+ strings, eCaseMatters); ++ int32_t type = mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, ++ nsGkAtoms::crop, ++ strings, eCaseMatters); + + switch (type) { + case 0: @@ -3649,9 +3546,10 @@ new file mode 100644 +void +nsMenuObject::UpdateSensitivity() +{ -+ bool disabled = mContent->AttrValueIs(kNameSpaceID_None, -+ nsGkAtoms::disabled, -+ nsGkAtoms::_true, eCaseMatters); ++ bool disabled = mContent->AsElement()->AttrValueIs(kNameSpaceID_None, ++ nsGkAtoms::disabled, ++ nsGkAtoms::_true, ++ eCaseMatters); + + dbusmenu_menuitem_property_set_bool(mNativeData, + DBUSMENU_MENUITEM_PROP_ENABLED, @@ -3861,8 +3759,6 @@ new file mode 100644 + weak = weak->mPrev; + } +} -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 @@ @@ -4035,8 +3931,6 @@ new file mode 100644 +}; + +#endif /* __nsMenuObject_h__ */ -diff --git a/widget/gtk/nsMenuSeparator.cpp b/widget/gtk/nsMenuSeparator.cpp -new file mode 100644 --- /dev/null +++ b/widget/gtk/nsMenuSeparator.cpp @@ -0,0 +1,85 @@ @@ -4125,8 +4019,6 @@ new file mode 100644 +{ + return eType_MenuItem; +} -diff --git a/widget/gtk/nsMenuSeparator.h b/widget/gtk/nsMenuSeparator.h -new file mode 100644 --- /dev/null +++ b/widget/gtk/nsMenuSeparator.h @@ -0,0 +1,37 @@ @@ -4167,8 +4059,6 @@ new file mode 100644 +}; + +#endif /* __nsMenuSeparator_h__ */ -diff --git a/widget/gtk/nsNativeMenuAtomList.h b/widget/gtk/nsNativeMenuAtomList.h -new file mode 100644 --- /dev/null +++ b/widget/gtk/nsNativeMenuAtomList.h @@ -0,0 +1,12 @@ @@ -4184,8 +4074,6 @@ new file mode 100644 +WIDGET_ATOM2(_moz_nativemenupopupstate, "_moz-nativemenupopupstate") +WIDGET_ATOM(openedwithkey) +WIDGET_ATOM(shellshowingmenubar) -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 @@ @@ -4228,8 +4116,6 @@ new file mode 100644 +{ + NS_RegisterStaticAtoms(sAtomSetup); +} -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 @@ @@ -4260,8 +4146,6 @@ new file mode 100644 +}; + +#endif /* __nsNativeMenuAtoms_h__ */ -diff --git a/widget/gtk/nsNativeMenuDocListener.cpp b/widget/gtk/nsNativeMenuDocListener.cpp -new file mode 100644 --- /dev/null +++ b/widget/gtk/nsNativeMenuDocListener.cpp @@ -0,0 +1,347 @@ @@ -4612,8 +4496,6 @@ new file mode 100644 + CancelFlush(this); + mPendingMutations.Clear(); +} -diff --git a/widget/gtk/nsNativeMenuDocListener.h b/widget/gtk/nsNativeMenuDocListener.h -new file mode 100644 --- /dev/null +++ b/widget/gtk/nsNativeMenuDocListener.h @@ -0,0 +1,152 @@ @@ -4769,8 +4651,6 @@ new file mode 100644 +}; + +#endif /* __nsNativeMenuDocListener_h__ */ -diff --git a/widget/gtk/nsNativeMenuService.cpp b/widget/gtk/nsNativeMenuService.cpp -new file mode 100644 --- /dev/null +++ b/widget/gtk/nsNativeMenuService.cpp @@ -0,0 +1,508 @@ @@ -5206,15 +5086,15 @@ new file mode 100644 + +NS_IMETHODIMP +nsNativeMenuService::CreateNativeMenuBar(nsIWidget *aParent, -+ nsIContent *aMenuBarNode) ++ mozilla::dom::Element *aMenuBarNode) +{ + NS_ENSURE_ARG(aParent); + NS_ENSURE_ARG(aMenuBarNode); + -+ if (aMenuBarNode->AttrValueIs(kNameSpaceID_None, -+ nsNativeMenuAtoms::_moz_menubarkeeplocal, -+ nsGkAtoms::_true, -+ eCaseMatters)) { ++ if (aMenuBarNode->AsElement()->AttrValueIs(kNameSpaceID_None, ++ nsNativeMenuAtoms::_moz_menubarkeeplocal, ++ nsGkAtoms::_true, ++ eCaseMatters)) { + return NS_OK; + } + @@ -5282,8 +5162,6 @@ new file mode 100644 + g_object_unref(cancellable); + } +} -diff --git a/widget/gtk/nsNativeMenuService.h b/widget/gtk/nsNativeMenuService.h -new file mode 100644 --- /dev/null +++ b/widget/gtk/nsNativeMenuService.h @@ -0,0 +1,84 @@ @@ -5323,7 +5201,7 @@ new file mode 100644 +public: + NS_DECL_ISUPPORTS + -+ NS_IMETHOD CreateNativeMenuBar(nsIWidget* aParent, nsIContent* aMenuBarNode) override; ++ NS_IMETHOD CreateNativeMenuBar(nsIWidget* aParent, mozilla::dom::Element* aMenuBarNode) override; + + // Returns the singleton addref'd for the service manager + static already_AddRefed<nsNativeMenuService> GetInstanceForServiceManager(); @@ -5371,36 +5249,9 @@ new file mode 100644 +}; + +#endif /* __nsNativeMenuService_h__ */ -diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp ---- a/widget/gtk/nsNativeThemeGTK.cpp -+++ b/widget/gtk/nsNativeThemeGTK.cpp -@@ -46,16 +46,17 @@ - # endif - #endif - - #include <algorithm> - #include <dlfcn.h> - - using namespace mozilla; - using namespace mozilla::gfx; -+using mozilla::widget::ScreenHelperGTK; - - NS_IMPL_ISUPPORTS_INHERITED(nsNativeThemeGTK, nsNativeTheme, nsITheme, - nsIObserver) - - static int gLastGdkError; - - nsNativeThemeGTK::nsNativeThemeGTK() - { -diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp --- a/widget/gtk/nsWidgetFactory.cpp +++ b/widget/gtk/nsWidgetFactory.cpp -@@ -44,16 +44,18 @@ - #include "nsImageToPixbuf.h" - #include "nsPrintDialogGTK.h" - - #if defined(MOZ_X11) - #include "nsIdleServiceGTK.h" +@@ -47,6 +47,8 @@ #include "GfxInfoX11.h" #endif @@ -5409,17 +5260,7 @@ diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp #include "nsNativeThemeGTK.h" #include "HeadlessThemeGTK.h" - #include "nsIComponentRegistrar.h" - #include "nsComponentManagerUtils.h" - #include "mozilla/gfx/2D.h" - #include "mozilla/widget/ScreenManager.h" - #include <gtk/gtk.h> -@@ -117,16 +119,19 @@ nsNativeThemeGTKConstructor(nsISupports - namespace mozilla { - namespace widget { - // This constructor should really be shared with all platforms. - NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxInfo, Init) - } +@@ -114,6 +116,9 @@ } #endif @@ -5428,18 +5269,8 @@ diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp + #ifdef NS_PRINTING NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecGTK) - NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsGTK, Init) - NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrinterEnumeratorGTK) - NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSession, Init) - NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintDialogServiceGTK, Init) - #endif - -@@ -241,16 +246,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 - NS_DEFINE_NAMED_CID(NS_IMAGE_TO_PIXBUF_CID); - #if defined(MOZ_X11) + NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSettingsServiceGTK, Init) +@@ -226,6 +231,7 @@ NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID); NS_DEFINE_NAMED_CID(NS_GFXINFO_CID); #endif @@ -5447,17 +5278,7 @@ diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp static const mozilla::Module::CIDEntry kWidgetCIDs[] = { - { &kNS_WINDOW_CID, false, nullptr, nsWindowConstructor }, - { &kNS_CHILD_CID, false, nullptr, nsWindowConstructor }, - { &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 }, -@@ -276,16 +282,17 @@ static const mozilla::Module::CIDEntry k - { &kNS_DEVICE_CONTEXT_SPEC_CID, false, nullptr, nsDeviceContextSpecGTKConstructor }, - { &kNS_PRINTDIALOGSERVICE_CID, false, nullptr, nsPrintDialogServiceGTKConstructor }, - #endif - { &kNS_IMAGE_TO_PIXBUF_CID, false, nullptr, nsImageToPixbufConstructor }, - #if defined(MOZ_X11) +@@ -261,6 +267,7 @@ { &kNS_IDLE_SERVICE_CID, false, nullptr, nsIdleServiceGTKConstructor }, { &kNS_GFXINFO_CID, false, nullptr, mozilla::widget::GfxInfoConstructor }, #endif @@ -5465,17 +5286,7 @@ diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp { nullptr } }; - static const mozilla::Module::ContractIDEntry kWidgetContracts[] = { - { "@mozilla.org/widget/window/gtk;1", &kNS_WINDOW_CID }, - { "@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 }, -@@ -313,16 +320,17 @@ static const mozilla::Module::ContractID - { "@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID }, - { NS_PRINTDIALOGSERVICE_CONTRACTID, &kNS_PRINTDIALOGSERVICE_CID }, - #endif - { "@mozilla.org/widget/image-to-gdk-pixbuf;1", &kNS_IMAGE_TO_PIXBUF_CID }, - #if defined(MOZ_X11) +@@ -298,6 +305,7 @@ { "@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID }, { "@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID }, #endif @@ -5483,20 +5294,9 @@ diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp { nullptr } }; - static void - nsWidgetGtk2ModuleDtor() - { - // Shutdown all XP level widget classes. - WidgetUtils::Shutdown(); -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp -@@ -68,16 +68,17 @@ - - #ifdef MOZ_ENABLE_STARTUP_NOTIFICATION - #define SN_API_NOT_YET_FROZEN - #include <startup-notification-1.0/libsn/sn.h> - #endif +@@ -67,6 +67,7 @@ #include "mozilla/Assertions.h" #include "mozilla/Likely.h" @@ -5504,18 +5304,8 @@ diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp #include "mozilla/Preferences.h" #include "nsIPrefService.h" #include "nsIGConfService.h" - #include "nsIServiceManager.h" - #include "nsGfxCIID.h" - #include "nsGtkUtils.h" - #include "nsIObserverService.h" - #include "mozilla/layers/LayersTypes.h" -@@ -5123,16 +5124,21 @@ nsWindow::HideWindowChrome(bool aShouldH - // and GetWindowPos is called) - #ifdef MOZ_X11 - XSync(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()) , False); - #else - gdk_flush (); - #endif /* MOZ_X11 */ +@@ -5065,6 +5066,11 @@ + SetWindowDecoration(aShouldHide ? eBorderStyle_none : mBorderStyle); } +void @@ -5526,20 +5316,9 @@ diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp bool nsWindow::CheckForRollup(gdouble aMouseX, gdouble aMouseY, bool aIsWheel, bool aAlwaysRollup) - { - nsIRollupListener* rollupListener = GetActiveRollupListener(); - nsCOMPtr<nsIWidget> rollupWidget; - if (rollupListener) { - rollupWidget = rollupListener->GetRollupWidget(); -diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h --- a/widget/gtk/nsWindow.h +++ b/widget/gtk/nsWindow.h -@@ -31,16 +31,18 @@ - #ifdef ACCESSIBILITY - #include "mozilla/a11y/Accessible.h" - #endif - #include "mozilla/EventForwards.h" - #include "mozilla/TouchEvents.h" +@@ -40,6 +40,8 @@ #include "IMContextWrapper.h" @@ -5548,17 +5327,7 @@ diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h #undef LOG #ifdef MOZ_LOGGING - #include "mozilla/Logging.h" - #include "nsTArray.h" - #include "Units.h" - - extern mozilla::LazyLogModule gWidgetLog; -@@ -154,16 +156,18 @@ public: - uint16_t aDuration, - nsISupports* aData, - nsIRunnable* aCallback) override; - virtual already_AddRefed<nsIScreen> GetWidgetScreen() override; - virtual nsresult MakeFullScreen(bool aFullScreen, +@@ -163,6 +165,8 @@ nsIScreen* aTargetScreen = nullptr) override; virtual void HideWindowChrome(bool aShouldHide) override; @@ -5567,40 +5336,18 @@ diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h /** * GetLastUserInputTime returns a timestamp for the most recent user input * event. This is intended for pointer grab requests (including drags). - */ - static guint32 GetLastUserInputTime(); - - // utility method, -1 if no change should be made, otherwise returns a - // value that can be passed to gdk_window_set_decorations -@@ -573,16 +577,19 @@ private: - * ancestor widget's instance. So, one set of IM contexts is created for - * 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. - */ - RefPtr<mozilla::widget::IMContextWrapper> mIMContext; +@@ -592,6 +596,8 @@ mozilla::UniquePtr<mozilla::CurrentX11TimeGetter> mCurrentTimeGetter; + static CSDSupportLevel sCSDSupportLevel; + + mozilla::UniquePtr<nsMenuBar> mMenuBar; -+ - typedef enum { CSD_SUPPORT_FULL, // CSD including shadows - CSD_SUPPORT_FLAT, // CSD without shadows - CSD_SUPPORT_NONE, // WM does not support CSD at all - CSD_SUPPORT_UNKNOWN - } CSDSupportLevel; - /** - * Get the support of Client Side Decoration by checking - * the XDG_CURRENT_DESKTOP environment variable. -diff --git a/widget/moz.build b/widget/moz.build + }; + + #endif /* __nsWindow_h__ */ --- a/widget/moz.build +++ b/widget/moz.build -@@ -59,19 +59,19 @@ if toolkit == 'windows': - elif toolkit == 'cocoa': - XPIDL_SOURCES += [ - 'nsIMacDockSupport.idl', - 'nsIMacWebAppUtils.idl', - 'nsIStandaloneNativeMenu.idl', +@@ -64,9 +64,9 @@ 'nsISystemStatusBar.idl', 'nsITaskbarProgress.idl', ] @@ -5613,20 +5360,9 @@ diff --git a/widget/moz.build b/widget/moz.build TEST_DIRS += ['tests'] - DIRS += ['headless'] - - # Don't build the DSO under the 'build' directory as windows does. - # - # The DSOs get built in the toolkit dir itself. Do this so that -diff --git a/xpfe/appshell/nsWebShellWindow.cpp b/xpfe/appshell/nsWebShellWindow.cpp --- a/xpfe/appshell/nsWebShellWindow.cpp +++ b/xpfe/appshell/nsWebShellWindow.cpp -@@ -70,17 +70,17 @@ - #include "mozilla/DebugOnly.h" - #include "mozilla/EventDispatcher.h" - #include "mozilla/MouseEvents.h" - - #include "nsPIWindowRoot.h" +@@ -75,7 +75,7 @@ #include "gfxPlatform.h" @@ -5635,8 +5371,14 @@ diff --git a/xpfe/appshell/nsWebShellWindow.cpp b/xpfe/appshell/nsWebShellWindow #include "nsINativeMenuService.h" #define USE_NATIVE_MENUS #endif +--- a/browser/base/content/browser.js ++++ b/browser/base/content/browser.js +@@ -5317,6 +5317,8 @@ + var firstMenuItem = aInsertPoint || popup.firstChild; - using namespace mozilla; - using namespace mozilla::dom; + let toolbarNodes = gNavToolbox.childNodes; ++ if (document.documentElement.getAttribute("shellshowingmenubar") == "true") ++ toolbarNodes = toolbarNodes.filter(node => node.id != "toolbar-menubar"); - /* Define Class IDs */ + for (let toolbar of toolbarNodes) { + if (!toolbar.hasAttribute("toolbarname")) { |