Skip to content

Commit 03a482b

Browse files
committed
Merge mozilla-central to mozilla-inbound.
2 parents e1f96f9 + e1e8f2e commit 03a482b

File tree

263 files changed

+6205
-2101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+6205
-2101
lines changed

Cargo.lock

Lines changed: 13 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

browser/base/content/browser.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
* License, v. 2.0. If a copy of the MPL was not distributed with this
44
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
55

6-
/* eslint-env mozilla/browser-window */
7-
/* globals StatusPanel */
8-
96
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
107
ChromeUtils.import("resource://gre/modules/Services.jsm");
118
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");

browser/base/content/browser.xul

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,20 @@ xmlns="http://www.w3.org/1999/xhtml"
8888
#endif
8989
>
9090
Services.scriptloader.loadSubScript("chrome://global/content/contentAreaUtils.js", this);
91+
Services.scriptloader.loadSubScript("chrome://browser/content/browser-captivePortal.js", this);
92+
Services.scriptloader.loadSubScript("chrome://browser/content/browser-compacttheme.js", this);
93+
Services.scriptloader.loadSubScript("chrome://browser/content/browser-contentblocking.js", this);
94+
#ifdef MOZ_DATA_REPORTING
95+
Services.scriptloader.loadSubScript("chrome://browser/content/browser-data-submission-info-bar.js", this);
96+
#endif
97+
#ifndef MOZILLA_OFFICIAL
98+
Services.scriptloader.loadSubScript("chrome://browser/content/browser-development-helpers.js", this);
99+
#endif
100+
Services.scriptloader.loadSubScript("chrome://browser/content/browser-media.js", this);
101+
Services.scriptloader.loadSubScript("chrome://browser/content/browser-pageActions.js", this);
102+
Services.scriptloader.loadSubScript("chrome://browser/content/browser-plugins.js", this);
103+
Services.scriptloader.loadSubScript("chrome://browser/content/browser-sidebar.js", this);
104+
Services.scriptloader.loadSubScript("chrome://browser/content/browser-tabsintitlebar.js", this);
91105
Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser.js", this);
92106
Services.scriptloader.loadSubScript("chrome://browser/content/search/searchbar.js", this);
93107

@@ -735,7 +749,7 @@ xmlns="http://www.w3.org/1999/xhtml"
735749
# shared with other top level windows in macWindow.inc.xul.
736750
#include browser-menubar.inc
737751
</toolbaritem>
738-
<spacer flex="1" />
752+
<spacer flex="1" skipintoolbarset="true"/>
739753
#include titlebar-items.inc.xul
740754
</toolbar>
741755

browser/base/content/global-scripts.inc

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# License, v. 2.0. If a copy of the MPL was not distributed with this
44
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
55

6+
# JS files which are needed by browser.xul but no other top level windows to
7+
# support MacOS specific features should be loaded directly from browser.xul
8+
# rather than this file.
9+
610
# If you update this list, you may need to add a mapping within the following
711
# file so that ESLint works correctly:
812
# tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js
@@ -16,28 +20,12 @@ Components.utils.import("resource://gre/modules/Services.jsm");
1620

1721
for (let script of [
1822
"chrome://browser/content/browser.js",
19-
20-
"chrome://browser/content/browser-captivePortal.js",
21-
"chrome://browser/content/browser-compacttheme.js",
22-
"chrome://browser/content/browser-contentblocking.js",
23-
"chrome://browser/content/browser-media.js",
24-
"chrome://browser/content/browser-pageActions.js",
2523
"chrome://browser/content/browser-places.js",
26-
"chrome://browser/content/browser-plugins.js",
27-
"chrome://browser/content/browser-sidebar.js",
28-
"chrome://browser/content/browser-tabsintitlebar.js",
29-
3024
"chrome://global/content/globalOverlay.js",
3125
"chrome://browser/content/utilityOverlay.js",
3226
#ifdef XP_MACOSX
3327
"chrome://global/content/macWindowMenu.js",
3428
#endif
35-
#ifdef MOZ_DATA_REPORTING
36-
"chrome://browser/content/browser-data-submission-info-bar.js",
37-
#endif
38-
#ifndef MOZILLA_OFFICIAL
39-
"chrome://browser/content/browser-development-helpers.js",
40-
#endif
4129
]) {
4230
Services.scriptloader.loadSubScript(script, this);
4331
}

browser/base/content/tabbrowser.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* License, v. 2.0. If a copy of the MPL was not distributed with this
44
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
55

6-
/* eslint-env mozilla/browser-window */
7-
86
{ // start private scope for gBrowser
97

108
/**

browser/base/content/titlebar-items.inc.xul

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# License, v. 2.0. If a copy of the MPL was not distributed with this
33
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
44

5-
<hbox class="titlebar-buttonbox-container">
5+
<hbox class="titlebar-buttonbox-container" skipintoolbarset="true">
66
<hbox class="titlebar-buttonbox titlebar-color">
77
<toolbarbutton class="titlebar-button titlebar-min" oncommand="window.minimize();"/>
88
<toolbarbutton class="titlebar-button titlebar-max" oncommand="onTitlebarMaxClick();"/>

browser/base/content/urlbarBindings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1937,7 +1937,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
19371937
</field>
19381938

19391939
<field name="oneOffSearchButtons" readonly="true">
1940-
new window.SearchOneOffs(
1940+
new SearchOneOffs(
19411941
document.getAnonymousElementByAttribute(this, "anonid",
19421942
"one-off-search-buttons"));
19431943
</field>

browser/components/extensions/parent/ext-browser.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ class TabTracker extends TabTrackerBase {
488488
// If the tab is already be destroyed, do nothing.
489489
return;
490490
}
491-
this.emitActivated(nativeTab);
491+
this.emitActivated(nativeTab, event.detail.previousTab);
492492
});
493493
break;
494494

@@ -571,11 +571,14 @@ class TabTracker extends TabTrackerBase {
571571
*
572572
* @param {NativeTab} nativeTab
573573
* The tab element which has been activated.
574+
* @param {NativeTab} previousTab
575+
* The tab element which was previously activated.
574576
* @private
575577
*/
576-
emitActivated(nativeTab) {
578+
emitActivated(nativeTab, previousTab = undefined) {
577579
this.emit("tab-activated", {
578580
tabId: this.getId(nativeTab),
581+
previousTabId: previousTab && !previousTab.closing ? this.getId(previousTab) : undefined,
579582
windowId: windowTracker.getId(nativeTab.ownerGlobal)});
580583
}
581584

@@ -777,6 +780,11 @@ class Tab extends TabBase {
777780
return this.url && this.url.startsWith(READER_MODE_PREFIX);
778781
}
779782

783+
get successorTabId() {
784+
const {successor} = this.nativeTab;
785+
return successor ? tabTracker.getId(successor) : -1;
786+
}
787+
780788
/**
781789
* Converts session store data to an object compatible with the return value
782790
* of the convert() method, representing that data.

browser/components/extensions/parent/ext-tabs.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ XPCOMUtils.defineLazyPreferenceGetter(this, "gMultiSelectEnabled", MULTISELECT_P
3131

3232
const TAB_HIDE_CONFIRMED_TYPE = "tabHideNotification";
3333

34+
const TAB_ID_NONE = -1;
35+
3436

3537
XPCOMUtils.defineLazyGetter(this, "tabHidePopup", () => {
3638
return new ExtensionControlledPopup({
@@ -727,6 +729,19 @@ this.tabs = class extends ExtensionAPI {
727729
}
728730
tabTracker.setOpener(nativeTab, opener);
729731
}
732+
if (updateProperties.successorTabId !== null) {
733+
let successor = null;
734+
if (updateProperties.successorTabId !== TAB_ID_NONE) {
735+
successor = tabTracker.getTab(updateProperties.successorTabId, null);
736+
if (!successor) {
737+
throw new ExtensionError("Invalid successorTabId");
738+
}
739+
if (successor.ownerDocument !== nativeTab.ownerDocument) {
740+
throw new ExtensionError("Successor tab must be in the same window as the tab being updated");
741+
}
742+
}
743+
tabbrowser.setSuccessor(nativeTab, successor);
744+
}
730745

731746
return tabManager.convert(nativeTab);
732747
},
@@ -1240,6 +1255,57 @@ this.tabs = class extends ExtensionAPI {
12401255
tab.linkedBrowser.messageManager.sendAsyncMessage("Reader:ToggleReaderMode");
12411256
},
12421257

1258+
moveInSuccession(tabIds, tabId, options) {
1259+
const {insert, append} = options || {};
1260+
const tabIdSet = new Set(tabIds);
1261+
if (tabIdSet.size !== tabIds.length) {
1262+
throw new ExtensionError("IDs must not occur more than once in tabIds");
1263+
}
1264+
if ((append || insert) && tabIdSet.has(tabId)) {
1265+
throw new ExtensionError("Value of tabId must not occur in tabIds if append or insert is true");
1266+
}
1267+
1268+
const referenceTab = tabTracker.getTab(tabId, null);
1269+
let referenceWindow = referenceTab && referenceTab.ownerGlobal;
1270+
let previousTab, lastSuccessor;
1271+
if (append) {
1272+
previousTab = referenceTab;
1273+
lastSuccessor = (insert && referenceTab && referenceTab.successor) || null;
1274+
} else {
1275+
lastSuccessor = referenceTab;
1276+
}
1277+
1278+
let firstTab;
1279+
for (const tabId of tabIds) {
1280+
const tab = tabTracker.getTab(tabId, null);
1281+
if (tab === null) {
1282+
continue;
1283+
}
1284+
if (referenceWindow === null) {
1285+
referenceWindow = tab.ownerGlobal;
1286+
} else if (tab.ownerGlobal !== referenceWindow) {
1287+
continue;
1288+
}
1289+
referenceWindow.gBrowser.replaceInSuccession(tab, tab.successor);
1290+
if (append && tab === lastSuccessor) {
1291+
lastSuccessor = tab.successor;
1292+
}
1293+
if (previousTab) {
1294+
referenceWindow.gBrowser.setSuccessor(previousTab, tab);
1295+
} else {
1296+
firstTab = tab;
1297+
}
1298+
previousTab = tab;
1299+
}
1300+
1301+
if (previousTab) {
1302+
if (!append && insert && lastSuccessor !== null) {
1303+
referenceWindow.gBrowser.replaceInSuccession(lastSuccessor, firstTab);
1304+
}
1305+
referenceWindow.gBrowser.setSuccessor(previousTab, lastSuccessor);
1306+
}
1307+
},
1308+
12431309
show(tabIds) {
12441310
if (!Services.prefs.getBoolPref(TABHIDE_PREFNAME, false)) {
12451311
throw new ExtensionError(`tabs.show is currently experimental and must be enabled with the ${TABHIDE_PREFNAME} preference.`);

0 commit comments

Comments
 (0)