Skip to content

Commit

Permalink
merge n clench (centralle)
Browse files Browse the repository at this point in the history
  • Loading branch information
i3roly committed Dec 13, 2024
2 parents a2a6532 + 594b6a9 commit af15acf
Show file tree
Hide file tree
Showing 659 changed files with 17,939 additions and 5,844 deletions.
4 changes: 2 additions & 2 deletions .cargo/config.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
[source.crates-io]
replace-with = "vendored-sources"

[source."git+https://github.com/FirefoxGraphics/aa-stroke?rev=35a650261605662795a04cc249c465436cbfab45"]
[source."git+https://github.com/FirefoxGraphics/aa-stroke?rev=c985e1baf196b489a8151de29b8f8ee4a77246ab"]
git = "https://github.com/FirefoxGraphics/aa-stroke"
rev = "35a650261605662795a04cc249c465436cbfab45"
rev = "c985e1baf196b489a8151de29b8f8ee4a77246ab"
replace-with = "vendored-sources"

[source."git+https://github.com/FirefoxGraphics/wpf-gpu-raster?rev=99979da091fd58fba8477e7fcdf5ec0727102916"]
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

13 changes: 13 additions & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,19 @@ pref("app.update.langpack.enabled", true);
pref("app.update.noWindowAutoRestart.delayMs", 300000);
#endif

// The Multi Session Install Lockout prevents updates from being installed at
// startup when they normally would be if there are other instances using the
// installation. We only do this for a limited amount of time before we go ahead
// and apply the update anyways.
// Hopefully, at some point, updating Firefox while it is running will not break
// things and this mechanism can be removed.
// Note that these prefs are bit dangerous because having different values in
// different profiles could cause erratic behavior.
// This feature is also affected by
// `app.update.multiSessionInstallLockout.timeoutMs`, which is in the branding
// section.
pref("app.update.multiSessionInstallLockout.enabled", true);

#if defined(MOZ_BACKGROUNDTASKS)
// The amount of time, in seconds, before background tasks time out and exit.
// Tasks can override this default (10 minutes).
Expand Down
5 changes: 2 additions & 3 deletions browser/base/content/browser-pagestyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ var gPageStyleMenu = {
"checked",
!currentStyleSheet.disabled && !styleDisabled
);
menuItem.setAttribute(
"oncommand",
"gPageStyleMenu.switchStyleSheet(this.getAttribute('data'));"
menuItem.addEventListener("command", event =>
this.switchStyleSheet(event.currentTarget.getAttribute("data"))
);
menuPopup.appendChild(menuItem);
currentStyleSheets[currentStyleSheet.title] = menuItem;
Expand Down
10 changes: 6 additions & 4 deletions browser/base/content/browser-places.js
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,8 @@ var BookmarksEventHandler = {
var tree = aTooltip.triggerNode.parentNode;
var cell = tree.getCellAt(aEvent.clientX, aEvent.clientY);
if (cell.row == -1) {
return false;
aEvent.preventDefault();
return;
}
node = tree.view.nodeForTreeIndex(cell.row);
cropped = tree.isCellCropped(cell.row, cell.col);
Expand All @@ -860,7 +861,8 @@ var BookmarksEventHandler = {
}

if (!node && !targetURI) {
return false;
aEvent.preventDefault();
return;
}

// Show node.label as tooltip's title for non-Places nodes.
Expand All @@ -874,7 +876,8 @@ var BookmarksEventHandler = {

// Show tooltip for containers only if their title is cropped.
if (!cropped && !url) {
return false;
aEvent.preventDefault();
return;
}

let tooltipTitle = aEvent.target.querySelector(".places-tooltip-title");
Expand All @@ -891,7 +894,6 @@ var BookmarksEventHandler = {
}

// Show tooltip.
return true;
},
};

Expand Down
8 changes: 8 additions & 0 deletions browser/base/content/browser-sets.inc
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,14 @@
modifiers="accel,alt"
#endif
/>
<key id="toggleSidebarKb"
data-l10n-id="toggle-sidebar-shortcut"
#ifdef XP_MACOSX
modifiers="control"
#else
modifiers="control,alt"
#endif
/>
<key id="key_gotoHistory"
data-l10n-id="history-sidebar-shortcut"
#ifdef XP_MACOSX
Expand Down
14 changes: 14 additions & 0 deletions browser/base/content/browser-sets.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ document.addEventListener(
});

document.getElementById("mainKeyset").addEventListener("command", event => {
const SIDEBAR_REVAMP_PREF = "sidebar.revamp";
const SIDEBAR_REVAMP_ENABLED = Services.prefs.getBoolPref(
SIDEBAR_REVAMP_PREF,
false
);
switch (event.target.id) {
case "goHome":
BrowserCommands.home();
Expand All @@ -277,6 +282,15 @@ document.addEventListener(
SidebarController.toggle("viewGenaiChatSidebar");
break;
}
case "toggleSidebarKb":
if (SIDEBAR_REVAMP_ENABLED) {
SidebarController.handleToolbarButtonClick();
Glean.sidebar.keyboardShortcut.record({
panel: SidebarController.currentID,
opened: SidebarController._state.launcherExpanded,
});
}
break;
case "key_gotoHistory":
SidebarController.toggle("viewHistorySidebar");
break;
Expand Down
61 changes: 34 additions & 27 deletions browser/base/content/browser-sitePermissionPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ var gPermissionPanel = {
let wrapper = document.getElementById("template-permission-popup");
wrapper.replaceWith(wrapper.content);
this._popupInitialized = true;
this._permissionPopup.addEventListener("popupshown", this);
this._permissionPopup.addEventListener("popuphidden", this);
}
},

Expand Down Expand Up @@ -344,33 +346,38 @@ var gPermissionPanel = {
this.openPopup(event);
},

onPopupShown(event) {
if (event.target == this._permissionPopup) {
window.addEventListener("focus", this, true);
}
},

onPopupHidden(event) {
if (event.target == this._permissionPopup) {
window.removeEventListener("focus", this, true);
}
},

handleEvent() {
let elem = document.activeElement;
let position = elem.compareDocumentPosition(this._permissionPopup);

if (
!(
position &
(Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_CONTAINED_BY)
) &&
!this._permissionPopup.hasAttribute("noautohide")
) {
// Hide the panel when focusing an element that is
// neither an ancestor nor descendant unless the panel has
// @noautohide (e.g. for a tour).
PanelMultiView.hidePopup(this._permissionPopup);
handleEvent(event) {
switch (event.type) {
case "popupshown":
if (event.target == this._permissionPopup) {
window.addEventListener("focus", this, true);
}
break;
case "popuphidden":
if (event.target == this._permissionPopup) {
window.removeEventListener("focus", this, true);
}
break;
case "focus":
{
let elem = document.activeElement;
let position = elem.compareDocumentPosition(this._permissionPopup);

if (
!(
position &
(Node.DOCUMENT_POSITION_CONTAINS |
Node.DOCUMENT_POSITION_CONTAINED_BY)
) &&
!this._permissionPopup.hasAttribute("noautohide")
) {
// Hide the panel when focusing an element that is
// neither an ancestor nor descendant unless the panel has
// @noautohide (e.g. for a tour).
PanelMultiView.hidePopup(this._permissionPopup);
}
}
break;
}
},

Expand Down
4 changes: 4 additions & 0 deletions browser/base/content/main-popupset.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ document.addEventListener(
gCustomizeMode.onPanelContextMenuShowing(event);
ToolbarContextMenu.updateExtension(event.target);
break;
case "bhTooltip":
BookmarksEventHandler.fillInBHTooltip(event.target, event);
break;
}
});

Expand All @@ -433,6 +436,7 @@ document.addEventListener(
mainPopupSet.addEventListener("popuphiding", event => {
switch (event.target.id) {
case "tabbrowser-tab-tooltip":
case "bhTooltip":
event.target.removeAttribute("position");
break;
}
Expand Down
4 changes: 4 additions & 0 deletions browser/base/content/test/static/browser_parsable_css.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ let propNameAllowlist = [

/* Allow design tokens in devtools without all variables being used there */
{ sourceName: /\/design-system\/tokens-.*\.css$/, isFromDevTools: true },

/* Temporary exceptions for unused variables in pdf.js */
{ propName: "--toggle-background-color-disabled", isFromDevTools: false },
{ propName: "--toggle-border-color-disabled", isFromDevTools: false },
];

// Add suffix to stylesheets' URI so that we always load them here and
Expand Down
8 changes: 8 additions & 0 deletions browser/branding/aurora/pref/firefox-branding.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ pref("app.update.checkInstallTime.days", 2);
// Give the user x seconds to reboot before showing a badge on the hamburger
// button. default=4 days
pref("app.update.badgeWaitTime", 345600);
// This represents the duration between an update being ready and it being
// possible to install it while other sessions are running. Note that
// having this pref's duration differ from `app.update.badgeWaitTime` may result
// in undefined behavior such as showing an update prompt that does not result
// in an update when the "Restart to Update" button is clicked. Keep in mind
// that this is in milliseconds and `app.update.badgeWaitTime` is in seconds.
// Note that the effective value of this pref is limited to 1 week, maximum.
pref("app.update.multiSessionInstallLockout.timeoutMs", 345600000);

// Number of usages of the web console.
// If this is less than 5, then pasting code into the web console is disabled
Expand Down
8 changes: 8 additions & 0 deletions browser/branding/nightly/pref/firefox-branding.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ pref("app.update.checkInstallTime.days", 2);
// Give the user x seconds to reboot before showing a badge on the hamburger
// button. default=immediately
pref("app.update.badgeWaitTime", 0);
// This represents the duration between an update being ready and it being
// possible to install it while other sessions are running. Note that
// having this pref's duration differ from `app.update.badgeWaitTime` may result
// in undefined behavior such as showing an update prompt that does not result
// in an update when the "Restart to Update" button is clicked. Keep in mind
// that this is in milliseconds and `app.update.badgeWaitTime` is in seconds.
// Note that the effective value of this pref is limited to 1 week, maximum.
pref("app.update.multiSessionInstallLockout.timeoutMs", 0);

// Number of usages of the web console.
// If this is less than 5, then pasting code into the web console is disabled
Expand Down
8 changes: 8 additions & 0 deletions browser/branding/official/pref/firefox-branding.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ pref("app.update.checkInstallTime.days", 63);
// Give the user x seconds to reboot before showing a badge on the hamburger
// button. default=4 days
pref("app.update.badgeWaitTime", 345600);
// This represents the duration between an update being ready and it being
// possible to install it while other sessions are running. Note that
// having this pref's duration differ from `app.update.badgeWaitTime` may result
// in undefined behavior such as showing an update prompt that does not result
// in an update when the "Restart to Update" button is clicked. Keep in mind
// that this is in milliseconds and `app.update.badgeWaitTime` is in seconds.
// Note that the effective value of this pref is limited to 1 week, maximum.
pref("app.update.multiSessionInstallLockout.timeoutMs", 345600000);

// Number of usages of the web console.
// If this is less than 5, then pasting code into the web console is disabled
Expand Down
8 changes: 8 additions & 0 deletions browser/branding/unofficial/pref/firefox-branding.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ pref("app.update.checkInstallTime.days", 2);
// Give the user x seconds to reboot before showing a badge on the hamburger
// button. default=immediately
pref("app.update.badgeWaitTime", 0);
// This represents the duration between an update being ready and it being
// possible to install it while other sessions are running. Note that
// having this pref's duration differ from `app.update.badgeWaitTime` may result
// in undefined behavior such as showing an update prompt that does not result
// in an update when the "Restart to Update" button is clicked. Keep in mind
// that this is in milliseconds and `app.update.badgeWaitTime` is in seconds.
// Note that the effective value of this pref is limited to 1 week, maximum.
pref("app.update.multiSessionInstallLockout.timeoutMs", 0);

// Number of usages of the web console.
// If this is less than 5, then pasting code into the web console is disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,10 @@ export const ASRouterTriggerListeners = new Map([
this._closedTabs++;
this._triggerHandler(gBrowser.selectedBrowser, {
id: this.id,
context: { tabsClosedCount: this._closedTabs },
context: {
tabsClosedCount: this._closedTabs,
currentTabsOpen: gBrowser.tabs.length,
},
});
}
},
Expand All @@ -812,6 +815,56 @@ export const ASRouterTriggerListeners = new Map([
},
},
],
[
"nthTabOpened",
{
id: "nthTabOpened",
_initialized: false,
_triggerHandler: null,
// Number of tabs the user opened this session
_openTabs: 0,

init(triggerHandler) {
this._triggerHandler = triggerHandler;
if (!this._initialized) {
lazy.EveryWindow.registerCallback(
this.id,
win => {
win.addEventListener("TabOpen", this);
},
win => {
win.removeEventListener("TabOpen", this);
}
);
this._initialized = true;
}
},
handleEvent(event) {
if (this._initialized) {
if (!event.target.ownerGlobal.gBrowser) {
return;
}
const { gBrowser } = event.target.ownerGlobal;
this._openTabs++;
this._triggerHandler(gBrowser.selectedBrowser, {
id: this.id,
context: {
tabsOpenedCount: this._openTabs,
currentTabsOpen: gBrowser.tabs.length,
},
});
}
},
uninit() {
if (this._initialized) {
lazy.EveryWindow.unregisterCallback(this.id);
this._initialized = false;
this._triggerHandler = null;
this._openTabs = 0;
}
},
},
],
[
"activityAfterIdle",
{
Expand Down
16 changes: 16 additions & 0 deletions browser/components/asrouter/modules/FeatureCallout.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,22 @@ export class FeatureCallout {
continue;
}
}
if (selector.includes("::%shadow%")) {
let parts = selector.split("::%shadow%");
for (let i = 0; i < parts.length; i++) {
selector = parts[i].trim();
if (i === parts.length - 1) {
break;
}
let el = scope.querySelector(selector);
if (!el) {
break;
}
if (el.shadowRoot) {
scope = el.shadowRoot;
}
}
}
let element = scope.querySelector(selector);
// The element may not be a child of the scope, but the scope itself. For
// example, if we're anchoring directly to the trigger tab, our selector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const MESSAGES = () => {
],
},
targeting:
"userPrefs.cfrAddons && userPrefs.cfrFeatures && localeLanguageCode == 'en' && ((currentDate|date - profileAgeCreated|date) / 86400000 < 28) && !screenImpressions.AW_AMO_INTRODUCE && !willShowDefaultPrompt && !activeNotifications && source == 'newtab' && previousSessionEnd",
"userPrefs.cfrAddons && userPrefs.cfrFeatures && localeLanguageCode == 'en' && ((currentDate|date - profileAgeCreated|date) / 86400000 < 28) && !screenImpressions.AW_AMO_INTRODUCE && !willShowDefaultPrompt && !activeNotifications && source == 'newtab' && previousSessionEnd",
trigger: {
id: "defaultBrowserCheck",
},
Expand Down
Loading

0 comments on commit af15acf

Please sign in to comment.