Skip to content

Commit

Permalink
132.0b5
Browse files Browse the repository at this point in the history
  • Loading branch information
bot committed Oct 10, 2024
1 parent 8e7b249 commit 56b2c3a
Show file tree
Hide file tree
Showing 75 changed files with 3,119 additions and 266 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ ChromeUtils.defineESModuleGetters(lazy, {

export const BookmarksBarButton = {
async showBookmarksBarButton(browser, message) {
const { label, action } = message.content;
const { label, action, logo } = message.content;
let { gBrowser } = browser.ownerGlobal;
const surfaceName = "fxms-bmb-button";
const widgetId = message.id;
const supportedActions = ["OPEN_URL", "SET_PREF", "MULTI_ACTION"];

const fxmsBookmarksBarBtn = {
id: widgetId,
Expand All @@ -29,6 +30,9 @@ export const BookmarksBarButton = {

onCreated(aNode) {
aNode.className = `bookmark-item chromeclass-toolbar-additional ${surfaceName}`;
if (logo?.imageURL) {
aNode.style.listStyleImage = `url(${logo.imageURL})`;
}

lazy.BrowserUsageTelemetry.recordWidgetChange(
widgetId,
Expand All @@ -39,12 +43,26 @@ export const BookmarksBarButton = {
},

onCommand() {
// Currently only supports OPEN_URL action
if (action.type === "OPEN_URL") {
// Click telemetry is handled in BrowserUsageTelemetry, see
// _recordCommand()
lazy.SpecialMessageActions.handleAction(action, gBrowser);
// Click telemetry is handled in BrowserUsageTelemetry, see
// _recordCommand()
if (supportedActions.includes(action.type)) {
switch (action.type) {
case "OPEN_URL":
case "SET_PREF":
lazy.SpecialMessageActions.handleAction(action, gBrowser);
break;
case "MULTI_ACTION":
if (
action.data.actions.every(iAction =>
supportedActions.includes(iAction.type)
)
) {
lazy.SpecialMessageActions.handleAction(action, gBrowser);
break;
}
}
}

if (action.navigate || action.dismiss) {
lazy.CustomizableUI.destroyWidget(widgetId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,10 @@ export const CustomizableWidgets = [
}
},
onCreated(aNode) {
if (!lazy.sidebarRevampEnabled) {
if (lazy.sidebarRevampEnabled) {
const { SidebarController } = aNode.ownerGlobal;
SidebarController.updateToolbarButton(aNode);
} else {
// Add an observer so the button is checked while the sidebar is open
let doc = aNode.ownerDocument;
let obChecked = doc.createXULElement("observes");
Expand Down
37 changes: 28 additions & 9 deletions firefox-src-part/browser/components/genai/GenAI.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";

const lazy = {};
Expand Down Expand Up @@ -257,6 +258,10 @@ export const GenAI = {
* Handle startup tasks like telemetry, adding listeners.
*/
init() {
// Allow other callers to init even though we now automatically init
if (this._initialized) return;
this._initialized = true;

// Access getters for side effects of observing pref changes
lazy.chatEnabled;
lazy.chatHideLocalhost;
Expand All @@ -272,23 +277,38 @@ export const GenAI = {
// Handle nimbus feature pref setting
const featureId = "chatbot";
lazy.NimbusFeatures[featureId].onUpdate(() => {
// Prefer experiments over rollouts
const feature = { featureId };
const enrollment =
lazy.ExperimentAPI.getRolloutMetaData(feature) ??
lazy.ExperimentAPI.getExperimentMetaData(feature);
if (!enrollment?.slug) {
lazy.ExperimentAPI.getExperimentMetaData(feature) ??
lazy.ExperimentAPI.getRolloutMetaData(feature);
if (!enrollment) {
return;
}

// Enforce minimum version by skipping pref changes until Firefox restarts
// with the appropriate version
if (
Services.vc.compare(
// Support betas, e.g., 132.0b1, instead of MOZ_APP_VERSION
AppConstants.MOZ_APP_VERSION_DISPLAY,
// Check configured version or compare with unset handled as 0
lazy.NimbusFeatures[featureId].getVariable("minVersion")
) < 0
) {
return;
}

// Set prefs on any branch if we have a new enrollment slug, otherwise
// only set default branch as those only last for the session
const anyBranch = enrollment.slug != lazy.chatNimbus;
const slug = enrollment.slug + ":" + enrollment.branch.slug;
const anyBranch = slug != lazy.chatNimbus;
const setPref = ([pref, { branch = "user", value = null }]) => {
if (anyBranch || branch == "default") {
lazy.PrefUtils.setPref("browser.ml.chat." + pref, value, { branch });
}
};
setPref(["nimbus", { value: enrollment.slug }]);
setPref(["nimbus", { value: slug }]);
Object.entries(
lazy.NimbusFeatures[featureId].getVariable("prefs")
).forEach(setPref);
Expand All @@ -312,10 +332,6 @@ export const GenAI = {
Glean.genaiChatbot.sidebar.set(lazy.chatSidebar);
},

uninit() {
Services.obs.removeObserver(this, "experimental-pane-loaded");
},

/**
* Convert provider to id.
*
Expand Down Expand Up @@ -891,3 +907,6 @@ function updateIgnoredInputs() {
lazy.chatShortcutsIgnoreFields.split(",").filter(v => v)
);
}

// Initialize on first import
GenAI.init();
14 changes: 14 additions & 0 deletions firefox-src-part/browser/components/sidebar/SidebarManager.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* 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/. */

import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";

const lazy = {};
Expand Down Expand Up @@ -33,6 +34,19 @@ export const SidebarManager = {
return;
}

// Enforce minimum version by skipping pref changes until Firefox restarts
// with the appropriate version
if (
Services.vc.compare(
// Support betas, e.g., 132.0b1, instead of MOZ_APP_VERSION
AppConstants.MOZ_APP_VERSION_DISPLAY,
// Check configured version or compare with unset handled as 0
lazy.NimbusFeatures[featureId].getVariable("minVersion")
) < 0
) {
return;
}

// Set/override user prefs to persist after experiment end
const setPref = (pref, value) => {
// Only set prefs with a value (so no clearing)
Expand Down
20 changes: 10 additions & 10 deletions firefox-src-part/browser/components/sidebar/browser-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -996,25 +996,25 @@ var SidebarController = {
/**
* Update `checked` state and tooltip text of the toolbar button.
*/
updateToolbarButton() {
if (!this.sidebarRevampEnabled || !this.toolbarButton) {
updateToolbarButton(toolbarButton = this.toolbarButton) {
if (!this.sidebarRevampEnabled || !toolbarButton) {
// For the non-revamped sidebar, this is handled by CustomizableWidgets.
return;
}
switch (this.sidebarRevampVisibility) {
case "always-show":
// Toolbar button controls expanded state.
this.toolbarButton.checked = this.sidebarMain.expanded;
this.toolbarButton.dataset.l10nId = this.toolbarButton.checked
? "sidebar-toolbar-collapse-sidebar"
: "sidebar-toolbar-expand-sidebar";
toolbarButton.checked = this.sidebarMain.expanded;
toolbarButton.dataset.l10nId = toolbarButton.checked
? "sidebar-widget-collapse-sidebar"
: "sidebar-widget-expand-sidebar";
break;
case "hide-sidebar":
// Toolbar button controls hidden state.
this.toolbarButton.checked = !this.sidebarContainer.hidden;
this.toolbarButton.dataset.l10nId = this.toolbarButton.checked
? "sidebar-toolbar-hide-sidebar"
: "sidebar-toolbar-show-sidebar";
toolbarButton.checked = !this.sidebarContainer.hidden;
toolbarButton.dataset.l10nId = toolbarButton.checked
? "sidebar-widget-hide-sidebar"
: "sidebar-widget-show-sidebar";
break;
}
},
Expand Down
13 changes: 10 additions & 3 deletions firefox-src-part/browser/components/tabbrowser/content/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1953,10 +1953,17 @@
let size = this.verticalMode ? "height" : "width";
let translateAxis = this.verticalMode ? "translateY" : "translateX";
let scrollDirection = this.verticalMode ? "scrollTop" : "scrollLeft";

let tabSize = draggedTab.getBoundingClientRect()[size];
let tabWidth = draggedTab.getBoundingClientRect().width;
let tabHeight = draggedTab.getBoundingClientRect().height;
let tabSize = this.verticalMode ? tabHeight : tabWidth;
let shiftSize = tabSize * movingTabs.length;
draggedTab._dragData.tabSize = tabSize;
let translateX = event.screenX - draggedTab._dragData.screenX;
let translateY = event.screenY - draggedTab._dragData.screenY;

draggedTab._dragData.tabWidth = tabWidth;
draggedTab._dragData.tabHeight = tabHeight;
draggedTab._dragData.translateX = translateX;
draggedTab._dragData.translateY = translateY;

// Move the dragged tab based on the mouse position.
let firstTab = tabs[0];
Expand Down
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 firefox-src-part/browser/themes/shared/tabbrowser/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -1099,12 +1099,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
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* The .rdm-toolbar will be above the .dialogBox in RDM so we shift the
* .dialogBox down by the height of the .rdm-toolbar so both are visible
*/
+ .browserStack > .dialogStack > .dialogTemplate > .dialogBox {
+ .browserStack > .dialogStack:not(.content-prompt-dialog) > .dialogTemplate > .dialogBox {
margin-top: var(--rdm-toolbar-height);
}
}
Expand Down
6 changes: 5 additions & 1 deletion firefox-src-part/devtools/server/actors/page-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,11 @@ class PageStyleActor extends Actor {
return rules;
}

const elementStyle = this._styleRef(bindingElement, pseudo);
const elementStyle = this._styleRef(
bindingElement,
// for inline style, we can't have a related pseudo element
null
);
const showElementStyles = !inherited && !pseudo;
const showInheritedStyles =
inherited && this._hasInheritedProps(bindingElement.style);
Expand Down
14 changes: 13 additions & 1 deletion firefox-src-part/devtools/server/actors/style-rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,21 @@ class StyleRuleActor extends Actor {
}

const { selectedElement } = this.pageStyle;

// We can be in one of two cases:
// - we are selecting a pseudo element, and that pseudo element is referenced
// by `selectedElement`
// - we are selecting the pseudo element "parent".
// implementPseudoElement returns the pseudo-element string if this element represents
// a pseudo-element, or null otherwise. See https://searchfox.org/mozilla-central/rev/1b90936792b2c71ef931cb1b8d6baff9d825592e/dom/webidl/Element.webidl#102-107
const isPseudoElementParentSelected =
selectedElement.implementedPseudoElement !== this._pseudoElement;

return selectedElement.ownerGlobal.getComputedStyle(
selectedElement,
this._pseudoElement
// If we are selecting the pseudo element parent, we need to pass the pseudo element
// to getComputedStyle to actually get the computed style of the pseudo element.
isPseudoElementParentSelected ? this._pseudoElement : null
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,15 @@ class InspectorCommand {
* @returns {Promise<Array<Object>>}
*/
async getCSSDeclarationBlockIssues(domRuleDeclarations) {
// Filter out custom property declarations as we can't have issue with those and
// they're already ignored on the server.
const nonCustomPropertyDeclarations = domRuleDeclarations.filter(
decl => !decl.isCustomProperty
);
const resultIndex =
this.#cssDeclarationBlockIssuesQueuedDomRulesDeclarations.length;
this.#cssDeclarationBlockIssuesQueuedDomRulesDeclarations.push(
domRuleDeclarations
nonCustomPropertyDeclarations
);

// We're getting the target browsers from RemoteSettings, which can take some time.
Expand Down Expand Up @@ -410,9 +415,8 @@ class InspectorCommand {
* @returns {Promise<Array<Array<Object>>>}
*/
#batchedGetCSSDeclarationBlockIssues = async () => {
const declarations = Array.from(
this.#cssDeclarationBlockIssuesQueuedDomRulesDeclarations
);
const declarations =
this.#cssDeclarationBlockIssuesQueuedDomRulesDeclarations;
this.#cssDeclarationBlockIssuesQueuedDomRulesDeclarations = [];

const { targetFront } = this.commands.targetCommand;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = async function ({
onAvailableArray([[ResourceCommand.TYPES.CONSOLE_MESSAGE, messages]]);

// Forward new message events
webConsoleFront.on("consoleAPICall", message => {
webConsoleFront.on("consoleAPICall", ({ message }) => {
// Ignore console messages that are cloned from the content process
// (they aren't relevant to toolboxes still using legacy listeners)
if (message.clonedFromContentProcess) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Text for the title of an alert dialog displayed by a web page. %1$s will be replaced with the URL of the current page (displaying the dialog). -->
<string name="mozac_browser_engine_system_alert_title">Le linki abas kaambal yaan %1$s ku ya\'alik:</string>
<!-- Text for the message of an auth dialog displayed by a web page.
%1$s will be replaced by the hostname or a description of the protected area/site, %2$s will be replaced with the URL of the current page (displaying the dialog). -->
<string name="mozac_browser_engine_system_auth_message">%2$s táan u k\'áatik a k\'aaba\' yéetel a contraseña. Le ts\'ono\'oto\' ku ya\'alik: “%1$s”</string>
<!-- Text for the message of an auth dialog displayed by a web page. %1$s will be replaced with the URL of the current page (displaying the dialog). -->
<string name="mozac_browser_engine_system_auth_no_realm_message">%1$s táan u k\'áatik a k\'aaba\' yéetel a contraseña.</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
<!-- The document title and heading of the error page shown when a website uses HSTS. -->
<string name="mozac_browser_errorpages_security_bad_hsts_cert_title">يتطلب هذا الموقع اتصالاً آمنًا.</string>

<!-- The error message shown when a website uses HSTS. -->
<string name="mozac_browser_errorpages_security_bad_hsts_cert_message"><![CDATA[
<ul>
<li> لا يمكن عرض الصفحة التي تحاول فتحها لأن موقع الويب هذا يتطلب اتصالاً آمنًا.</li>
<li> يترجَّح أن تكون المشكلة متعلقة بموقع الوِب، ولا يمكنك فعل أي شيء لحلِّها.</li>
<li> يمكنك إخطار مسؤول الموقع بالمشكلة.</li>
</ul>
]]></string>

<!-- The text shown inside the advanced button used to expand the advanced options. It's only shown when a website uses HSTS. -->
<string name="mozac_browser_errorpages_security_bad_hsts_cert_advanced">متقدم…</string>

Expand Down
Loading

0 comments on commit 56b2c3a

Please sign in to comment.