Merge remote-tracking branch 'origin/master' into custom

This commit is contained in:
roytam1 2021-03-25 09:26:26 +08:00
commit f9ded55f98
89 changed files with 168 additions and 3086 deletions

View file

@ -44,12 +44,6 @@ function init(aEvent)
document.getElementById("aboutVersion").textContent += " (" + buildDate + ")";
}
#ifdef XP_MACOSX
// it may not be sized at this point, and we need its width to calculate its position
window.sizeToContent();
window.moveTo((screen.availWidth / 2) - (window.outerWidth / 2), screen.availHeight / 5);
#endif
// get release notes URL from prefs
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);

View file

@ -15,20 +15,12 @@
%aboutDialogDTD;
]>
#ifdef XP_MACOSX
<?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
#endif
<window xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="PMaboutDialog"
windowtype="Browser:About"
onload="init(event);"
#ifdef XP_MACOSX
inwindowmenu="false"
#else
title="&aboutDialog.title;"
#endif
role="dialog"
aria-describedby="version distribution distributionId communityDesc contributeDesc trademark"
>
@ -83,8 +75,4 @@
<keyset>
<key keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
#ifdef XP_MACOSX
#include browserMountPoints.inc
#endif
</window>

View file

@ -450,13 +450,8 @@
var cancel = false;
// Catch any keys that could potentially move the caret. Ctrl can be
// used in combination with these keys on Windows and Linux; and Alt
// can be used on OS X, so make sure the unused one isn't used.
#ifdef XP_MACOSX
let metaKey = aEvent.ctrlKey;
#else
// used in combination with these keys on Windows and Linux.
let metaKey = aEvent.altKey;
#endif
if (!this.disableKeyNavigation && !metaKey) {
switch (aEvent.keyCode) {
case KeyEvent.DOM_VK_LEFT:
@ -494,11 +489,6 @@
cancel = this.mController.handleEscape();
break;
case KeyEvent.DOM_VK_RETURN:
#ifdef XP_MACOSX
// Prevent the default action, since it will beep on Mac
if (aEvent.metaKey)
aEvent.preventDefault();
#endif
this.mEnterEvent = aEvent;
if (this.mController.selection) {
this._selectionDetails = {
@ -509,19 +499,9 @@
cancel = this.handleEnter();
break;
case KeyEvent.DOM_VK_DELETE:
#ifdef XP_MACOSX
if (!aEvent.shiftKey) {
break;
}
#endif
cancel = this.handleDelete();
break;
case KeyEvent.DOM_VK_BACK_SPACE:
#ifdef XP_MACOSX
if (aEvent.shiftKey) {
cancel = this.handleDelete();
}
#endif
break;
case KeyEvent.DOM_VK_DOWN:
case KeyEvent.DOM_VK_UP:
@ -529,9 +509,7 @@
this.toggleHistoryPopup();
break;
case KeyEvent.DOM_VK_F4:
#ifndef XP_MACOSX
this.toggleHistoryPopup();
#endif
break;
}

View file

@ -16,22 +16,6 @@
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
#ifdef XP_MACOSX
<!-- nsMenuBarX hides these and uses them to build the Application menu.
When using Carbon widgets for Mac OS X widgets, some of these are not
used as they only apply to Cocoa widget builds. All version of Firefox
through Firefox 2 will use Carbon widgets. -->
<menupopup id="menu_ToolsPopup">
<menuitem id="menu_preferences" label="&preferencesCmdMac.label;" key="key_preferencesCmdMac" oncommand="openPreferences();"/>
<menuitem id="menu_mac_services" label="&servicesMenuMac.label;"/>
<menuitem id="menu_mac_hide_app" label="&hideThisAppCmdMac.label;" key="key_hideThisAppCmdMac"/>
<menuitem id="menu_mac_hide_others" label="&hideOtherAppsCmdMac.label;" key="key_hideOtherAppsCmdMac"/>
<menuitem id="menu_mac_show_all" label="&showAllAppsCmdMac.label;"/>
</menupopup>
<!-- Mac window menu -->
#include ../../../../toolkit/content/macWindowMenu.inc
#endif
#ifdef XP_WIN
<menu id="helpMenu"
label="&helpMenuWin.label;"
@ -47,11 +31,7 @@
onclick="checkForMiddleClick(this, event);"
label="&productHelp.label;"
accesskey="&productHelp.accesskey;"
#ifdef XP_MACOSX
key="key_openHelpMac"/>
#else
/>
#endif
<menuitem id="troubleShooting"
accesskey="&helpTroubleshootingInfo.accesskey;"
label="&helpTroubleshootingInfo.label;"
@ -89,22 +69,6 @@
</menu>
<keyset id="baseMenuKeyset">
#ifdef XP_MACOSX
<key id="key_openHelpMac"
oncommand="openHelpLink('firefox-osxkey');"
key="&helpMac.commandkey;"
modifiers="accel"/>
<!-- These are used to build the Application menu under Cocoa widgets -->
<key id="key_preferencesCmdMac"
key="&preferencesCmdMac.commandkey;"
modifiers="accel"/>
<key id="key_hideThisAppCmdMac"
key="&hideThisAppCmdMac.commandkey;"
modifiers="accel"/>
<key id="key_hideOtherAppsCmdMac"
key="&hideOtherAppsCmdMac.commandkey;"
modifiers="accel,alt"/>
#endif
</keyset>
<stringbundleset id="stringbundleset">

View file

@ -18,12 +18,6 @@ var FullScreen = {
fullscreenCommand.removeAttribute("checked");
}
#ifdef XP_MACOSX
// Make sure the menu items are adjusted.
document.getElementById("enterFullScreenItem").hidden = enterFS;
document.getElementById("exitFullScreenItem").hidden = !enterFS;
#endif
if (!this._fullScrToggler) {
this._fullScrToggler = document.getElementById("fullscr-toggler");
this._fullScrToggler.addEventListener("mouseover", this._expandCallback, false);
@ -456,10 +450,5 @@ XPCOMUtils.defineLazyGetter(FullScreen, "useLionFullScreen", function() {
// * on OS X
// * on Lion or higher (Darwin 11+)
// * have fullscreenbutton="true"
#ifdef XP_MACOSX
return parseFloat(Services.sysinfo.getProperty("version")) >= 11 &&
document.documentElement.getAttribute("fullscreenbutton") == "true";
#else
return false;
#endif
});

View file

@ -70,12 +70,10 @@
label="&printSetupCmd.label;"
accesskey="&printSetupCmd.accesskey;"
command="cmd_pageSetup"/>
#ifndef XP_MACOSX
<menuitem id="menu_printPreview"
label="&printPreviewCmd.label;"
accesskey="&printPreviewCmd.accesskey;"
command="cmd_printPreview"/>
#endif
<menuitem id="menu_print"
label="&printCmd.label;"
accesskey="&printCmd.accesskey;"
@ -96,13 +94,9 @@
#ifdef XP_WIN
label="&quitApplicationCmdWin.label;"
accesskey="&quitApplicationCmdWin.accesskey;"
#else
#ifdef XP_MACOSX
label="&quitApplicationCmdMac.label;"
#else
label="&quitApplicationCmd.label;"
accesskey="&quitApplicationCmd.accesskey;"
#endif
#ifdef XP_UNIX
key="key_quitApplication"
#endif
@ -215,11 +209,7 @@
label="&stopCmd.label;"
accesskey="&stopCmd.accesskey;"
command="Browser:Stop"
#ifdef XP_MACOSX
key="key_stop_mac"/>
#else
key="key_stop"/>
#endif
<menuitem id="menu_reload"
class="show-only-for-keyboard"
label="&reloadCmd.label;"
@ -276,30 +266,12 @@
</menu>
#include browser-charsetmenu.inc
<menuseparator/>
#ifdef XP_MACOSX
<menuitem id="enterFullScreenItem"
accesskey="&enterFullScreenCmd.accesskey;"
label="&enterFullScreenCmd.label;"
key="key_fullScreen">
<observes element="View:FullScreen" attribute="oncommand"/>
<observes element="View:FullScreen" attribute="disabled"/>
</menuitem>
<menuitem id="exitFullScreenItem"
accesskey="&exitFullScreenCmd.accesskey;"
label="&exitFullScreenCmd.label;"
key="key_fullScreen"
hidden="true">
<observes element="View:FullScreen" attribute="oncommand"/>
<observes element="View:FullScreen" attribute="disabled"/>
</menuitem>
#else
<menuitem id="fullScreenItem"
accesskey="&fullScreenCmd.accesskey;"
label="&fullScreenCmd.label;"
key="key_fullScreen"
type="checkbox"
observes="View:FullScreen"/>
#endif
<menuitem id="menu_showAllTabs"
hidden="true"
accesskey="&showAllTabsCmd.accesskey;"
@ -319,9 +291,7 @@
label="&historyMenu.label;"
accesskey="&historyMenu.accesskey;">
<menupopup id="goPopup"
#ifndef XP_MACOSX
placespopup="true"
#endif
context="placesContext"
oncommand="this.parentNode._placesView._onCommand(event);"
onclick="checkForMiddleClick(this, event);"
@ -332,21 +302,13 @@
<menuitem id="historyMenuBack"
class="show-only-for-keyboard"
label="&backCmd.label;"
#ifdef XP_MACOSX
key="goBackKb2"
#else
key="goBackKb"
#endif
command="Browser:BackOrBackDuplicate"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="historyMenuForward"
class="show-only-for-keyboard"
label="&forwardCmd.label;"
#ifdef XP_MACOSX
key="goForwardKb2"
#else
key="goForwardKb"
#endif
command="Browser:ForwardOrForwardDuplicate"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="historyMenuHome"
@ -359,15 +321,11 @@
class="show-only-for-keyboard"/>
<menuitem id="menu_showAllHistory"
label="&showAllHistoryCmd2.label;"
#ifndef XP_MACOSX
class="menuitem-iconic"
key="showAllHistoryKb"
#endif
command="Browser:ShowAllHistory"/>
<menuitem id="sanitizeItem"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&clearRecentHistory.label;"
key="key_sanitize"
command="Tools:Sanitize"/>
@ -387,9 +345,7 @@
label="&historyUndoMenu.label;"
disabled="true">
<menupopup id="historyUndoPopup"
#ifndef XP_MACOSX
placespopup="true"
#endif
onpopupshowing="document.getElementById('history-menu')._placesView.populateUndoSubmenu();"/>
</menu>
<menu id="historyUndoWindowMenu"
@ -397,9 +353,7 @@
label="&historyUndoWindowMenu.label;"
disabled="true">
<menupopup id="historyUndoWindowPopup"
#ifndef XP_MACOSX
placespopup="true"
#endif
onpopupshowing="document.getElementById('history-menu')._placesView.populateUndoWindowSubmenu();"/>
</menu>
<menuseparator id="startHistorySeparator"
@ -414,9 +368,7 @@
ondragover="PlacesMenuDNDHandler.onDragOver(event);"
ondrop="PlacesMenuDNDHandler.onDrop(event);">
<menupopup id="bookmarksMenuPopup"
#ifndef XP_MACOSX
placespopup="true"
#endif
context="placesContext"
openInTabs="children"
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
@ -426,32 +378,24 @@
new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');"
tooltip="bhTooltip" popupsinherittooltip="true">
<menuitem id="bookmarksShowAll"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&organizeBookmarks.label;"
command="Browser:ShowAllBookmarks"
key="manBookmarkKb"/>
<menuseparator id="organizeBookmarksSeparator"/>
<menuitem id="menu_bookmarkThisPage"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&bookmarkThisPageCmd.label;"
command="Browser:AddBookmarkAs"
key="addBookmarkAsKb"/>
<menuitem id="subscribeToPageMenuitem"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&subscribeToPageMenuitem.label;"
oncommand="return FeedHandler.subscribeToFeed(null, event);"
onclick="checkForMiddleClick(this, event);"
observes="singleFeedMenuitemState"/>
<menu id="subscribeToPageMenupopup"
#ifndef XP_MACOSX
class="menu-iconic"
#endif
label="&subscribeToPageMenupopup.label;"
observes="multipleFeedsMenuState">
<menupopup id="subscribeToPageSubmenuMenupopup"
@ -470,9 +414,7 @@
label="&personalbarCmd.label;"
container="true">
<menupopup id="bookmarksToolbarFolderPopup"
#ifndef XP_MACOSX
placespopup="true"
#endif
context="placesContext"
onpopupshowing="if (!this.parentNode._placesView)
new PlacesMenu(event, 'place:folder=TOOLBAR');"/>
@ -482,9 +424,7 @@
<menuseparator builder="end"
class="hide-if-empty-places-result"/>
<menuitem id="menu_unsortedBookmarks"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&unsortedBookmarksCmd.label;"
oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');"/>
</menupopup>
@ -560,9 +500,5 @@
oncommand="openPreferences();"/>
</menupopup>
</menu>
#ifdef XP_MACOSX
<menu id="windowMenu" />
#endif
<menu id="helpMenu" />
</menubar>

View file

@ -766,11 +766,7 @@ var BookmarksEventHandler = {
*/
onClick: function(aEvent, aView) {
// Only handle middle-click or left-click with modifiers.
#ifdef XP_MACOSX
var modifKey = aEvent.metaKey || aEvent.shiftKey;
#else
var modifKey = aEvent.ctrlKey || aEvent.shiftKey;
#endif
if (aEvent.button == 2 || (aEvent.button == 0 && !modifKey)) {
return;
}

View file

@ -4,9 +4,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifdef XP_UNIX
#ifndef XP_MACOSX
#define XP_GNOME 1
#endif
#endif
<stringbundleset id="stringbundleset">
@ -172,10 +170,8 @@
<key id="key_newNavigatorTab" key="&tabCmd.commandkey;" modifiers="accel" command="cmd_newNavigatorTab"/>
<key id="focusURLBar" key="&openCmd.commandkey;" command="Browser:OpenLocation"
modifiers="accel"/>
#ifndef XP_MACOSX
<key id="focusURLBar2" key="&urlbar.accesskey;" command="Browser:OpenLocation"
modifiers="alt"/>
#endif
#
# Search Command Key Logic works like this:
@ -195,9 +191,6 @@
# for people to switch to Linux.
#
<key id="key_search" key="&searchFocus.commandkey;" command="Tools:Search" modifiers="accel"/>
#ifdef XP_MACOSX
<key id="key_search2" key="&findOnCmd.commandkey;" command="Tools:Search" modifiers="accel,alt"/>
#endif
#ifdef XP_WIN
<key id="key_search2" key="&searchFocus.commandkey2;" command="Tools:Search" modifiers="accel"/>
#endif
@ -236,28 +229,17 @@
<key keycode="VK_BACK" command="cmd_handleBackspace"/>
<key keycode="VK_BACK" command="cmd_handleShiftBackspace" modifiers="shift"/>
#ifndef XP_MACOSX
<key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="alt"/>
<key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/>
#else
<key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="accel" />
<key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="accel" />
#endif
#ifdef XP_UNIX
<key id="goBackKb2" key="&goBackCmd.commandKey;" command="Browser:Back" modifiers="accel"/>
<key id="goForwardKb2" key="&goForwardCmd.commandKey;" command="Browser:Forward" modifiers="accel"/>
#endif
<key id="goHome" keycode="VK_HOME" command="Browser:Home" modifiers="alt"/>
<key keycode="VK_F5" command="Browser:Reload"/>
#ifndef XP_MACOSX
<key id="showAllHistoryKb" key="&showAllHistoryCmd.commandkey;" command="Browser:ShowAllHistory" modifiers="accel,shift"/>
<key keycode="VK_F5" command="Browser:ReloadSkipCache" modifiers="accel"/>
<key id="key_fullScreen" keycode="VK_F11" command="View:FullScreen"/>
#else
<key id="key_fullScreen" key="&fullScreenCmd.macCommandKey;" command="View:FullScreen" modifiers="accel,control"/>
<key id="key_fullScreen_old" key="&fullScreenCmd.macCommandKey;" command="View:FullScreen" modifiers="accel,shift"/>
<key keycode="VK_F11" command="View:FullScreen"/>
#endif
<key key="&reloadCmd.commandkey;" command="Browser:Reload" modifiers="accel" id="key_reload"/>
<key key="&reloadCmd.commandkey;" command="Browser:ReloadSkipCache" modifiers="accel,shift"/>
<key id="key_viewSource" key="&pageSourceCmd.commandkey;" command="View:PageSource" modifiers="accel"/>
@ -290,18 +272,10 @@
# networking requests, XHR, animated gifs, etc.
<key id="key_stop" keycode="VK_ESCAPE" command="Browser:Stop"/>
<key id="key_stop_all" keycode="VK_ESCAPE" modifiers="shift" oncommand="BrowserStop();"/>
#ifdef XP_MACOSX
<key id="key_stop_mac" modifiers="accel" key="&stopCmd.macCommandKey;" command="Browser:Stop"/>
<key id="key_stop_all_mac" modifiers="accel,shift" key="&stopCmd.macCommandKey;" oncommand="BrowserStop();"/>
#endif
<key id="key_gotoHistory"
key="&historySidebarCmd.commandKey;"
#ifdef XP_MACOSX
modifiers="accel,shift"
#else
modifiers="accel"
#endif
command="viewHistorySidebar"/>
<key id="key_fullZoomReduce" key="&fullZoomReduceCmd.commandkey;" command="cmd_fullZoomReduce" modifiers="accel"/>
@ -318,9 +292,6 @@
<key id="key_privatebrowsing" command="Tools:PrivateBrowsing" key="&privateBrowsingCmd.commandkey;" modifiers="accel,shift"/>
<key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
#ifdef XP_MACOSX
<key id="key_sanitize_mac" command="Tools:Sanitize" keycode="VK_BACK" modifiers="accel,shift"/>
#endif
#ifdef XP_UNIX
<key id="key_quitApplication" key="&quitApplicationCmdUnix.key;" command="cmd_quitApplication" modifiers="accel"/>
#endif
@ -351,7 +322,4 @@
</keyset>
# Used by baseMenuOverlay
#ifdef XP_MACOSX
<commandset id="baseMenuCommandSet" />
#endif
<keyset id="baseMenuKeyset" />

View file

@ -991,9 +991,6 @@ var allTabs = {
let container = this.container.getBoundingClientRect();
let tabCloseButton = this.tabCloseButton.getBoundingClientRect();
let alignLeft = getComputedStyle(this.panel, "").direction == "rtl";
#ifdef XP_MACOSX
alignLeft = !alignLeft;
#endif
this.tabCloseButton.left = canvas.left -
container.left +
parseInt(this.container.left) +

View file

@ -28,10 +28,6 @@
<handler event="mouseover" action="ctrlTab._mouseOverFocus(this);"/>
<handler event="command" action="ctrlTab.pick(this);"/>
<handler event="click" button="1" action="ctrlTab.remove(this);"/>
#ifdef XP_MACOSX
# Control+click is a right click on OS X
<handler event="click" button="2" action="ctrlTab.pick(this);"/>
#endif
</handlers>
</binding>

View file

@ -179,12 +179,6 @@ toolbar[mode="icons"] > #reload-button[displaystop] {
background-position: top right;
}
%ifdef XP_MACOSX
#main-window[inFullscreen="true"] {
padding-top: 0; /* override drawintitlebar="true" */
}
%endif
#browser-bottombox[lwthemefooter="true"] {
background-repeat: no-repeat;
background-position: bottom left;
@ -553,11 +547,7 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(#nav-bar):not(
.ctrlTab-favicon-container,
.allTabs-favicon-container {
-moz-box-align: start;
%ifdef XP_MACOSX
-moz-box-pack: end;
%else
-moz-box-pack: start;
%endif
}
.ctrlTab-favicon,

View file

@ -27,10 +27,7 @@ var gInPrintPreviewMode = false;
var gContextMenu = null; // nsContextMenu instance
var gMultiProcessBrowser = false;
#ifndef XP_MACOSX
var gEditUIVisible = true;
#endif
[
["gBrowser", "content"],
["gNavToolbox", "navigator-toolbox"],
@ -1206,12 +1203,10 @@ var gBrowserInit = {
// unless there are downloads to be displayed.
DownloadsButton.initializeIndicator();
#ifndef XP_MACOSX
updateEditUIVisibility();
let placesContext = document.getElementById("placesContext");
placesContext.addEventListener("popupshowing", updateEditUIVisibility, false);
placesContext.addEventListener("popuphiding", updateEditUIVisibility, false);
#endif
#ifdef MOZ_PERSONAS
gBrowser.mPanelContainer.addEventListener("InstallBrowserTheme", LightWeightThemeWebInstaller, false, true);
@ -1457,95 +1452,6 @@ var gBrowserInit = {
window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow = null;
},
#ifdef XP_MACOSX
// nonBrowserWindowStartup(), nonBrowserWindowDelayedStartup(), and
// nonBrowserWindowShutdown() are used for non-browser windows in
// macBrowserOverlay
nonBrowserWindowStartup: function() {
// Disable inappropriate commands / submenus
var disabledItems = ['Browser:SavePage',
'Browser:SendLink', 'cmd_pageSetup', 'cmd_print', 'cmd_find', 'cmd_findAgain',
'viewToolbarsMenu', 'viewSidebarMenuMenu', 'Browser:Reload',
'viewFullZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen',
'viewHistorySidebar', 'Browser:AddBookmarkAs', 'Browser:BookmarkAllTabs',
'View:PageInfo', 'Browser:ToggleAddonBar'];
var element;
for (let disabledItem of disabledItems) {
element = document.getElementById(disabledItem);
if (element) {
element.setAttribute("disabled", "true");
}
}
// If no windows are active (i.e. we're the hidden window), disable the close, minimize
// and zoom menu commands as well
if (window.location.href == "chrome://browser/content/hiddenWindow.xul") {
var hiddenWindowDisabledItems = ['cmd_close', 'minimizeWindow', 'zoomWindow'];
for (let hiddenWindowDisabledItem of hiddenWindowDisabledItems) {
element = document.getElementById(hiddenWindowDisabledItem);
if (element) {
element.setAttribute("disabled", "true");
}
}
// also hide the window-list separator
element = document.getElementById("sep-window-list");
element.setAttribute("hidden", "true");
// Setup the dock menu.
let dockMenuElement = document.getElementById("menu_mac_dockmenu");
if (dockMenuElement != null) {
let nativeMenu = Cc["@mozilla.org/widget/standalonenativemenu;1"]
.createInstance(Ci.nsIStandaloneNativeMenu);
try {
nativeMenu.init(dockMenuElement);
let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"]
.getService(Ci.nsIMacDockSupport);
dockSupport.dockMenu = nativeMenu;
} catch(e) {}
}
}
if (PrivateBrowsingUtils.permanentPrivateBrowsing) {
document.getElementById("macDockMenuNewWindow").hidden = true;
}
this._delayedStartupTimeoutId = setTimeout(this.nonBrowserWindowDelayedStartup.bind(this), 0);
},
nonBrowserWindowDelayedStartup: function() {
this._delayedStartupTimeoutId = null;
// initialise the offline listener
BrowserOffline.init();
// Set up Sanitize Item
this._initializeSanitizer();
// initialize the private browsing UI
gPrivateBrowsingUI.init();
#ifdef MOZ_SERVICES_SYNC
// initialize the sync UI
gSyncUI.init();
#endif
},
nonBrowserWindowShutdown: function() {
// If nonBrowserWindowDelayedStartup hasn't run yet, we have no work to do -
// just cancel the pending timeout and return;
if (this._delayedStartupTimeoutId) {
clearTimeout(this._delayedStartupTimeoutId);
return;
}
BrowserOffline.uninit();
},
#endif
_initializeSanitizer: function() {
const kDidSanitizeDomain = "privacy.sanitize.didShutdownSanitize";
if (gPrefService.prefHasUserValue(kDidSanitizeDomain)) {
@ -1597,11 +1503,6 @@ var gBrowserInit = {
/* Legacy global init functions */
var BrowserStartup = gBrowserInit.onLoad.bind(gBrowserInit);
var BrowserShutdown = gBrowserInit.onUnload.bind(gBrowserInit);
#ifdef XP_MACOSX
var nonBrowserWindowStartup = gBrowserInit.nonBrowserWindowStartup.bind(gBrowserInit);
var nonBrowserWindowDelayedStartup = gBrowserInit.nonBrowserWindowDelayedStartup.bind(gBrowserInit);
var nonBrowserWindowShutdown = gBrowserInit.nonBrowserWindowShutdown.bind(gBrowserInit);
#endif
function HandleAppCommandEvent(evt) {
switch (evt.command) {
@ -1738,11 +1639,7 @@ function BrowserStop() {
function BrowserReloadOrDuplicate(aEvent) {
var backgroundTabModifier = aEvent.button == 1 ||
#ifdef XP_MACOSX
aEvent.metaKey;
#else
aEvent.ctrlKey;
#endif
if (aEvent.shiftKey && !backgroundTabModifier) {
BrowserReloadSkipCache();
return;
@ -1801,13 +1698,6 @@ function BrowserGoHome(aEvent) {
}
function loadOneOrMoreURIs(aURIString) {
#ifdef XP_MACOSX
// we're not a browser window, pass the URI string to a new browser window
if (window.location.href != getBrowserURL()) {
window.openDialog(getBrowserURL(), "_blank", "all,dialog=no", aURIString);
return;
}
#endif
// This function throws for certain malformed URIs, so use exception handling
// so that we don't disrupt startup
try {
@ -1834,22 +1724,6 @@ function openLocation() {
return;
}
#ifdef XP_MACOSX
if (window.location.href != getBrowserURL()) {
var win = getTopWin();
if (win) {
// If there's an open browser window, it should handle this command
win.focus()
win.openLocation();
} else {
// If there are no open browser windows, open a new one
win = window.openDialog("chrome://browser/content/", "_blank",
"chrome,all,dialog=no", BROWSER_NEW_TAB_URL);
win.addEventListener("load", openLocationCallback, false);
}
return;
}
#endif
openDialog("chrome://browser/content/openLocation.xul", "_blank",
"chrome,modal,titlebar", window);
}
@ -1948,14 +1822,6 @@ function BrowserOpenFileWindow() {
}
function BrowserCloseTabOrWindow() {
#ifdef XP_MACOSX
// If we're not a browser window, just close the window
if (window.location.href != getBrowserURL()) {
closeWindow(true);
return;
}
#endif
// If the current tab is the last one, this will close the window.
gBrowser.removeCurrentTab({animate: true});
}
@ -3126,28 +2992,6 @@ const BrowserSearch = {
* or focuses an existing window, if necessary.
*/
webSearch: function() {
#ifdef XP_MACOSX
if (window.location.href != getBrowserURL()) {
var win = getTopWin();
if (win) {
// If there's an open browser window, it should handle this command
win.focus();
win.BrowserSearch.webSearch();
} else {
// If there are no open browser windows, open a new one
var observer = function observer(subject, topic, data) {
if (subject == win) {
BrowserSearch.webSearch();
Services.obs.removeObserver(observer, "browser-delayed-startup-finished");
}
}
win = window.openDialog(getBrowserURL(), "_blank",
"chrome,all,dialog=no", "about:blank");
Services.obs.addObserver(observer, "browser-delayed-startup-finished", false);
}
return;
}
#endif
var searchBar = this.searchBar;
if (searchBar && window.fullScreen) {
FullScreen.showNavToolbox();
@ -3469,9 +3313,7 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) {
gIdentityHandler._cacheElements();
window.XULBrowserWindow.init();
#ifndef XP_MACOSX
updateEditUIVisibility();
#endif
// Hacky: update the PopupNotifications' object's reference to the iconBox,
// if it already exists, since it may have changed if the URL bar was
@ -3576,7 +3418,6 @@ function retrieveToolbarIconsizesFromTheme() {
* is a no op.
*/
function updateEditUIVisibility() {
#ifndef XP_MACOSX
let editMenuPopupState = document.getElementById("menu_EditPopup").state;
let contextMenuPopupState = document.getElementById("contentAreaContextMenu").state;
let placesContextMenuPopupState = document.getElementById("placesContext").state;
@ -3618,7 +3459,6 @@ function updateEditUIVisibility() {
goSetCommandEnabled("cmd_delete", true);
goSetCommandEnabled("cmd_switchTextDirection", true);
}
#endif
}
/**
@ -6272,14 +6112,7 @@ function warnAboutClosingWindow() {
os.notifyObservers(null, "browser-lastwindow-close-granted", null);
#ifdef XP_MACOSX
// OS X doesn't quit the application when the last window is closed, but keeps
// the session alive. Hence don't prompt users to save tabs, but warn about
// closing multiple tabs.
return isPBWindow || gBrowser.warnAboutClosingTabs(gBrowser.closingTabsEnum.ALL);
#else
return true;
#endif
}
var MailIntegration = {
@ -7086,12 +6919,6 @@ var gPrivateBrowsingUI = {
document.getElementById("Tools:Sanitize").setAttribute("disabled", "true");
if (window.location.href == getBrowserURL()) {
#if defined(XP_MACOSX) && defined(MOZ_CAN_DRAW_IN_TITLEBAR)
if (!PrivateBrowsingUtils.permanentPrivateBrowsing) {
document.documentElement.setAttribute("drawintitlebar", true);
}
#endif
// Adjust the window's title
let docElement = document.documentElement;
if (!PrivateBrowsingUtils.permanentPrivateBrowsing) {
@ -7562,9 +7389,6 @@ var ToolbarIconColor = {
}
let toolbarSelector = "toolbar:not([collapsed=true])";
#ifdef XP_MACOSX
toolbarSelector += ":not([type=menubar])";
#endif
// The getComputedStyle calls and setting the brighttext are separated in
// two loops to avoid flushing layout and making it dirty repeatedly.

View file

@ -40,18 +40,10 @@
onload="gBrowserInit.onLoad()" onunload="gBrowserInit.onUnload()" onclose="return WindowIsClosing();"
title="&mainWindow.title;"
title_normal="&mainWindow.title;"
#ifdef XP_MACOSX
title_privatebrowsing="&mainWindow.title;&mainWindow.titlemodifiermenuseparator;&mainWindow.titlePrivateBrowsingSuffix;"
titledefault="&mainWindow.title;"
titlemodifier=""
titlemodifier_normal=""
titlemodifier_privatebrowsing="&mainWindow.titlePrivateBrowsingSuffix;"
#else
title_privatebrowsing="&mainWindow.titlemodifier; &mainWindow.titlePrivateBrowsingSuffix;"
titlemodifier="&mainWindow.titlemodifier;"
titlemodifier_normal="&mainWindow.titlemodifier;"
titlemodifier_privatebrowsing="&mainWindow.titlemodifier; &mainWindow.titlePrivateBrowsingSuffix;"
#endif
titlemenuseparator="&mainWindow.titlemodifiermenuseparator;"
#ifdef MOZ_PERSONAS
lightweightthemes="true"
@ -302,20 +294,12 @@
<tooltip id="back-button-tooltip">
<label class="tooltip-label" value="&backButton.tooltip;"/>
#ifdef XP_MACOSX
<label class="tooltip-label" value="&backForwardButtonMenuMac.tooltip;"/>
#else
<label class="tooltip-label" value="&backForwardButtonMenu.tooltip;"/>
#endif
</tooltip>
<tooltip id="forward-button-tooltip">
<label class="tooltip-label" value="&forwardButton.tooltip;"/>
#ifdef XP_MACOSX
<label class="tooltip-label" value="&backForwardButtonMenuMac.tooltip;"/>
#else
<label class="tooltip-label" value="&backForwardButtonMenu.tooltip;"/>
#endif
</tooltip>
#include popup-notifications.inc
@ -336,9 +320,7 @@
</button>
</hbox>
#endif
#ifndef XP_MACOSX
<spacer id="titlebar-spacer" flex="1"/>
#endif
<hbox id="titlebar-buttonbox-container" align="start">
<hbox id="titlebar-buttonbox">
<toolbarbutton class="titlebar-button" id="titlebar-min" oncommand="window.minimize();"/>
@ -581,32 +563,24 @@
label="&viewBookmarksToolbar.label;"/>
<menuseparator/>
<menuitem id="BMB_bookmarksShowAll"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&organizeBookmarks.label;"
command="Browser:ShowAllBookmarks"
key="manBookmarkKb"/>
<menuseparator/>
<menuitem id="BMB_bookmarkThisPage"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&bookmarkThisPageCmd.label;"
command="Browser:AddBookmarkAs"
key="addBookmarkAsKb"/>
<menuitem id="BMB_subscribeToPageMenuitem"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&subscribeToPageMenuitem.label;"
oncommand="return FeedHandler.subscribeToFeed(null, event);"
onclick="checkForMiddleClick(this, event);"
observes="singleFeedMenuitemState"/>
<menu id="BMB_subscribeToPageMenupopup"
#ifndef XP_MACOSX
class="menu-iconic"
#endif
label="&subscribeToPageMenupopup.label;"
observes="multipleFeedsMenuState">
<menupopup id="BMB_subscribeToPageSubmenuMenupopup"
@ -658,15 +632,11 @@
popupsinherittooltip="true">
<menuitem id="HMB_showAllHistory"
label="&showAllHistoryCmd2.label;"
#ifndef XP_MACOSX
class="menuitem-iconic"
key="showAllHistoryKb"
#endif
command="Browser:ShowAllHistory"/>
<menuitem id="HMB_sanitizeItem"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&clearRecentHistory.label;"
key="key_sanitize"
command="Tools:Sanitize"/>
@ -1012,28 +982,6 @@
</svg:clipPath>
</svg:svg>
#endif
#ifdef XP_MACOSX
<svg:svg height="0">
<svg:clipPath id="osx-keyhole-forward-clip-path" clipPathUnits="objectBoundingBox">
<svg:path d="M 0,0 C 0.15,0.12 0.25,0.3 0.25,0.5 0.25,0.7 0.15,0.88 0,1 L 1,1 1,0 0,0 z"/>
</svg:clipPath>
<svg:clipPath id="osx-urlbar-back-button-clip-path" clipPathUnits="userSpaceOnUse">
<svg:path d="m 0,-5 0,4.03 C 3.6,1.8 6,6.1 6,11 6,16 3.6,20 0,23 l 0,27 10000,0 0,-55 L 0,-5 z"/>
</svg:clipPath>
<svg:clipPath id="osx-tab-ontop-left-curve-clip-path" clipPathUnits="userSpaceOnUse">
<svg:path d="M 9,0 C 7.3,0 6,1.3 6,3 l 0,14 c 0,3 -2.2,5 -5,5 l -1,0 0,1 12,0 0,-1 0,-19 0,-3 -3,0 z"/>
</svg:clipPath>
<svg:clipPath id="osx-tab-ontop-right-curve-clip-path" clipPathUnits="userSpaceOnUse">
<svg:path d="m 0,0 0,3 0,19 0,1 12,0 0,-1 -1,0 C 8.2,22 6,20 6,17 L 6,3 C 6,1.3 4.7,0 3,0 L 0,0 z"/>
</svg:clipPath>
<svg:clipPath id="osx-tab-onbottom-left-curve-clip-path" clipPathUnits="userSpaceOnUse">
<svg:path d="m 0,0 0,1 1,0 c 2.8,0 5,2.2 5,5 l 0,14 c 0,2 1.3,3 3,3 l 3,0 0,-3 L 12,1 12,0 0,0 z"/>
</svg:clipPath>
<svg:clipPath id="osx-tab-onbottom-right-curve-clip-path" clipPathUnits="userSpaceOnUse">
<svg:path d="m 0,0 0,1 0,19 0,3 3,0 c 1.7,0 3,-1 3,-3 L 6,6 C 6,3.2 8.2,1 11,1 L 12,1 12,0 0,0 z"/>
</svg:clipPath>
</svg:svg>
#endif
</vbox>
# <iframe id="tab-view"> is dynamically appended as the 2nd child of #tab-view-deck.

View file

@ -5,15 +5,3 @@
# 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/.
#ifdef XP_MACOSX
<?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
<window id="main-window"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
#include browserMountPoints.inc
</window>
#endif

View file

@ -986,26 +986,10 @@ nsContextMenu.prototype = {
// Confirm since it's annoying if you hit this accidentally.
const kDesktopBackgroundURL = "chrome://browser/content/setDesktopBackground.xul";
#ifdef XP_MACOSX
// On Mac, the Set Desktop Background window is not modal.
// Don't open more than one Set Desktop Background window.
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var dbWin = wm.getMostRecentWindow("Shell:SetDesktopBackground");
if (dbWin) {
dbWin.gSetBackground.init(this.target);
dbWin.focus();
} else {
openDialog(kDesktopBackgroundURL, "",
"centerscreen,chrome,dialog=no,dependent,resizable=no",
this.target);
}
#else
// On non-Mac platforms, the Set Wallpaper dialog is modal.
// The Set Wallpaper dialog is modal.
openDialog(kDesktopBackgroundURL, "",
"centerscreen,chrome,dialog,modal,dependent",
this.target);
#endif
},
// Save URL of clicked-on frame.

View file

@ -476,11 +476,7 @@ Sanitizer.__defineGetter__("prefs", function() {
Sanitizer.showUI = function(aParentWindow) {
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher);
#ifdef XP_MACOSX
ww.openWindow(null, // make this an app-modal window on Mac
#else
ww.openWindow(aParentWindow,
#endif
"chrome://browser/content/sanitize.xul",
"Sanitize",
"chrome,titlebar,dialog,centerscreen,modal",

View file

@ -113,11 +113,7 @@
new Map();
</field>
<field name="arrowKeysShouldWrap" readonly="true">
#ifdef XP_MACOSX
true
#else
false
#endif
</field>
<field name="_autoScrollPopup">
@ -3151,22 +3147,6 @@
}
}
#ifdef XP_MACOSX
if (!aEvent.metaKey)
return;
var offset = 1;
switch (aEvent.charCode) {
case '}'.charCodeAt(0):
offset = -1;
case '{'.charCodeAt(0):
if (window.getComputedStyle(this, null).direction == "ltr")
offset *= -1;
this.tabContainer.advanceSelectedTab(offset, true);
aEvent.stopPropagation();
aEvent.preventDefault();
}
#else
if (aEvent.ctrlKey && !aEvent.shiftKey && !aEvent.metaKey &&
aEvent.keyCode == KeyEvent.DOM_VK_F4 &&
!this.mCurrentTab.pinned) {
@ -3174,7 +3154,6 @@
aEvent.stopPropagation();
aEvent.preventDefault();
}
#endif
]]></body>
</method>
@ -3612,9 +3591,7 @@
</xul:hbox>
<xul:arrowscrollbox anonid="arrowscrollbox" orient="horizontal" flex="1"
style="min-width: 1px;"
#ifndef XP_MACOSX
clicktoscroll="true"
#endif
class="tabbrowser-arrowscrollbox">
# This is a hack to circumvent bug 472020, otherwise the tabs show up on the
# right of the newtab button.
@ -4300,11 +4277,7 @@
PrivateBrowsingUtils.isWindowPrivate(sourceNode.ownerDocument.defaultView))
return dt.effectAllowed = "none";
#ifdef XP_MACOSX
return dt.effectAllowed = event.altKey ? "copy" : "move";
#else
return dt.effectAllowed = event.ctrlKey ? "copy" : "move";
#endif
}
}
@ -4462,14 +4435,12 @@
]]></handler>
<handler event="dblclick"><![CDATA[
#ifndef XP_MACOSX
// When the tabbar has an unified appearance with the titlebar
// and menubar, a double-click in it should have the same behavior
// as double-clicking the titlebar
if (TabsInTitlebar.enabled ||
(TabsOnTop.enabled && this.parentNode._dragBindingAlive))
return;
#endif
if (event.button != 0 ||
event.originalTarget.localName != "box")
@ -4559,11 +4530,7 @@
<handler event="keypress"><![CDATA[
if (event.altKey || event.shiftKey ||
#ifdef XP_MACOSX
!event.metaKey)
#else
!event.ctrlKey || event.metaKey)
#endif
return;
switch (event.keyCode) {

View file

@ -375,11 +375,7 @@
// and only if we get a keyboard event, to match user expectations.
if (/^\s*[^.:\/\s]+(?:\/.*|\s*)$/i.test(url) &&
(aTriggeringEvent instanceof KeyEvent)) {
#ifdef XP_MACOSX
let accel = aTriggeringEvent.metaKey;
#else
let accel = aTriggeringEvent.ctrlKey;
#endif
let shift = aTriggeringEvent.shiftKey;
let suffix = "";

View file

@ -167,11 +167,7 @@ function whereToOpenLink(e, ignoreButton, ignoreAlt) {
// Don't do anything special with right-mouse clicks. They're probably clicks on context menu items.
#ifdef XP_MACOSX
if (meta || (middle && middleUsesTabs)) {
#else
if (ctrl || (middle && middleUsesTabs)) {
#endif
return shift ? "tabshifted" : "tab";
}
@ -664,7 +660,6 @@ function buildHelpMenu() {
}
}
#else
#ifndef XP_MACOSX
// Some extensions may rely on these being present so only hide the about
// separator when there are no elements besides the check for updates menuitem
// in between the about separator and the updates separator.
@ -676,7 +671,6 @@ function buildHelpMenu() {
updatesSeparator.hidden = true;
}
#endif
#endif
}
@ -691,8 +685,6 @@ function openAboutDialog() {
#ifdef XP_WIN
var features = "chrome,centerscreen,dependent";
#elifdef XP_MACOSX
var features = "chrome,resizable=no,minimizable=no";
#else
var features = "chrome,centerscreen,dependent,dialog=no";
#endif

View file

@ -16,10 +16,6 @@
</window>
<menubar id="viewSource-main-menubar">
#ifdef XP_MACOSX
<menu id="windowMenu"/>
<menupopup id="menu_ToolsPopup"/>
#endif
<menu id="helpMenu"/>
</menubar>