Skip to content

Commit 9e9c6ca

Browse files
committed
Merge mozilla-central to inbound on a CLOSED TREE
--HG-- extra : amend_source : 45e514d60768068dc6f2b59b05059a0b86e4f692
2 parents af52539 + a4b709f commit 9e9c6ca

File tree

67 files changed

+972
-537
lines changed

Some content is hidden

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

67 files changed

+972
-537
lines changed

browser/app/profile/firefox.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,8 @@ pref("security.sandbox.gmp.win32k-disable", false);
10891089
pref("security.sandbox.content.level", 3);
10901090
#endif
10911091

1092-
#if defined(NIGHTLY_BUILD) && defined(XP_MACOSX) && defined(MOZ_SANDBOX)
1092+
// Enable the Mac Flash sandbox on Nightly and Beta, not Release
1093+
#if defined(EARLY_BETA_OR_EARLIER) && defined(XP_MACOSX) && defined(MOZ_SANDBOX)
10931094
// Controls whether and how the Mac NPAPI Flash plugin process is sandboxed.
10941095
// On Mac these levels are:
10951096
// 0 - "no sandbox"
@@ -1535,9 +1536,7 @@ pref("browser.tabs.remote.desktopbehavior", true);
15351536
// This feature is enabled on macOS only on the Nightly channel
15361537
// until bug 1453080 is fixed.
15371538
//
1538-
#if defined(XP_LINUX) || defined(XP_WIN)
1539-
pref("browser.tabs.remote.warmup.enabled", true);
1540-
#elif defined(NIGHTLY_BUILD) && defined(XP_MACOSX)
1539+
#if !defined(XP_MACOSX) || defined(NIGHTLY_BUILD)
15411540
pref("browser.tabs.remote.warmup.enabled", true);
15421541
#else
15431542
pref("browser.tabs.remote.warmup.enabled", false);

browser/base/content/tabbrowser.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,10 +864,21 @@
864864
let wrap = n => n.parentNode.localName == "toolbarpaletteitem" ? n.parentNode : n;
865865
let unwrap = n => n && n.localName == "toolbarpaletteitem" ? n.firstElementChild : n;
866866
867+
// Starting from the tabs element, find the next sibling that:
868+
// - isn't hidden; and
869+
// - isn't one of the titlebar placeholder elements; and
870+
// - isn't the all-tabs button.
871+
// If it's the new tab button, consider the new tab button adjacent to the tabs.
872+
// If the new tab button is marked as adjacent and the tabstrip doesn't
873+
// overflow, we'll display the 'new tab' button inline in the tabstrip.
874+
// In all other cases, the separate new tab button is displayed in its
875+
// customized location.
867876
let sib = this;
868877
do {
869878
sib = unwrap(wrap(sib).nextElementSibling);
870-
} while (sib && sib.hidden);
879+
} while (sib && (sib.hidden ||
880+
sib.getAttribute("skipintoolbarset") == "true" ||
881+
sib.id == "alltabs-button"));
871882
872883
const kAttr = "hasadjacentnewtabbutton";
873884
if (sib && sib.id == "new-tab-button") {

browser/base/content/test/about/browser.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ support-files =
1616
skip-if = true # Bug 1409054 to remove; previously skipped for intermittents, e.g., Bug 1399648
1717
[browser_aboutHome_search_POST.js]
1818
[browser_aboutHome_search_composing.js]
19-
skip-if = !debug && (os == "mac" || (os == "linux" && bits == 32)) # Bug 1400491, bug 1399648
2019
[browser_aboutHome_search_searchbar.js]
2120
[browser_aboutHome_search_suggestion.js]
2221
skip-if = os == "mac" || (os == "linux" && (!debug || bits == 64)) # Bug 1399648, bug 1402502

browser/base/content/test/about/browser_aboutHome_search_composing.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,8 @@ add_task(async function() {
2121
input.focus();
2222
});
2323

24-
// FYI: "compositionstart" will be dispatched automatically.
25-
await BrowserTestUtils.synthesizeCompositionChange({
26-
composition: {
27-
string: "x",
28-
clauses: [
29-
{ length: 1, attr: Ci.nsITextInputProcessor.ATTR_RAW_CLAUSE }
30-
]
31-
},
32-
caret: { start: 1, length: 0 }
33-
}, browser);
34-
35-
await ContentTask.spawn(browser, null, async function() {
24+
info("Setting up the mutation observer before synthesizing composition");
25+
let mutationPromise = ContentTask.spawn(browser, null, async function() {
3626
let searchController = content.wrappedJSObject.gContentSearchController;
3727

3828
// Wait for the search suggestions to become visible.
@@ -63,6 +53,20 @@ add_task(async function() {
6353
searchController.selectedIndex = 1;
6454
});
6555

56+
// FYI: "compositionstart" will be dispatched automatically.
57+
await BrowserTestUtils.synthesizeCompositionChange({
58+
composition: {
59+
string: "x",
60+
clauses: [
61+
{ length: 1, attr: Ci.nsITextInputProcessor.ATTR_RAW_CLAUSE }
62+
]
63+
},
64+
caret: { start: 1, length: 0 }
65+
}, browser);
66+
67+
info("Waiting for search suggestion table unhidden");
68+
await mutationPromise;
69+
6670
// Click the second suggestion.
6771
let expectedURL = Services.search.currentEngine
6872
.getSubmission("xbar", null, "homepage").uri.spec;

browser/base/content/test/performance/browser_window_resize.js

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,9 @@
1313
* for tips on how to do that.
1414
*/
1515
const EXPECTED_REFLOWS = [
16-
{
17-
stack: [
18-
"onOverflow@resource:///modules/CustomizableUI.jsm",
19-
],
20-
maxCount: 48,
21-
},
22-
23-
{
24-
stack: [
25-
"_moveItemsBackToTheirOrigin@resource:///modules/CustomizableUI.jsm",
26-
"_onLazyResize@resource:///modules/CustomizableUI.jsm",
27-
],
28-
maxCount: 5,
29-
},
30-
31-
{
32-
stack: [
33-
"_onLazyResize@resource:///modules/CustomizableUI.jsm",
34-
],
35-
maxCount: 4,
36-
},
16+
/**
17+
* Nothing here! Please don't add anything new!
18+
*/
3719
];
3820

3921
const gToolbar = document.getElementById("PersonalToolbar");

browser/components/customizableui/CustomizableUI.jsm

Lines changed: 73 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4408,18 +4408,36 @@ OverflowableToolbar.prototype = {
44084408
}
44094409
},
44104410

4411-
onOverflow(aEvent) {
4412-
// The rangeParent check is here because of bug 1111986 and ensuring that
4413-
// overflow events from the bookmarks toolbar items or similar things that
4414-
// manage their own overflow don't trigger an overflow on the entire toolbar
4415-
if (!this._enabled ||
4416-
(aEvent && aEvent.target != this._toolbar.customizationTarget) ||
4417-
(aEvent && aEvent.rangeParent))
4411+
/**
4412+
* Avoid re-entrancy in the overflow handling by keeping track of invocations:
4413+
*/
4414+
_lastOverflowCounter: 0,
4415+
4416+
/**
4417+
* Handle overflow in the toolbar by moving items to the overflow menu.
4418+
* @param {Event} aEvent
4419+
* The overflow event that triggered handling overflow. May be omitted
4420+
* in some cases (e.g. when we run this method after overflow handling
4421+
* is re-enabled from customize mode, to ensure correct handling of
4422+
* initial overflow).
4423+
*/
4424+
async onOverflow(aEvent) {
4425+
if (!this._enabled)
44184426
return;
44194427

44204428
let child = this._target.lastChild;
44214429

4422-
while (child && this._target.scrollLeftMin != this._target.scrollLeftMax) {
4430+
let thisOverflowResponse = ++this._lastOverflowCounter;
4431+
4432+
let win = this._target.ownerGlobal;
4433+
let [scrollLeftMin, scrollLeftMax] = await win.promiseDocumentFlushed(() => {
4434+
return [this._target.scrollLeftMin, this._target.scrollLeftMax];
4435+
});
4436+
if (win.closed || this._lastOverflowCounter != thisOverflowResponse) {
4437+
return;
4438+
}
4439+
4440+
while (child && scrollLeftMin != scrollLeftMax) {
44234441
let prevChild = child.previousSibling;
44244442

44254443
if (child.getAttribute("overflows") != "false") {
@@ -4438,30 +4456,60 @@ OverflowableToolbar.prototype = {
44384456
}
44394457
}
44404458
child = prevChild;
4459+
[scrollLeftMin, scrollLeftMax] = await win.promiseDocumentFlushed(() => {
4460+
return [this._target.scrollLeftMin, this._target.scrollLeftMax];
4461+
});
4462+
// If the window has closed or if we re-enter because we were waiting
4463+
// for layout, stop.
4464+
if (win.closed || this._lastOverflowCounter != thisOverflowResponse) {
4465+
return;
4466+
}
44414467
}
44424468

4443-
let win = this._target.ownerGlobal;
44444469
win.UpdateUrlbarSearchSplitterState();
4470+
// Reset the counter because we finished handling overflow.
4471+
this._lastOverflowCounter = 0;
44454472
},
44464473

44474474
_onResize(aEvent) {
4475+
// Ignore bubbled-up resize events.
4476+
if (aEvent.target != aEvent.target.ownerGlobal.top) {
4477+
return;
4478+
}
44484479
if (!this._lazyResizeHandler) {
44494480
this._lazyResizeHandler = new DeferredTask(this._onLazyResize.bind(this),
44504481
LAZY_RESIZE_INTERVAL_MS, 0);
44514482
}
44524483
this._lazyResizeHandler.arm();
44534484
},
44544485

4455-
_moveItemsBackToTheirOrigin(shouldMoveAllItems) {
4486+
/**
4487+
* Try to move toolbar items back to the toolbar from the overflow menu.
4488+
* @param {boolean} shouldMoveAllItems
4489+
* Whether we should move everything (e.g. because we're being disabled)
4490+
* @param {number} targetWidth
4491+
* Optional; the width of the toolbar in which we can put things.
4492+
* Some consumers pass this to avoid reflows.
4493+
* While there are items in the list, this width won't change, and so
4494+
* we can avoid flushing layout by providing it and/or caching it.
4495+
* Note that if `shouldMoveAllItems` is true, we never need the width
4496+
* anyway.
4497+
*/
4498+
_moveItemsBackToTheirOrigin(shouldMoveAllItems, targetWidth) {
44564499
let placements = gPlacements.get(this._toolbar.id);
4500+
let win = this._target.ownerGlobal;
44574501
while (this._list.firstChild) {
44584502
let child = this._list.firstChild;
44594503
let minSize = this._collapsed.get(child.id);
44604504

4461-
if (!shouldMoveAllItems &&
4462-
minSize &&
4463-
this._target.clientWidth <= minSize) {
4464-
break;
4505+
if (!shouldMoveAllItems && minSize) {
4506+
if (!targetWidth) {
4507+
let dwu = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
4508+
targetWidth = Math.floor(dwu.getBoundsWithoutFlushing(this._target).width);
4509+
}
4510+
if (targetWidth <= minSize) {
4511+
break;
4512+
}
44654513
}
44664514

44674515
this._collapsed.delete(child.id);
@@ -4493,7 +4541,6 @@ OverflowableToolbar.prototype = {
44934541
CustomizableUIInternal.notifyListeners("onWidgetUnderflow", child, this._target);
44944542
}
44954543

4496-
let win = this._target.ownerGlobal;
44974544
win.UpdateUrlbarSearchSplitterState();
44984545

44994546
let collapsedWidgetIds = Array.from(this._collapsed.keys());
@@ -4506,14 +4553,21 @@ OverflowableToolbar.prototype = {
45064553
}
45074554
},
45084555

4509-
_onLazyResize() {
4556+
async _onLazyResize() {
45104557
if (!this._enabled)
45114558
return;
45124559

4513-
if (this._target.scrollLeftMin != this._target.scrollLeftMax) {
4560+
let win = this._target.ownerGlobal;
4561+
let [min, max, targetWidth] = await win.promiseDocumentFlushed(() => {
4562+
return [this._target.scrollLeftMin, this._target.scrollLeftMax, this._target.clientWidth];
4563+
});
4564+
if (win.closed) {
4565+
return;
4566+
}
4567+
if (min != max) {
45144568
this.onOverflow();
45154569
} else {
4516-
this._moveItemsBackToTheirOrigin();
4570+
this._moveItemsBackToTheirOrigin(false, targetWidth);
45174571
}
45184572
},
45194573

@@ -4608,7 +4662,7 @@ OverflowableToolbar.prototype = {
46084662
} else {
46094663
// If it's now the first item in the overflow list,
46104664
// maybe we can return it:
4611-
this._moveItemsBackToTheirOrigin();
4665+
this._moveItemsBackToTheirOrigin(false);
46124666
}
46134667
},
46144668

browser/components/customizableui/test/browser_901207_searchbar_in_panel.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ add_task(async function() {
4949
});
5050

5151
// Ctrl+K should open the overflow panel and focus the search bar if the search bar is overflowed.
52-
add_task(async function() {
52+
add_task(async function check_shortcut_when_in_overflow() {
5353
this.originalWindowWidth = window.outerWidth;
5454
let navbar = document.getElementById(CustomizableUI.AREA_NAVBAR);
5555
ok(!navbar.hasAttribute("overflowing"), "Should start with a non-overflowing toolbar.");
@@ -58,7 +58,10 @@ add_task(async function() {
5858
Services.prefs.setBoolPref("browser.search.widget.inNavBar", true);
5959

6060
window.resizeTo(kForceOverflowWidthPx, window.outerHeight);
61-
await waitForCondition(() => navbar.getAttribute("overflowing") == "true");
61+
await waitForCondition(() => {
62+
return navbar.getAttribute("overflowing") == "true" &&
63+
!navbar.querySelector("#search-container");
64+
});
6265
ok(!navbar.querySelector("#search-container"), "Search container should be overflowing");
6366

6467
let shownPanelPromise = promiseOverflowShown(window);

browser/components/customizableui/test/browser_976792_insertNodeInWindow.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ add_task(async function() {
6868

6969
let originalWindowWidth = window.outerWidth;
7070
window.resizeTo(kForceOverflowWidthPx, window.outerHeight);
71-
await waitForCondition(() => navbar.hasAttribute("overflowing"));
71+
await waitForCondition(() => navbar.hasAttribute("overflowing") && !navbar.querySelector("#" + widgetIds[0]));
7272

7373
let testWidgetId = kTestWidgetPrefix + 3;
7474

@@ -117,7 +117,7 @@ add_task(async function() {
117117

118118
let originalWindowWidth = window.outerWidth;
119119
window.resizeTo(kForceOverflowWidthPx, window.outerHeight);
120-
await waitForCondition(() => navbar.hasAttribute("overflowing"));
120+
await waitForCondition(() => navbar.hasAttribute("overflowing") && !navbar.querySelector("#" + widgetIds[0]));
121121

122122
let testWidgetId = kTestWidgetPrefix + 3;
123123

@@ -167,7 +167,7 @@ add_task(async function() {
167167

168168
let originalWindowWidth = window.outerWidth;
169169
window.resizeTo(kForceOverflowWidthPx, window.outerHeight);
170-
await waitForCondition(() => navbar.hasAttribute("overflowing"));
170+
await waitForCondition(() => navbar.hasAttribute("overflowing") && !navbar.querySelector("#" + widgetIds[0]));
171171

172172
let testWidgetId = kTestWidgetPrefix + 3;
173173

@@ -226,7 +226,14 @@ add_task(async function() {
226226

227227
let originalWindowWidth = window.outerWidth;
228228
window.resizeTo(kForceOverflowWidthPx, window.outerHeight);
229-
await waitForCondition(() => navbar.hasAttribute("overflowing"));
229+
// Wait for all the widgets to overflow. We can't just wait for the
230+
// `overflowing` attribute because we leave time for layout flushes
231+
// inbetween, so it's possible for the timeout to run before the
232+
// navbar has "settled"
233+
await waitForCondition(() => {
234+
return navbar.hasAttribute("overflowing") &&
235+
navbar.customizationTarget.lastChild.getAttribute("overflows") == "false";
236+
});
230237

231238
// Find last widget that doesn't allow overflowing
232239
let nonOverflowing = navbar.customizationTarget.lastChild;
@@ -287,7 +294,7 @@ add_task(async function() {
287294

288295
let originalWindowWidth = window.outerWidth;
289296
window.resizeTo(kForceOverflowWidthPx, window.outerHeight);
290-
await waitForCondition(() => toolbarNode.hasAttribute("overflowing"));
297+
await waitForCondition(() => toolbarNode.hasAttribute("overflowing") && !toolbarNode.querySelector("#" + widgetIds[1]));
291298
ok(toolbarNode.hasAttribute("overflowing"), "Should have an overflowing toolbar.");
292299

293300
let btnId = kTestWidgetPrefix + missingId;

browser/components/customizableui/test/browser_editcontrols_update.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ add_task(async function test_panelui_opened() {
9191
add_task(async function test_panelui_customize_to_toolbar() {
9292
await startCustomizing();
9393
let navbar = document.getElementById("nav-bar");
94-
simulateItemDrag(document.getElementById("edit-controls"), navbar.customizationTarget);
94+
simulateItemDrag(document.getElementById("edit-controls"), navbar.customizationTarget, "end");
9595
await endCustomizing();
9696

9797
// updateEditUIVisibility should be called when customization ends but isn't. See bug 1359790.
@@ -125,7 +125,8 @@ add_task(async function test_panelui_customize_to_toolbar() {
125125
});
126126

127127
window.resizeTo(kForceOverflowWidthPx, window.outerHeight);
128-
await waitForCondition(() => navbar.hasAttribute("overflowing"));
128+
await waitForCondition(() =>
129+
navbar.hasAttribute("overflowing") && !navbar.querySelector("edit-controls"));
129130

130131
// Mac will update the enabled state even when the buttons are overflowing,
131132
// so main menubar shortcuts will work properly.

browser/components/places/content/browserPlacesViews.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,11 +1170,15 @@ PlacesToolbar.prototype = {
11701170
case "overflow":
11711171
if (!this._isOverflowStateEventRelevant(aEvent))
11721172
return;
1173+
// Avoid triggering overflow in containers if possible
1174+
aEvent.stopPropagation();
11731175
this._onOverflow();
11741176
break;
11751177
case "underflow":
11761178
if (!this._isOverflowStateEventRelevant(aEvent))
11771179
return;
1180+
// Avoid triggering underflow in containers if possible
1181+
aEvent.stopPropagation();
11781182
this._onUnderflow();
11791183
break;
11801184
case "TabOpen":

0 commit comments

Comments
 (0)