Skip to content

Commit

Permalink
merge n clench (release)
Browse files Browse the repository at this point in the history
  • Loading branch information
i3roly committed Oct 12, 2024
2 parents 27e2d43 + c8ae2bb commit 6ba6b11
Show file tree
Hide file tree
Showing 46 changed files with 1,577 additions and 704 deletions.
5 changes: 0 additions & 5 deletions .cargo/config.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ git = "https://github.com/mozilla/mp4parse-rust"
rev = "a138e40ec1c603615873e524b5b22e11c0ec4820"
replace-with = "vendored-sources"

[source."git+https://github.com/mozilla/neqo?tag=v0.8.2"]
git = "https://github.com/mozilla/neqo"
tag = "v0.8.2"
replace-with = "vendored-sources"

[source."git+https://github.com/servo/unicode-bidi?rev=ca612daf1c08c53abe07327cb3e6ef6e0a760f0c"]
git = "https://github.com/servo/unicode-bidi"
rev = "ca612daf1c08c53abe07327cb3e6ef6e0a760f0c"
Expand Down
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,12 @@ webext-storage = { git = "https://github.com/mozilla/application-services", rev
# Patch `gpu-descriptor` 0.3.0 to remove unnecessary `allocator-api2` dep.:
# Still waiting for the now-merged <https://github.com/zakarumych/gpu-descriptor/pull/40> to be released.
gpu-descriptor = { git = "https://github.com/zakarumych/gpu-descriptor", rev = "7b71a4e47c81903ad75e2c53deb5ab1310f6ff4d" }

[patch."https://github.com/mozilla/neqo"]
neqo-bin = { path = "third_party/rust/neqo-bin" }
neqo-common = { path = "third_party/rust/neqo-common" }
neqo-crypto = { path = "third_party/rust/neqo-crypto" }
neqo-http3 = { path = "third_party/rust/neqo-http3" }
neqo-qpack = { path = "third_party/rust/neqo-qpack" }
neqo-transport = { path = "third_party/rust/neqo-transport" }
neqo-udp = { path = "third_party/rust/neqo-udp" }
2 changes: 1 addition & 1 deletion browser/base/content/navigator-toolbox.inc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
onkeypress="gTabsPanel.showAllTabsPanel(event, 'alltabs-button');"
onmousedown="gTabsPanel.showAllTabsPanel(event, 'alltabs-button');"
data-l10n-id="tabs-toolbar-list-all-tabs"
removable="false"/>
removable="true"/>
</hbox>
</hbox>

Expand Down
48 changes: 48 additions & 0 deletions browser/components/customizableui/CustomizableUI.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3805,6 +3805,33 @@ var CustomizableUIInternal = {
}
},

widgetIsLikelyVisible(aWidgetId, window) {
let placement = this.getPlacementOfWidget(aWidgetId);

if (!placement) {
return false;
}

switch (placement.area) {
case CustomizableUI.AREA_NAVBAR:
return true;
case CustomizableUI.AREA_MENUBAR:
return !this.getCollapsedToolbarIds(window).has(
CustomizableUI.AREA_MENUBAR
);
case CustomizableUI.AREA_TABSTRIP:
return !CustomizableUI.verticalTabsEnabled;
case CustomizableUI.AREA_BOOKMARKS:
return (
Services.prefs.getCharPref(
"browser.toolbars.bookmarks.visibility"
) === "always"
);
default:
return false;
}
},

observe(aSubject, aTopic, aData) {
if (aTopic == "browser-set-toolbar-visibility") {
let [toolbar, visibility] = JSON.parse(aData);
Expand Down Expand Up @@ -4676,6 +4703,27 @@ export var CustomizableUI = {
return CustomizableUIInternal.getCollapsedToolbarIds(window);
},

/**
* Checks if a widget is likely visible in a given window.
*
* This method returns true when a widget is:
* - Not pinned to the overflow menu
* - Not in a collapsed toolbar (e.g. bookmarks toolbar, menu bar)
* - Not in the customization palette
*
* Note: A widget that is moved into the overflow menu due to
* the window being small might be considered visible by
* this method, because a widget's placement does not
* change when it overflows into the overflow menu.
*
* @param aWidgetId the widget ID to check.
* @param {Window} window The browser window to check for widget visibility.
* @returns {Boolean} whether the given widget is likely visible or not.
*/
widgetIsLikelyVisible(aWidgetId, window) {
return CustomizableUIInternal.widgetIsLikelyVisible(aWidgetId, window);
},

/**
* DEPRECATED! Use fluent instead.
*
Expand Down
12 changes: 12 additions & 0 deletions browser/components/extensions/parent/ext-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

ChromeUtils.defineESModuleGetters(this, {
BrowserUIUtils: "resource:///modules/BrowserUIUtils.sys.mjs",
CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs",
DownloadPaths: "resource://gre/modules/DownloadPaths.sys.mjs",
ExtensionControlledPopup:
"resource:///modules/ExtensionControlledPopup.sys.mjs",
Expand Down Expand Up @@ -1606,6 +1607,17 @@ this.tabs = class extends ExtensionAPIPersistent {
}
if (hidden.length) {
let win = Services.wm.getMostRecentWindow("navigator:browser");

// Before showing the hidden tabs warning,
// move alltabs-button to somewhere visible if it isn't already.
if (!CustomizableUI.widgetIsLikelyVisible("alltabs-button", win)) {
CustomizableUI.addWidgetToArea(
"alltabs-button",
CustomizableUI.verticalTabsEnabled
? CustomizableUI.AREA_NAVBAR
: CustomizableUI.AREA_TABSTRIP
);
}
tabHidePopup.open(win, extension.id);
}
return hidden;
Expand Down
132 changes: 131 additions & 1 deletion browser/components/extensions/test/browser/browser_ext_tabs_hide.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,136 @@ add_task(function test_doorhanger_keep() {
});
});

add_task(function test_doorhanger_alltabs_button_in_menubar() {
if (!AppConstants.MENUBAR_CAN_AUTOHIDE) {
info("skipping test because the menubar is not customizable");
return;
}

return doorhangerTest(async function (extension) {
is(gBrowser.visibleTabs.length, 3, "There are 3 visible tabs");

CustomizableUI.addWidgetToArea(
"alltabs-button",
CustomizableUI.AREA_MENUBAR
);

is(
CustomizableUI.getPlacementOfWidget("alltabs-button").area,
CustomizableUI.AREA_MENUBAR,
"alltabs-button is in the menubar"
);

// Hide the first tab, expect the doorhanger.
let panel = ExtensionControlledPopup._getAndMaybeCreatePanel(document);
let popupShown = promisePopupShown(panel);
extension.sendMessage("hide", { url: "*://*/?one" });
await extension.awaitMessage("done");
await popupShown;

is(
CustomizableUI.getPlacementOfWidget("alltabs-button").area,
CustomizableUI.AREA_TABSTRIP,
"alltabs-button has been moved back to the tabstrip"
);

is(gBrowser.visibleTabs.length, 2, "There are 2 visible tabs now");
});
});

add_task(function test_doorhanger_alltabs_button_in_personaltoolbar() {
return doorhangerTest(async function (extension) {
is(gBrowser.visibleTabs.length, 3, "There are 3 visible tabs");

CustomizableUI.addWidgetToArea(
"alltabs-button",
CustomizableUI.AREA_BOOKMARKS
);

is(
CustomizableUI.getPlacementOfWidget("alltabs-button").area,
CustomizableUI.AREA_BOOKMARKS,
"alltabs-button is in the bookmarks bar"
);

// Hide the first tab, expect the doorhanger.
let panel = ExtensionControlledPopup._getAndMaybeCreatePanel(document);
let popupShown = promisePopupShown(panel);
extension.sendMessage("hide", { url: "*://*/?one" });
await extension.awaitMessage("done");
await popupShown;

is(
CustomizableUI.getPlacementOfWidget("alltabs-button").area,
CustomizableUI.AREA_TABSTRIP,
"alltabs-button has been moved back to the tabstrip"
);

is(gBrowser.visibleTabs.length, 2, "There are 2 visible tabs now");
});
});

add_task(function test_doorhanger_alltabs_button_in_overflow_menu() {
return doorhangerTest(async function (extension) {
is(gBrowser.visibleTabs.length, 3, "There are 3 visible tabs");

CustomizableUI.addWidgetToArea(
"alltabs-button",
CustomizableUI.AREA_FIXED_OVERFLOW_PANEL
);

is(
CustomizableUI.getPlacementOfWidget("alltabs-button").area,
CustomizableUI.AREA_FIXED_OVERFLOW_PANEL,
"alltabs-button is in the overflow menu"
);

// Hide the first tab, expect the doorhanger.
let panel = ExtensionControlledPopup._getAndMaybeCreatePanel(document);
let popupShown = promisePopupShown(panel);
extension.sendMessage("hide", { url: "*://*/?one" });
await extension.awaitMessage("done");
await popupShown;

is(
CustomizableUI.getPlacementOfWidget("alltabs-button").area,
CustomizableUI.AREA_TABSTRIP,
"alltabs-button has been moved back to the tabstrip"
);

is(gBrowser.visibleTabs.length, 2, "There are 2 visible tabs now");
});
});

add_task(function test_doorhanger_alltabs_button_removed() {
return doorhangerTest(async function (extension) {
is(gBrowser.visibleTabs.length, 3, "There are 3 visible tabs");

CustomizableUI.removeWidgetFromArea("alltabs-button");

is(
CustomizableUI.getPlacementOfWidget("alltabs-button"),
null,
"alltabs-button is removed"
);

// Hide the first tab, expect the doorhanger.
let panel = ExtensionControlledPopup._getAndMaybeCreatePanel(document);
let popupShown = promisePopupShown(panel);
extension.sendMessage("hide", { url: "*://*/?one" });
await extension.awaitMessage("done");
await popupShown;

is(
CustomizableUI.getPlacementOfWidget("alltabs-button").area,
CustomizableUI.AREA_TABSTRIP,
"alltabs-button has been moved back to the tabstrip"
);

is(gBrowser.visibleTabs.length, 2, "There are 2 visible tabs now");
});
});

add_task(function test_doorhanger_disable() {
return doorhangerTest(async function (extension) {
is(gBrowser.visibleTabs.length, 3, "There are 3 visible tabs");
Expand Down Expand Up @@ -130,7 +260,7 @@ add_task(function test_doorhanger_disable() {
);
ok(
images.some(img =>
getComputedStyle(img).backgroundImage.includes("view-opentabs.svg")
getComputedStyle(img).backgroundImage.includes("arrow-down.svg")
),
"There's an icon for the all tabs menu"
);
Expand Down
2 changes: 1 addition & 1 deletion browser/components/newtab/lib/DiscoveryStreamFeed.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@ export class DiscoveryStreamFeed {
// So for now we only care if we need to make this request at all.
const spocsPromise = this.loadSpocs(
dispatch,
spocsStartupCacheEnabled
isStartup && spocsStartupCacheEnabled
).catch(error =>
console.error("Error trying to load spocs feeds:", error)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ add_task(async function widgetPositions() {
"stop-reload-button",
"tabbrowser-tabs",
"personal-bookmarks",
"alltabs-button",
],

"nav-bar": [
Expand Down Expand Up @@ -249,7 +250,7 @@ add_task(async function customizeMode() {
organizeToolbars({
PersonalToolbar: ["personal-bookmarks"],

TabsToolbar: ["tabbrowser-tabs", "new-tab-button"],
TabsToolbar: ["tabbrowser-tabs", "new-tab-button", "alltabs-button"],

"nav-bar": [
"back-button",
Expand Down Expand Up @@ -344,7 +345,7 @@ add_task(async function contextMenus() {
organizeToolbars({
PersonalToolbar: ["personal-bookmarks"],

TabsToolbar: ["tabbrowser-tabs", "new-tab-button"],
TabsToolbar: ["tabbrowser-tabs", "new-tab-button", "alltabs-button"],

"nav-bar": [
"back-button",
Expand Down
16 changes: 6 additions & 10 deletions browser/themes/shared/addons/extension-controlled.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,16 @@
margin-bottom: 0;
}

.extension-controlled-icon {
.extension-controlled-notification popupnotificationcontent > description > .extension-controlled-icon {
height: 16px;
width: 16px;
vertical-align: bottom;
}

&.alltabs-icon {
background: url("chrome://browser/content/firefoxview/view-opentabs.svg");
-moz-context-properties: fill;
fill: currentColor;
height: 20px;
width: 20px;
/* This icon has a lot of extra space to the sides, reduce that a little. */
margin-block: -2px;
}
.extension-controlled-icon.alltabs-icon {
background: url("chrome://global/skin/icons/arrow-down.svg");
/* This icon has a lot of extra space to the sides, reduce that a little. */
margin: 0 -1px 1px;
}

.extension-controlled-notification > .popup-notification-body-container > .popup-notification-body > .popup-notification-bottom-content > .popup-notification-warning,
Expand Down
7 changes: 1 addition & 6 deletions browser/themes/shared/tabbrowser/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -998,12 +998,7 @@ toolbar:not(#TabsToolbar) #firefox-view-button {
/* All tabs button and menupopup */

#alltabs-button {
list-style-image: url("chrome://browser/content/firefoxview/view-opentabs.svg");

> .toolbarbutton-badge-stack > .toolbarbutton-icon {
width: 20px;
margin: -2px;
}
list-style-image: url(chrome://global/skin/icons/arrow-down.svg);

#tabbrowser-tabs[hiddensoundplaying] ~ & > .toolbarbutton-badge-stack > .toolbarbutton-badge {
background: transparent url(chrome://browser/skin/tabbrowser/tab-audio-playing-small.svg);
Expand Down
Loading

0 comments on commit 6ba6b11

Please sign in to comment.