--- a/firefox-kde.patch Mon Oct 22 11:26:41 2018 +0200
+++ b/firefox-kde.patch Sun Mar 17 10:00:10 2019 +0100
@@ -1,11 +1,11 @@
# HG changeset patch
-# Parent fdf78810e83396d10418791fbe32bed6bfe1558b
+# Parent 693f0baece29cc958a7d91b89fd12e3b89a502e3
diff --git a/browser/base/content/browser-kde.xul b/browser/base/content/browser-kde.xul
new file mode 100644
--- /dev/null
+++ b/browser/base/content/browser-kde.xul
-@@ -0,0 +1,1317 @@
+@@ -0,0 +1,1395 @@
+#filter substitution
+<?xml version="1.0"?>
+# -*- Mode: HTML -*-
@@ -19,6 +19,12 @@
+ both "content" and "skin" packages, which bug 1385444 will unify later. -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+
++<!-- While these stylesheets are defined in Toolkit, they are only used in the
++ main browser window, so we can load them here. Bug 1474241 is on file to
++ consider moving these widgets to the "browser" folder. -->
++<?xml-stylesheet href="chrome://global/content/tabprompts.css" type="text/css"?>
++<?xml-stylesheet href="chrome://global/skin/tabprompts.css" type="text/css"?>
++
+<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
+<?xml-stylesheet href="chrome://browser/content/tabbrowser.css" type="text/css"?>
+<?xml-stylesheet href="chrome://browser/content/downloads/downloads.css" type="text/css"?>
@@ -72,7 +78,12 @@
+ fullscreenbutton="true"
+ sizemode="normal"
+ retargetdocumentfocus="urlbar"
-+ persist="screenX screenY width height sizemode">
++ persist="screenX screenY width height sizemode"
++#ifdef BROWSER_XHTML
++ hidden="true"
++ mozpersist=""
++#endif
++ >
+
+# All JS files which are needed by browser.xul and other top level windows to
+# support MacOS specific features *must* go into the global-scripts.inc file so
@@ -85,14 +96,34 @@
+#endif
+>
+ Services.scriptloader.loadSubScript("chrome://global/content/contentAreaUtils.js", this);
++ Services.scriptloader.loadSubScript("chrome://browser/content/browser-captivePortal.js", this);
++ Services.scriptloader.loadSubScript("chrome://browser/content/browser-compacttheme.js", this);
++ Services.scriptloader.loadSubScript("chrome://browser/content/browser-contentblocking.js", this);
++#ifdef MOZ_DATA_REPORTING
++ Services.scriptloader.loadSubScript("chrome://browser/content/browser-data-submission-info-bar.js", this);
++#endif
++#ifndef MOZILLA_OFFICIAL
++ Services.scriptloader.loadSubScript("chrome://browser/content/browser-development-helpers.js", this);
++#endif
++ Services.scriptloader.loadSubScript("chrome://browser/content/browser-media.js", this);
++ Services.scriptloader.loadSubScript("chrome://browser/content/browser-pageActions.js", this);
++ Services.scriptloader.loadSubScript("chrome://browser/content/browser-plugins.js", this);
++ Services.scriptloader.loadSubScript("chrome://browser/content/browser-sidebar.js", this);
++ Services.scriptloader.loadSubScript("chrome://browser/content/browser-tabsintitlebar.js", this);
+ Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser.js", this);
++ Services.scriptloader.loadSubScript("chrome://browser/content/search/searchbar.js", this);
+
+ window.onload = gBrowserInit.onLoad.bind(gBrowserInit);
+ window.onunload = gBrowserInit.onUnload.bind(gBrowserInit);
+ window.onclose = WindowIsClosing;
++
+#ifdef BROWSER_XHTML
-+ window.addEventListener("DOMContentLoaded",
-+ gBrowserInit.onBeforeInitialXULLayout.bind(gBrowserInit), { once: true });
++ window.addEventListener("readystatechange", () => {
++ // We initially hide the window to prevent layouts during parse. This lets us
++ // avoid accidental XBL construction and better match browser.xul (see Bug 1497975).
++ gBrowserInit.onBeforeInitialXULLayout();
++ document.documentElement.removeAttribute("hidden");
++ }, { once: true, capture: true });
+#else
+ window.addEventListener("MozBeforeInitialXULLayout",
+ gBrowserInit.onBeforeInitialXULLayout.bind(gBrowserInit), { once: true });
@@ -116,13 +147,12 @@
+ onpopuphidden="if (event.target == this) TabContextMenu.contextTab = null;">
+ <menuitem id="context_reloadTab" label="&reloadTab.label;" accesskey="&reloadTab.accesskey;"
+ oncommand="gBrowser.reloadTab(TabContextMenu.contextTab);"/>
-+ <menuitem id="context_reloadSelectedTabs" label="&reloadSelectedTabs.label;" hidden="true"
-+ accesskey="&reloadSelectedTabs.accesskey;"
++ <menuitem id="context_reloadSelectedTabs" label="&reloadTabs.label;" hidden="true"
++ accesskey="&reloadTabs.accesskey;"
+ oncommand="gBrowser.reloadMultiSelectedTabs();"/>
+ <menuitem id="context_toggleMuteTab" oncommand="TabContextMenu.contextTab.toggleMuteAudio();"/>
+ <menuitem id="context_toggleMuteSelectedTabs" hidden="true"
+ oncommand="gBrowser.toggleMuteAudioOnMultiSelectedTabs(TabContextMenu.contextTab);"/>
-+ <menuseparator/>
+ <menuitem id="context_pinTab" label="&pinTab.label;"
+ accesskey="&pinTab.accesskey;"
+ oncommand="gBrowser.pinTab(TabContextMenu.contextTab);"/>
@@ -138,6 +168,21 @@
+ <menuitem id="context_duplicateTab" label="&duplicateTab.label;"
+ accesskey="&duplicateTab.accesskey;"
+ oncommand="duplicateTabIn(TabContextMenu.contextTab, 'tab');"/>
++ <menuitem id="context_duplicateTabs" label="&duplicateTabs.label;"
++ accesskey="&duplicateTabs.accesskey;"
++ oncommand="TabContextMenu.duplicateSelectedTabs();"/>
++ <menuseparator/>
++ <menuitem id="context_selectAllTabs" label="&selectAllTabs.label;" accesskey="&selectAllTabs.accesskey;"
++ oncommand="gBrowser.selectAllTabs();"/>
++ <menuitem id="context_bookmarkSelectedTabs"
++ hidden="true"
++ label="&bookmarkSelectedTabs.label;"
++ accesskey="&bookmarkSelectedTabs.accesskey;"
++ oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueSelectedPages);"/>
++ <menuitem id="context_bookmarkTab"
++ label="&bookmarkTab.label;"
++ accesskey="&bookmarkTab.accesskey;"
++ oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.getUniquePages([TabContextMenu.contextTab]));"/>
+ <menu id="context_reopenInContainer"
+ label="&reopenInContainer.label;"
+ accesskey="&reopenInContainer.accesskey;"
@@ -145,43 +190,46 @@
+ <menupopup oncommand="TabContextMenu.reopenInContainer(event);"
+ onpopupshowing="TabContextMenu.createReopenInContainerMenu(event);"/>
+ </menu>
-+ <menuitem id="context_openTabInWindow" label="&moveToNewWindow.label;"
-+ accesskey="&moveToNewWindow.accesskey;"
-+ tbattr="tabbrowser-multiple"
-+ oncommand="gBrowser.replaceTabsWithWindow(TabContextMenu.contextTab);"/>
-+ <menuseparator id="context_sendTabToDevice_separator" class="sync-ui-item"/>
-+ <menu id="context_sendTabToDevice" label="&sendTabToDevice.label;"
-+ class="sync-ui-item"
-+ accesskey="&sendTabToDevice.accesskey;">
++ <menu id="context_moveTabOptions"
++ multiselectcontextlabel="&moveSelectedTabOptions.label;"
++ multiselectcontextaccesskey="&moveSelectedTabOptions.accesskey;"
++ nonmultiselectcontextlabel="&moveTabOptions.label;"
++ nonmultiselectcontextaccesskey="&moveTabOptions.accesskey;">
++ <menupopup id="moveTabOptionsMenu">
++ <menuitem id="context_moveToStart"
++ label="&moveToStart.label;"
++ accesskey="&moveToStart.accesskey;"
++ tbattr="tabbrowser-multiple"
++ oncommand="gBrowser.moveTabsToStart(TabContextMenu.contextTab);"/>
++ <menuitem id="context_moveToEnd"
++ label="&moveToEnd.label;"
++ accesskey="&moveToEnd.accesskey;"
++ tbattr="tabbrowser-multiple"
++ oncommand="gBrowser.moveTabsToEnd(TabContextMenu.contextTab);"/>
++ <menuitem id="context_openTabInWindow" label="&moveToNewWindow.label;"
++ accesskey="&moveToNewWindow.accesskey;"
++ tbattr="tabbrowser-multiple"
++ oncommand="gBrowser.replaceTabsWithWindow(TabContextMenu.contextTab);"/>
++ </menupopup>
++ </menu>
++ <menu id="context_sendTabToDevice"
++ class="sync-ui-item">
+ <menupopup id="context_sendTabToDevicePopupMenu"
-+ onpopupshowing="gSync.populateSendTabToDevicesMenu(event.target, TabContextMenu.contextTab.linkedBrowser.currentURI.spec, TabContextMenu.contextTab.linkedBrowser.contentTitle);"/>
++ onpopupshowing="gSync.populateSendTabToDevicesMenu(event.target, TabContextMenu.contextTab.linkedBrowser.currentURI.spec, TabContextMenu.contextTab.linkedBrowser.contentTitle, TabContextMenu.contextTab.multiselected);"/>
+ </menu>
+ <menuseparator/>
-+ <menuitem id="context_reloadAllTabs" label="&reloadAllTabs.label;" accesskey="&reloadAllTabs.accesskey;"
-+ tbattr="tabbrowser-multiple-visible"
-+ oncommand="gBrowser.reloadAllTabs();"/>
-+ <menuitem id="context_bookmarkSelectedTabs"
-+ hidden="true"
-+ label="&bookmarkSelectedTabs.label;"
-+ accesskey="&bookmarkSelectedTabs.accesskey;"
-+ oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueSelectedPages);"/>
-+ <menuitem id="context_bookmarkAllTabs"
-+ label="&bookmarkAllTabs.label;"
-+ accesskey="&bookmarkAllTabs.accesskey;"
-+ command="Browser:BookmarkAllTabs"/>
+ <menuitem id="context_closeTabsToTheEnd" label="&closeTabsToTheEnd.label;" accesskey="&closeTabsToTheEnd.accesskey;"
+ oncommand="gBrowser.removeTabsToTheEndFrom(TabContextMenu.contextTab, {animate: true});"/>
+ <menuitem id="context_closeOtherTabs" label="&closeOtherTabs.label;" accesskey="&closeOtherTabs.accesskey;"
+ oncommand="gBrowser.removeAllTabsBut(TabContextMenu.contextTab);"/>
-+ <menuseparator/>
+ <menuitem id="context_undoCloseTab"
+ label="&undoCloseTab.label;"
+ accesskey="&undoCloseTab.accesskey;"
+ observes="History:UndoCloseTab"/>
+ <menuitem id="context_closeTab" label="&closeTab.label;" accesskey="&closeTab.accesskey;"
+ oncommand="gBrowser.removeTab(TabContextMenu.contextTab, { animate: true });"/>
-+ <menuitem id="context_closeSelectedTabs" label="&closeSelectedTabs.label;"
-+ hidden="true" accesskey="&closeSelectedTabs.accesskey;"
++ <menuitem id="context_closeSelectedTabs" label="&closeTabs.label;"
++ hidden="true" accesskey="&closeTabs.accesskey;"
+ oncommand="gBrowser.removeMultiSelectedTabs();"/>
+ </menupopup>
+
@@ -222,8 +270,27 @@
+ level="parent"
+ overflowpadding="15" />
+
-+ <!-- for date/time picker. consumeoutsideclicks is set to never, so that
-+ clicks on the anchored input box are never consumed. -->
++ <!-- for url bar autocomplete -->
++ <panel id="urlbar-results"
++ role="group"
++ noautofocus="true"
++ hidden="true"
++ flip="none"
++ level="parent">
++ <html:div class="urlbarView-body-outer">
++ <html:div class="urlbarView-body-inner">
++ <!-- TODO: add search suggestions notification -->
++ <html:div class="urlbarView-results"/>
++ </html:div>
++ </html:div>
++ <hbox class="search-one-offs"
++ compact="true"
++ includecurrentengine="true"
++ disabletab="true"/>
++ </panel>
++
++ <!-- for date/time picker. consumeoutsideclicks is set to never, so that
++ clicks on the anchored input box are never consumed. -->
+ <panel id="DateTimePickerPanel"
+ type="arrow"
+ hidden="true"
@@ -277,6 +344,7 @@
+ oncommand="StarUI.onShowForNewBookmarksCheckboxCommand();"/>
+ </vbox>
+ <hbox id="editBookmarkPanelBottomButtons"
++ class="panel-footer"
+ style="min-width: &editBookmark.panel.width;;">
+#ifdef XP_UNIX
+ <button id="editBookmarkPanelDoneButton"
@@ -374,43 +442,60 @@
+ </panel>
+
+ <menupopup id="toolbar-context-menu"
-+ onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('viewToolbarsMenuSeparator')); UpdateDownloadsAutoHide(this); UpdateManageExtension(this)">
-+ <menuitem oncommand="openAboutAddonsForContextAction(this.parentElement)"
++ onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('viewToolbarsMenuSeparator')); ToolbarContextMenu.updateDownloadsAutoHide(this); ToolbarContextMenu.updateExtension(this)">
++ <menuitem oncommand="ToolbarContextMenu.openAboutAddonsForContextAction(this.parentElement)"
+ accesskey="&customizeMenu.manageExtension.accesskey;"
+ label="&customizeMenu.manageExtension.label;"
+ contexttype="toolbaritem"
+ class="customize-context-manageExtension"/>
++ <menuitem oncommand="ToolbarContextMenu.removeExtensionForContextAction(this.parentElement)"
++ accesskey="&customizeMenu.removeExtension.accesskey;"
++ label="&customizeMenu.removeExtension.label;"
++ contexttype="toolbaritem"
++ class="customize-context-removeExtension"/>
+ <menuseparator/>
+ <menuitem oncommand="gCustomizeMode.addToPanel(document.popupNode)"
+ accesskey="&customizeMenu.pinToOverflowMenu.accesskey;"
+ label="&customizeMenu.pinToOverflowMenu.label;"
+ contexttype="toolbaritem"
+ class="customize-context-moveToPanel"/>
-+ <menuitem oncommand="onDownloadsAutoHideChange(event)"
++ <menuitem id="toolbar-context-autohide-downloads-button"
++ oncommand="ToolbarContextMenu.onDownloadsAutoHideChange(event);"
+ type="checkbox"
+ accesskey="&customizeMenu.autoHideDownloadsButton.accesskey;"
+ label="&customizeMenu.autoHideDownloadsButton.label;"
-+ contexttype="toolbaritem"
-+ class="customize-context-autoHide"/>
++ contexttype="toolbaritem"/>
+ <menuitem oncommand="gCustomizeMode.removeFromArea(document.popupNode)"
+ accesskey="&customizeMenu.removeFromToolbar.accesskey;"
+ label="&customizeMenu.removeFromToolbar.label;"
+ contexttype="toolbaritem"
+ class="customize-context-removeFromToolbar"/>
-+ <menuitem id="toolbar-context-reloadAllTabs"
-+ class="toolbaritem-tabsmenu"
++ <menuitem id="toolbar-context-reloadSelectedTab"
++ contexttype="tabbar"
++ oncommand="gBrowser.reloadMultiSelectedTabs();"
++ label="&toolbarContextMenu.reloadSelectedTab.label;"
++ accesskey="&toolbarContextMenu.reloadSelectedTab.accesskey;"/>
++ <menuitem id="toolbar-context-reloadSelectedTabs"
++ contexttype="tabbar"
++ oncommand="gBrowser.reloadMultiSelectedTabs();"
++ label="&toolbarContextMenu.reloadSelectedTabs.label;"
++ accesskey="&toolbarContextMenu.reloadSelectedTabs.accesskey;"/>
++ <menuitem id="toolbar-context-bookmarkSelectedTab"
+ contexttype="tabbar"
-+ oncommand="gBrowser.reloadAllTabs();"
-+ label="&toolbarContextMenu.reloadAllTabs.label;"
-+ accesskey="&toolbarContextMenu.reloadAllTabs.accesskey;"/>
-+ <menuitem id="toolbar-context-bookmarkAllTabs"
-+ class="toolbaritem-tabsmenu"
++ oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueSelectedPages);"
++ label="&toolbarContextMenu.bookmarkSelectedTab.label;"
++ accesskey="&toolbarContextMenu.bookmarkSelectedTab.accesskey;"/>
++ <menuitem id="toolbar-context-bookmarkSelectedTabs"
+ contexttype="tabbar"
-+ command="Browser:BookmarkAllTabs"
-+ label="&toolbarContextMenu.bookmarkAllTabs.label;"
-+ accesskey="&toolbarContextMenu.bookmarkAllTabs.accesskey;"/>
++ oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueSelectedPages);"
++ label="&toolbarContextMenu.bookmarkSelectedTabs.label;"
++ accesskey="&toolbarContextMenu.bookmarkSelectedTabs.accesskey;"/>
++ <menuitem id="toolbar-context-selectAllTabs"
++ contexttype="tabbar"
++ oncommand="gBrowser.selectAllTabs();"
++ label="&toolbarContextMenu.selectAllTabs.label;"
++ accesskey="&toolbarContextMenu.selectAllTabs.accesskey;"/>
+ <menuitem id="toolbar-context-undoCloseTab"
-+ class="toolbaritem-tabsmenu"
+ contexttype="tabbar"
+ label="&toolbarContextMenu.undoCloseTab.label;"
+ accesskey="&toolbarContextMenu.undoCloseTab.accesskey;"
@@ -496,7 +581,6 @@
+ noautofocus="true"
+ copyURL-title="&pageAction.copyLink.label;"
+ emailLink-title="&emailPageCmd.label;"
-+ sendToDevice-title="&pageAction.sendTabToDevice.label;"
+ sendToDevice-notReadyTitle="&sendToDevice.syncNotReady.label;"
+ shareURL-title="&pageAction.shareUrl.label;"
+ shareMore-label="&pageAction.shareMore.label;">
@@ -534,10 +618,10 @@
+ label="&pageAction.removeFromUrlbar.label;"
+ oncommand="BrowserPageActions.togglePinningForContextAction();"/>
+ <menuitem class="pageActionContextMenuItem extensionUnpinned"
-+ label="&pageAction.allowInUrlbar.label;"
++ label="&pageAction.addToUrlbar.label;"
+ oncommand="BrowserPageActions.togglePinningForContextAction();"/>
+ <menuitem class="pageActionContextMenuItem extensionPinned"
-+ label="&pageAction.disallowInUrlbar.label;"
++ label="&pageAction.removeFromUrlbar.label;"
+ oncommand="BrowserPageActions.togglePinningForContextAction();"/>
+ <menuseparator class="pageActionContextMenuItem extensionPinned extensionUnpinned"/>
+ <menuitem class="pageActionContextMenuItem extensionPinned extensionUnpinned"
@@ -550,20 +634,20 @@
+ <tooltip id="tabbrowser-tab-tooltip" onpopupshowing="gBrowser.createTooltip(event);"/>
+
+ <tooltip id="back-button-tooltip">
-+ <label class="tooltip-label" value="&backButton.tooltip;"/>
++ <description class="tooltip-label" value="&backButton.tooltip;"/>
+#ifdef XP_MACOSX
-+ <label class="tooltip-label" value="&backForwardButtonMenuMac.tooltip;"/>
++ <description class="tooltip-label" value="&backForwardButtonMenuMac.tooltip;"/>
+#else
-+ <label class="tooltip-label" value="&backForwardButtonMenu.tooltip;"/>
++ <description class="tooltip-label" value="&backForwardButtonMenu.tooltip;"/>
+#endif
+ </tooltip>
+
+ <tooltip id="forward-button-tooltip">
-+ <label class="tooltip-label" value="&forwardButton.tooltip;"/>
++ <description class="tooltip-label" value="&forwardButton.tooltip;"/>
+#ifdef XP_MACOSX
-+ <label class="tooltip-label" value="&backForwardButtonMenuMac.tooltip;"/>
++ <description class="tooltip-label" value="&backForwardButtonMenuMac.tooltip;"/>
+#else
-+ <label class="tooltip-label" value="&backForwardButtonMenu.tooltip;"/>
++ <description class="tooltip-label" value="&backForwardButtonMenu.tooltip;"/>
+#endif
+ </tooltip>
+
@@ -655,110 +739,101 @@
+ </popupset>
+ <box id="appMenu-viewCache" hidden="true"/>
+
-+<vbox id="titlebar">
-+ <hbox id="titlebar-content">
-+ <spacer id="titlebar-spacer" flex="1"/>
-+ <hbox id="titlebar-buttonbox-container">
-+ <hbox id="titlebar-buttonbox" class="titlebar-color">
-+ <toolbarbutton class="titlebar-button" id="titlebar-min" oncommand="window.minimize();"/>
-+ <toolbarbutton class="titlebar-button" id="titlebar-max" oncommand="onTitlebarMaxClick();"/>
-+ <toolbarbutton class="titlebar-button" id="titlebar-close" command="cmd_closeWindow"/>
-+ </hbox>
-+ </hbox>
-+#ifdef XP_MACOSX
-+ <!-- OS X does not natively support RTL for its titlebar items, so we prevent this secondary
-+ buttonbox from reversing order in RTL by forcing an LTR direction. -->
-+ <hbox id="titlebar-secondary-buttonbox" dir="ltr">
-+ <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/>
-+ <hbox class="private-browsing-indicator"/>
-+ <hbox id="titlebar-fullscreen-button"/>
-+ </hbox>
++ <toolbox id="navigator-toolbox">
++
++ <vbox id="titlebar">
++ <!-- Menu -->
++ <toolbar type="menubar" id="toolbar-menubar"
++ class="browser-toolbar chromeclass-menubar titlebar-color"
++ customizable="true"
++ mode="icons"
++#ifdef MENUBAR_CAN_AUTOHIDE
++ toolbarname="&menubarCmd.label;"
++ accesskey="&menubarCmd.accesskey;"
++ autohide="true"
+#endif
-+ </hbox>
-+</vbox>
-+
-+ <toolbox id="navigator-toolbox">
-+ <!-- Menu -->
-+ <toolbar type="menubar" id="toolbar-menubar"
-+ class="browser-toolbar chromeclass-menubar titlebar-color"
-+ customizable="true"
-+ mode="icons"
-+#ifdef MENUBAR_CAN_AUTOHIDE
-+ toolbarname="&menubarCmd.label;"
-+ accesskey="&menubarCmd.accesskey;"
-+ autohide="true"
-+#endif
-+ context="toolbar-context-menu">
-+ <toolbaritem id="menubar-items" align="center">
++ context="toolbar-context-menu">
++ <toolbaritem id="menubar-items" align="center">
+# The entire main menubar is placed into browser-menubar.inc, so that it can be
+# shared with other top level windows in macWindow.inc.xul.
+#include browser-menubar.inc
-+ </toolbaritem>
++ </toolbaritem>
++ <spacer flex="1" skipintoolbarset="true" ordinal="1000"/>
++#include titlebar-items.inc.xul
++ </toolbar>
++
++ <toolbar id="TabsToolbar"
++ class="browser-toolbar titlebar-color"
++ fullscreentoolbar="true"
++ customizable="true"
++ customizationtarget="TabsToolbar-customization-target"
++ mode="icons"
++ aria-label="&tabsToolbar.label;"
++ context="toolbar-context-menu"
++ flex="1">
++ <vbox flex="1" class="toolbar-items">
++ <spacer flex="1000"/>
++
++ <hbox id="TabsToolbar-customization-target" flex="1">
++ <hbox class="titlebar-spacer" type="pre-tabs"
++ skipintoolbarset="true"/>
++
++ <tabs id="tabbrowser-tabs"
++ flex="1"
++ setfocus="false"
++ tooltip="tabbrowser-tab-tooltip"
++ stopwatchid="FX_TAB_CLICK_MS">
++ <tab class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/>
++ </tabs>
++
++ <toolbarbutton id="new-tab-button"
++ class="toolbarbutton-1 chromeclass-toolbar-additional"
++ label="&tabCmd.label;"
++ command="cmd_newNavigatorTab"
++ onclick="checkForMiddleClick(this, event);"
++ tooltip="dynamic-shortcut-tooltip"
++ ondrop="newTabButtonObserver.onDrop(event)"
++ ondragover="newTabButtonObserver.onDragOver(event)"
++ ondragenter="newTabButtonObserver.onDragOver(event)"
++ ondragexit="newTabButtonObserver.onDragExit(event)"
++ cui-areatype="toolbar"
++ removable="true"/>
++
++ <toolbarbutton id="alltabs-button"
++ class="toolbarbutton-1 chromeclass-toolbar-additional tabs-alltabs-button badged-button"
++ oncommand="gTabsPanel.showAllTabsPanel();"
++ label="&listAllTabs.label;"
++ tooltiptext="&listAllTabs.label;"
++ removable="false"/>
++
++ <hbox class="titlebar-spacer" type="post-tabs"
++ ordinal="1000"
++ skipintoolbarset="true"/>
++ </hbox>
++ </vbox>
+
+#ifndef XP_MACOSX
-+ <hbox class="titlebar-placeholder" type="caption-buttons" ordinal="1000"
-+ skipintoolbarset="true"/>
++ <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;"
++ ordinal="1000"
++ aria-live="polite" skipintoolbarset="true"/>
++ <hbox class="private-browsing-indicator" skipintoolbarset="true"
++ ordinal="1000"/>
+#endif
-+ </toolbar>
-+
-+ <toolbar id="TabsToolbar"
-+ class="browser-toolbar titlebar-color"
-+ fullscreentoolbar="true"
-+ customizable="true"
-+ mode="icons"
-+ aria-label="&tabsToolbar.label;"
-+ context="toolbar-context-menu">
-+ <hbox class="titlebar-placeholder" type="pre-tabs"
-+ skipintoolbarset="true"/>
-+
-+ <tabs id="tabbrowser-tabs"
-+ flex="1"
-+ setfocus="false"
-+ tooltip="tabbrowser-tab-tooltip"
-+ stopwatchid="FX_TAB_CLICK_MS">
-+ <tab class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/>
-+ </tabs>
+
-+ <toolbarbutton id="new-tab-button"
-+ class="toolbarbutton-1 chromeclass-toolbar-additional"
-+ label="&tabCmd.label;"
-+ command="cmd_newNavigatorTab"
-+ onclick="checkForMiddleClick(this, event);"
-+ tooltip="dynamic-shortcut-tooltip"
-+ ondrop="newTabButtonObserver.onDrop(event)"
-+ ondragover="newTabButtonObserver.onDragOver(event)"
-+ ondragenter="newTabButtonObserver.onDragOver(event)"
-+ ondragexit="newTabButtonObserver.onDragExit(event)"
-+ cui-areatype="toolbar"
-+ removable="true"/>
-+
-+ <toolbarbutton id="alltabs-button"
-+ class="toolbarbutton-1 chromeclass-toolbar-additional tabs-alltabs-button badged-button"
-+ oncommand="gTabsPanel.showAllTabsPanel();"
-+ label="&listAllTabs.label;"
-+ tooltiptext="&listAllTabs.label;"
-+ removable="false"/>
-+
-+ <hbox class="titlebar-placeholder" type="post-tabs"
-+ ordinal="1000"
-+ skipintoolbarset="true"/>
-+
-+ <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;"
-+ ordinal="1000"
-+ aria-live="polite" skipintoolbarset="true"/>
-+ <hbox class="private-browsing-indicator" skipintoolbarset="true"
-+ ordinal="1000"/>
-+ <hbox class="titlebar-placeholder" type="caption-buttons"
-+#ifndef XP_MACOSX
-+ ordinal="1000"
-+#endif
-+ skipintoolbarset="true"/>
++#include titlebar-items.inc.xul
+
+#ifdef XP_MACOSX
-+ <hbox class="titlebar-placeholder" type="fullscreen-button"
-+ skipintoolbarset="true"/>
++ <!-- OS X does not natively support RTL for its titlebar items, so we prevent this secondary
++ buttonbox from reversing order in RTL by forcing an LTR direction. -->
++ <hbox id="titlebar-secondary-buttonbox" dir="ltr">
++ <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/>
++ <hbox class="private-browsing-indicator"/>
++ <hbox id="titlebar-fullscreen-button"/>
++ </hbox>
+#endif
-+ </toolbar>
++ </toolbar>
++
++ </vbox>
+
+ <toolbar id="nav-bar"
+ class="browser-toolbar"
@@ -817,7 +892,7 @@
+ ondrop="homeButtonObserver.onDrop(event)"
+ ondragexit="homeButtonObserver.onDragExit(event)"
+ key="goHome"
-+ onclick="BrowserGoHome(event);"
++ onclick="BrowserHome(event);"
+ cui-areatype="toolbar"
+ tooltiptext="&homeButton.defaultPage.tooltip;"/>
+ <toolbarspring cui-areatype="toolbar" class="chromeclass-toolbar-additional"/>
@@ -926,6 +1001,8 @@
+ tooltiptext="&urlbar.midiNotificationAnchor.tooltip;"/>
+ <image id="webauthn-notification-icon" class="notification-anchor-icon" role="button"
+ tooltiptext="&urlbar.webAuthnAnchor.tooltip;"/>
++ <image id="storage-access-notification-icon" class="notification-anchor-icon storage-access-icon" role="button"
++ tooltiptext="&urlbar.storageAccessAnchor.tooltip;"/>
+ </box>
+ <image id="connection-icon"/>
+ <image id="extension-icon"/>
@@ -1064,6 +1141,10 @@
+ tooltiptext="&fullScreenClose.tooltip;"
+ oncommand="BrowserTryToCloseWindow();"/>
+ </hbox>
++
++ <box id="library-animatable-box" class="toolbarbutton-animatable-box">
++ <image class="toolbarbutton-animatable-image"/>
++ </box>
+ </toolbar>
+
+ <toolbar id="PersonalToolbar"
@@ -1245,9 +1326,6 @@
+ <searchbar id="searchbar" flex="1"/>
+ </toolbaritem>
+ </toolbarpalette>
-+ <box id="library-animatable-box" class="toolbarbutton-animatable-box">
-+ <image class="toolbarbutton-animatable-image"/>
-+ </box>
+ </toolbox>
+
+ <hbox id="fullscr-toggler" hidden="true"/>
@@ -1276,7 +1354,7 @@
+
+ <splitter id="sidebar-splitter" class="chromeclass-extrachrome sidebar-splitter" hidden="true"/>
+ <vbox id="appcontent" flex="1">
-+ <notificationbox id="high-priority-global-notificationbox" notificationside="top"/>
++ <!-- gHighPriorityNotificationBox will be added here lazily. -->
+ <tabbox id="tabbrowser-tabbox"
+ flex="1" tabcontainer="tabbrowser-tabs">
+ <tabpanels id="tabbrowser-tabpanels"
@@ -1319,7 +1397,7 @@
+ </html:div>
+
+ <vbox id="browser-bottombox" layer="true">
-+ <notificationbox id="global-notificationbox" notificationside="bottom"/>
++ <!-- gNotificationBox will be added here lazily. -->
+ </vbox>
+
+</window>
@@ -1367,7 +1445,7 @@
#if defined(XP_WIN)
#include "nsIEHistoryEnumerator.h"
-@@ -34,18 +34,16 @@ using namespace mozilla::browser;
+@@ -33,18 +33,16 @@ using namespace mozilla::browser;
/////////////////////////////////////////////////////////////////////////////
@@ -1386,11 +1464,11 @@
#if defined(XP_WIN)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEHistoryEnumerator)
-@@ -70,17 +68,17 @@ NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID)
- NS_DEFINE_NAMED_CID(NS_MACATTRIBUTIONSERVICE_CID);
+@@ -67,17 +65,17 @@ NS_DEFINE_NAMED_CID(NS_MACATTRIBUTIONSER
#endif
static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
+ // clang-format off
{ &kNS_BROWSERDIRECTORYPROVIDER_CID, false, nullptr, DirectoryProviderConstructor },
#if defined(XP_WIN)
{ &kNS_SHELLSERVICE_CID, false, nullptr, nsWindowsShellServiceConstructor },
@@ -1398,17 +1476,17 @@
- { &kNS_SHELLSERVICE_CID, false, nullptr, nsGNOMEShellServiceConstructor },
+ { &kNS_SHELLSERVICE_CID, false, nullptr, nsUnixShellServiceConstructor },
#endif
- { &kNS_FEEDSNIFFER_CID, false, nullptr, nsFeedSnifferConstructor },
{ &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, nullptr, AboutRedirector::Create },
#if defined(XP_WIN)
{ &kNS_WINIEHISTORYENUMERATOR_CID, false, nullptr, nsIEHistoryEnumeratorConstructor },
#elif defined(XP_MACOSX)
{ &kNS_SHELLSERVICE_CID, false, nullptr, nsMacShellServiceConstructor },
#endif
+ #if defined(MOZ_WIDGET_COCOA)
diff --git a/browser/components/preferences/in-content/main.js b/browser/components/preferences/in-content/main.js
--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
-@@ -327,16 +327,23 @@ var gMainPane = {
+@@ -289,16 +289,23 @@ var gMainPane = {
this._backoffIndex++ : backoffTimes.length - 1]);
};
@@ -1432,7 +1510,7 @@
performanceSettingsLink.setAttribute("href", performanceSettingsUrl);
this.updateDefaultPerformanceSettingsPref();
-@@ -962,16 +969,27 @@ var gMainPane = {
+@@ -1012,16 +1019,27 @@ var gMainPane = {
// Reset exponential backoff delay time in order to do visual update in pollForDefaultBrowser.
this._backoffIndex = 0;
@@ -1486,7 +1564,7 @@
new file mode 100644
--- /dev/null
+++ b/browser/components/shell/nsKDEShellService.cpp
-@@ -0,0 +1,204 @@
+@@ -0,0 +1,153 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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
@@ -1640,57 +1718,6 @@
+ return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
+}
+
-+NS_IMETHODIMP
-+nsKDEShellService::GetDefaultFeedReader(nsIFile** _retval)
-+{
-+ *_retval = nullptr;
-+
-+ nsCOMPtr<nsIMutableArray> command = do_CreateInstance( NS_ARRAY_CONTRACTID );
-+ if( !command )
-+ return NS_ERROR_FAILURE;
-+
-+ nsCOMPtr<nsISupportsCString> str = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
-+ if( !str )
-+ return NS_ERROR_FAILURE;
-+
-+ str->SetData( NS_LITERAL_CSTRING( "GETDEFAULTFEEDREADER" ));
-+ command->AppendElement( str );
-+
-+ nsCOMPtr<nsIArray> output;
-+ if( !nsKDEUtils::command( command, getter_AddRefs( output ) ) )
-+ return NS_ERROR_FAILURE;
-+
-+ PRUint32 length;
-+ output->GetLength( &length );
-+ if( length != 1 )
-+ return NS_ERROR_FAILURE;
-+
-+ nsCOMPtr<nsISupportsCString> resstr = do_QueryElementAt( output, 0 );
-+ if( !resstr )
-+ return NS_ERROR_FAILURE;
-+
-+ nsAutoCString path;
-+ resstr->GetData( path );
-+ if (path.IsEmpty())
-+ return NS_ERROR_FAILURE;
-+
-+ nsresult rv;
-+ nsCOMPtr<nsIFile> defaultReader =
-+ do_CreateInstance("@mozilla.org/file/local;1", &rv);
-+ NS_ENSURE_SUCCESS(rv, rv);
-+
-+ rv = defaultReader->InitWithNativePath(path);
-+ NS_ENSURE_SUCCESS(rv, rv);
-+
-+ bool exists;
-+ rv = defaultReader->Exists(&exists);
-+ NS_ENSURE_SUCCESS(rv, rv);
-+ if (!exists)
-+ return NS_ERROR_FAILURE;
-+
-+ NS_ADDREF(*_retval = defaultReader);
-+ return NS_OK;
-+}
diff --git a/browser/components/shell/nsKDEShellService.h b/browser/components/shell/nsKDEShellService.h
new file mode 100644
--- /dev/null
@@ -1776,7 +1803,7 @@
diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
-@@ -462,16 +462,18 @@
+@@ -451,16 +451,18 @@
@RESPATH@/browser/defaults/settings/pinning
@RESPATH@/browser/defaults/settings/main