Update On Wed Sep 11 20:52:38 CEST 2024

This commit is contained in:
github-action[bot] 2024-09-11 20:52:39 +02:00
parent 861ecb5795
commit 1d855f7e90
588 changed files with 26485 additions and 14948 deletions

8
Cargo.lock generated
View file

@ -6137,9 +6137,9 @@ dependencies = [
[[package]]
name = "unic-langid"
version = "0.9.1"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "398f9ad7239db44fd0f80fe068d12ff22d78354080332a5077dc6f52f14dcf2f"
checksum = "23dd9d1e72a73b25e07123a80776aae3e7b0ec461ef94f9151eed6ec88005a44"
dependencies = [
"unic-langid-impl",
]
@ -6155,9 +6155,9 @@ dependencies = [
[[package]]
name = "unic-langid-impl"
version = "0.9.1"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e35bfd2f2b8796545b55d7d3fd3e89a0613f68a0d1c8bc28cb7ff96b411a35ff"
checksum = "0a5422c1f65949306c99240b81de9f3f15929f5a8bfe05bb44b034cc8bf593e5"
dependencies = [
"tinystr",
]

View file

@ -35,7 +35,7 @@ export class LinkHandlerParent extends JSWindowActorParent {
return;
}
if (aMsg.data.canUseForTab) {
if (!aMsg.data.isRichIcon) {
let tab = gBrowser.getTabForBrowser(browser);
if (tab.hasAttribute("busy")) {
tab.setAttribute("pendingicon", "true");
@ -46,13 +46,6 @@ export class LinkHandlerParent extends JSWindowActorParent {
break;
case "Link:SetIcon":
// Cache the most recent icon and rich icon locally.
if (aMsg.data.canUseForTab) {
this.icon = aMsg.data;
} else {
this.richIcon = aMsg.data;
}
if (!gBrowser) {
return;
}
@ -67,7 +60,7 @@ export class LinkHandlerParent extends JSWindowActorParent {
return;
}
if (aMsg.data.canUseForTab) {
if (!aMsg.data.isRichIcon) {
this.clearPendingIcon(gBrowser, browser);
}
@ -108,7 +101,6 @@ export class LinkHandlerParent extends JSWindowActorParent {
{
pageURL,
originalURL,
canUseForTab,
expiration,
iconURL,
canStoreIcon,
@ -121,7 +113,7 @@ export class LinkHandlerParent extends JSWindowActorParent {
return;
}
if (canUseForTab) {
if (!isRichIcon) {
this.clearPendingIcon(gBrowser, browser);
}
@ -158,7 +150,7 @@ export class LinkHandlerParent extends JSWindowActorParent {
}
}
if (canUseForTab) {
if (!isRichIcon) {
gBrowser.setIcon(tab, iconURL, originalURL, null, beforePageShow);
}
}

View file

@ -203,6 +203,13 @@ pref("app.update.langpack.enabled", true);
// The amount of time, in seconds, before background tasks time out and exit.
// Tasks can override this default (10 minutes).
pref("toolkit.backgroundtasks.defaultTimeoutSec", 600);
#if defined(ENABLE_TESTS)
// Test prefs to verify background tasks inheret and override browser prefs
// correctly.
pref("toolkit.backgroundtasks.tests.browserPrefsInherited", 15);
pref("toolkit.backgroundtasks.tests.browserPrefsOverriden", 16);
#endif
#endif
// Symmetric (can be overridden by individual extensions) update preferences.
@ -281,7 +288,7 @@ pref("browser.shell.defaultBrowserCheckCount", 0);
pref("browser.shell.setDefaultBrowserUserChoice", true);
// When setting default via UserChoice, temporarily rename an ancestor registry key to
// prevent kernel drivers from locking the UserChoice subkeys.
pref("browser.shell.setDefaultBrowserUserChoice.regRename", false);
pref("browser.shell.setDefaultBrowserUserChoice.regRename", true);
// When setting the default browser on Windows 10 using the UserChoice
// registry keys, also try to set Firefox as the default PDF handler.
pref("browser.shell.setDefaultPDFHandler", true);

View file

@ -343,7 +343,7 @@
<toolbarbutton id="searchmode-switcher-close"
data-action="exitsearchmode"
role="button"
tooltip="dynamic-shortcut-tooltip"
data-l10n-id="urlbar-searchmode-exit-button"
class="toolbarbutton-icon close-button" />
</box>
<moz-input-box tooltip="aHTMLTooltip"

View file

@ -21,7 +21,7 @@ function waitForFaviconMessage(isTabIcon = undefined, expectedURL = undefined) {
}
// If requested filter out loads of the wrong kind of icon.
if (isTabIcon != undefined && isTabIcon != data.canUseForTab) {
if (isTabIcon != undefined && isTabIcon == data.isRichIcon) {
return;
}
@ -35,13 +35,11 @@ function waitForFaviconMessage(isTabIcon = undefined, expectedURL = undefined) {
resolve({
iconURL: data.originalURL,
dataURL: data.iconURL,
canUseForTab: data.canUseForTab,
isRichIcon: data.isRichIcon,
});
} else {
reject({
iconURL: data.originalURL,
canUseForTab: data.canUseForTab,
isRichIcon: data.isRichIcon,
});
}

View file

@ -11,9 +11,7 @@ const BASE_CONTENT = {
alt_text: "Test alt",
},
email: {
link_text: {
string_id: "spotlight-focus-promo-email-link",
},
link_text: "Email yourself a link",
},
marketplace_buttons: ["ios", "android"],
},

View file

@ -9,6 +9,8 @@
src="chrome://browser/content/backup/disable-backup-encryption.mjs"
type="module"
></script>
<link rel="localization" href="preview/backupSettings.ftl"/>
<link rel="localization" href="branding/brand.ftl"/>
<link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<script>

View file

@ -10,6 +10,8 @@
src="chrome://browser/content/backup/enable-backup-encryption.mjs"
type="module"
></script>
<link rel="localization" href="preview/backupSettings.ftl"/>
<link rel="localization" href="branding/brand.ftl"/>
<link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<script>

View file

@ -9,6 +9,8 @@
src="chrome://browser/content/backup/restore-from-backup.mjs"
type="module"
></script>
<link rel="localization" href="preview/backupSettings.ftl"/>
<link rel="localization" href="branding/brand.ftl"/>
<link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<script>

View file

@ -9,6 +9,8 @@
src="chrome://browser/content/backup/turn-off-scheduled-backups.mjs"
type="module"
></script>
<link rel="localization" href="preview/backupSettings.ftl"/>
<link rel="localization" href="branding/brand.ftl"/>
<link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<script>

View file

@ -7,6 +7,7 @@
<script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css">
<link rel="localization" href="browser/preferences/preferences.ftl"/>
<link rel="localization" href="browser/firefoxView.ftl"/>
<script type="module" src="chrome://browser/content/firefoxview/card-container.mjs"></script>
</head>

View file

@ -5,6 +5,8 @@
<title>FxviewTabList Tests</title>
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<link rel="localization" href="browser/firefoxView.ftl">
<link rel="localization" href="browser/fxviewTabList.ftl">
<link rel="localization" href="browser/places.ftl">
<link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css">

View file

@ -6,19 +6,19 @@ const DEFAULT_SITES_MAP = new Map([
// This first item is the global list fallback for any unexpected geos
[
"",
"https://www.youtube.com/,https://www.facebook.com/,https://www.wikipedia.org/,https://www.reddit.com/,https://www.amazon.com/,https://twitter.com/",
"https://www.youtube.com/,https://www.facebook.com/,https://www.wikipedia.org/,https://www.reddit.com/,https://twitter.com/",
],
[
"US",
"https://www.youtube.com/,https://www.facebook.com/,https://www.amazon.com/,https://www.reddit.com/,https://www.wikipedia.org/,https://twitter.com/",
"https://www.youtube.com/,https://www.facebook.com/,https://www.reddit.com/,https://www.wikipedia.org/,https://twitter.com/",
],
[
"CA",
"https://www.youtube.com/,https://www.facebook.com/,https://www.reddit.com/,https://www.wikipedia.org/,https://www.amazon.ca/,https://twitter.com/",
"https://www.youtube.com/,https://www.facebook.com/,https://www.reddit.com/,https://www.wikipedia.org/,https://twitter.com/",
],
[
"DE",
"https://www.youtube.com/,https://www.facebook.com/,https://www.amazon.de/,https://www.ebay.de/,https://www.wikipedia.org/,https://www.reddit.com/",
"https://www.youtube.com/,https://www.facebook.com/,https://www.ebay.de/,https://www.wikipedia.org/,https://www.reddit.com/",
],
[
"PL",
@ -30,11 +30,11 @@ const DEFAULT_SITES_MAP = new Map([
],
[
"GB",
"https://www.youtube.com/,https://www.facebook.com/,https://www.reddit.com/,https://www.amazon.co.uk/,https://www.bbc.co.uk/,https://www.ebay.co.uk/",
"https://www.youtube.com/,https://www.facebook.com/,https://www.reddit.com/,https://www.bbc.co.uk/,https://www.ebay.co.uk/",
],
[
"FR",
"https://www.youtube.com/,https://www.facebook.com/,https://www.wikipedia.org/,https://www.amazon.fr/,https://www.leboncoin.fr/,https://twitter.com/",
"https://www.youtube.com/,https://www.facebook.com/,https://www.wikipedia.org/,https://www.leboncoin.fr/,https://twitter.com/",
],
[
"CN",

View file

@ -1302,6 +1302,40 @@ export var PlacesUIUtils = {
}
},
/**
* Determines whether the given "placesContext" menu item would open a link
* under some special conditions, but those special conditions cannot be met.
*
* @param {Element} item The menu or menu item to decide for.
*
* @returns {boolean} Whether the item is an "open" item that should be
* hidden.
*/
shouldHideOpenMenuItem(item) {
if (
item.hasAttribute("hide-if-disabled-private-browsing") &&
!lazy.PrivateBrowsingUtils.enabled
) {
return true;
}
if (
item.hasAttribute("hide-if-private-browsing") &&
lazy.PrivateBrowsingUtils.isWindowPrivate(item.ownerGlobal)
) {
return true;
}
if (
item.hasAttribute("hide-if-usercontext-disabled") &&
!Services.prefs.getBoolPref("privacy.userContext.enabled", false)
) {
return true;
}
return false;
},
async managedPlacesContextShowing(event) {
let menupopup = event.target;
let document = menupopup.ownerDocument;
@ -1316,12 +1350,6 @@ export var PlacesUIUtils = {
menupopup.triggerNode.menupopup
);
}
let linkItems = [
"placesContext_open:newtab",
"placesContext_open:newwindow",
"placesContext_openSeparator",
"placesContext_copy",
];
// Hide everything. We'll unhide the things we need.
Array.from(menupopup.children).forEach(function (child) {
child.hidden = true;
@ -1343,12 +1371,18 @@ export var PlacesUIUtils = {
openContainerInTabs_menuitem.disabled = !openContainerInTabs;
openContainerInTabs_menuitem.hidden = false;
} else {
linkItems.forEach(id => (document.getElementById(id).hidden = false));
document.getElementById("placesContext_open:newprivatewindow").hidden =
lazy.PrivateBrowsingUtils.isWindowPrivate(window) ||
!lazy.PrivateBrowsingUtils.enabled;
document.getElementById("placesContext_open:newcontainertab").hidden =
!Services.prefs.getBoolPref("privacy.userContext.enabled", false);
for (let id of [
"placesContext_open:newtab",
"placesContext_open:newcontainertab",
"placesContext_open:newwindow",
"placesContext_open:newprivatewindow",
]) {
let item = document.getElementById(id);
item.hidden = this.shouldHideOpenMenuItem(item);
}
for (let id of ["placesContext_openSeparator", "placesContext_copy"]) {
document.getElementById(id).hidden = false;
}
}
event.target.ownerGlobal.updateCommands("places");

View file

@ -465,17 +465,7 @@ PlacesController.prototype = {
* and the item can be displayed, false otherwise.
*/
_shouldShowMenuItem(aMenuItem, aMetaData) {
if (
aMenuItem.hasAttribute("hide-if-private-browsing") &&
!PrivateBrowsingUtils.enabled
) {
return false;
}
if (
aMenuItem.hasAttribute("hide-if-usercontext-disabled") &&
!Services.prefs.getBoolPref("privacy.userContext.enabled", false)
) {
if (PlacesUIUtils.shouldHideOpenMenuItem(aMenuItem)) {
return false;
}
@ -566,8 +556,12 @@ PlacesController.prototype = {
* menuitem when there's no insertion point. An insertion point represents
* a point in the view where a new item can be inserted.
* 9) The boolean `hide-if-private-browsing` attribute may be set to hide a
* menuitem in private browsing mode
* 10) The boolean `hide-if-single-click-opens` attribute may be set to hide a
* menuitem in private browsing mode.
* 10) The boolean `hide-if-disabled-private-browsing` attribute may be set to
* hide a menuitem if private browsing is not enabled.
* 11) The boolean `hide-if-usercontext-disabled` attribute may be set to
* hide a menuitem if containers are disabled.
* 12) The boolean `hide-if-single-click-opens` attribute may be set to hide a
* menuitem in views opening entries with a single click.
*
* @param {object} aPopup
@ -593,9 +587,6 @@ PlacesController.prototype = {
item.getAttribute("hide-if-no-insertion-point") == "true" &&
noIp &&
!(ip && ip.isTag && item.id == "placesContext_paste");
let hideIfPrivate =
item.getAttribute("hide-if-private-browsing") == "true" &&
PrivateBrowsingUtils.isWindowPrivate(window);
// Hide `Open` if the primary action on click is opening.
let hideIfSingleClickOpens =
item.getAttribute("hide-if-single-click-opens") == "true" &&
@ -610,7 +601,6 @@ PlacesController.prototype = {
let shouldHideItem =
hideIfNoIP ||
hideIfPrivate ||
hideIfSingleClickOpens ||
hideIfNotSearch ||
!this._shouldShowMenuItem(item, metadata);

View file

@ -52,13 +52,14 @@
command="placesCmd_open:window"
data-l10n-id="places-open-in-window"
selection-type="single"
node-type="link"/>
node-type="link"
hide-if-private-browsing="true"/>
<menuitem id="placesContext_open:newprivatewindow"
command="placesCmd_open:privatewindow"
data-l10n-id="places-open-in-private-window"
selection-type="single"
node-type="link"
hide-if-private-browsing="true"/>
hide-if-disabled-private-browsing="true"/>
<menuitem id="placesContext_showInFolder"
data-l10n-id="places-show-in-folder"
command="placesCmd_showInFolder"

View file

@ -817,3 +817,118 @@ add_task(async function test_library_noselection_contextmenu_contents() {
);
});
});
add_task(async function test_private_browsing_window() {
// Test the context menu when in a private browsing window.
let win = await BrowserTestUtils.openNewBrowserWindow({
private: true,
});
let optionItems = [
"placesContext_open:newtab",
// Hidden in private window "placesContext_open:newcontainertab"
// Hidden in private window "placesContext_open:newwindow"
"placesContext_open:newprivatewindow",
"placesContext_show_bookmark:info",
"placesContext_deleteBookmark",
"placesContext_cut",
"placesContext_copy",
"placesContext_paste_group",
"placesContext_new:bookmark",
"placesContext_new:folder",
"placesContext_new:separator",
];
// Test toolbar.
await checkContextMenu(
async function () {
let toolbarBookmark = await PlacesUtils.bookmarks.insert({
parentGuid: PlacesUtils.bookmarks.toolbarGuid,
title: "Bookmark Title",
url: TEST_URL,
});
let toolbarNode = getToolbarNodeForItemGuid(toolbarBookmark.guid, win);
let contextMenu = win.document.getElementById("placesContext");
let popupShownPromise = BrowserTestUtils.waitForEvent(
contextMenu,
"popupshown"
);
EventUtils.synthesizeMouseAtCenter(
toolbarNode,
{ button: 2, type: "contextmenu" },
win
);
await popupShownPromise;
return contextMenu;
},
[
...optionItems,
"placesContext_showAllBookmarks",
"toggle_PersonalToolbar",
"show-other-bookmarks_PersonalToolbar",
],
win.document
);
// Test side bar.
await withSidebarTree(
"bookmarks",
async tree => {
await checkContextMenu(
async bookmark => {
tree.selectItems([bookmark.guid]);
let contextMenu =
win.SidebarController.browser.contentDocument.getElementById(
"placesContext"
);
let popupShownPromise = BrowserTestUtils.waitForEvent(
contextMenu,
"popupshown"
);
synthesizeClickOnSelectedTreeCell(tree, { type: "contextmenu" }, win);
await popupShownPromise;
return contextMenu;
},
optionItems,
win.SidebarController.browser.contentDocument
);
},
win
);
// Test library window opened when using private browsing window.
optionItems.splice(
optionItems.indexOf("placesContext_show_bookmark:info"),
1
);
optionItems.splice(0, 0, "placesContext_open");
await withLibraryWindow(
"BookmarksToolbar",
async ({ right }) => {
await checkContextMenu(
async bookmark => {
let contextMenu = right.ownerDocument.getElementById("placesContext");
let popupShownPromise = BrowserTestUtils.waitForEvent(
contextMenu,
"popupshown"
);
right.selectItems([bookmark.guid]);
synthesizeClickOnSelectedTreeCell(right, { type: "contextmenu" });
await popupShownPromise;
return contextMenu;
},
optionItems,
right.ownerDocument
);
},
win
);
await BrowserTestUtils.closeWindow(win);
});

View file

@ -6,8 +6,8 @@ ChromeUtils.defineLazyGetter(this, "gFluentStrings", function () {
return new Localization(["branding/brand.ftl", "browser/browser.ftl"], true);
});
function openLibrary(callback, aLeftPaneRoot) {
let library = window.openDialog(
function openLibrary(callback, aLeftPaneRoot, win = window) {
let library = win.openDialog(
"chrome://browser/content/places/places.xhtml",
"",
"chrome,toolbar=yes,dialog=no,resizable",
@ -27,10 +27,12 @@ function openLibrary(callback, aLeftPaneRoot) {
*
* @param {object} aLeftPaneRoot
* Hierarchy to open and select in the left pane.
* @param {Window} [win]
* The window to use to open the library.
* @returns {Promise}
* Resolves to the handle to the library window.
*/
function promiseLibrary(aLeftPaneRoot) {
function promiseLibrary(aLeftPaneRoot, win = window) {
return new Promise(resolve => {
let library = Services.wm.getMostRecentWindow("Places:Organizer");
if (library && !library.closed) {
@ -42,7 +44,7 @@ function promiseLibrary(aLeftPaneRoot) {
checkLibraryPaneVisibility(library, aLeftPaneRoot);
resolve(library);
} else {
openLibrary(resolve, aLeftPaneRoot);
openLibrary(resolve, aLeftPaneRoot, win);
}
});
}
@ -380,9 +382,11 @@ function fillBookmarkTextField(id, text, win, blur = true) {
* @param {Function} taskFn
* The task to execute once the sidebar is ready. Will get the Places
* tree view as input.
* @param {Window} [win]
* The window to open the sidebar in, else uses the default window.
*/
var withSidebarTree = async function (type, taskFn) {
let sidebar = document.getElementById("sidebar");
var withSidebarTree = async function (type, taskFn, win = window) {
let sidebar = win.document.getElementById("sidebar");
info("withSidebarTree: waiting sidebar load");
let sidebarLoadedPromise = new Promise(resolve => {
sidebar.addEventListener(
@ -395,7 +399,7 @@ var withSidebarTree = async function (type, taskFn) {
});
let sidebarId =
type == "bookmarks" ? "viewBookmarksSidebar" : "viewHistorySidebar";
SidebarController.show(sidebarId);
win.SidebarController.show(sidebarId);
await sidebarLoadedPromise;
let treeId = type == "bookmarks" ? "bookmarks-view" : "historyTree";
@ -406,7 +410,7 @@ var withSidebarTree = async function (type, taskFn) {
try {
await taskFn(tree);
} finally {
SidebarController.hide();
win.SidebarController.hide();
}
};
@ -419,9 +423,11 @@ var withSidebarTree = async function (type, taskFn) {
* @param {Function} taskFn
* The task to execute once the Library is ready.
* Will get { left, right } trees as argument.
* @param {Window} [win]
* The window to use to open the library.
*/
var withLibraryWindow = async function (hierarchy, taskFn) {
let library = await promiseLibrary(hierarchy);
var withLibraryWindow = async function (hierarchy, taskFn, win = window) {
let library = await promiseLibrary(hierarchy, win);
let left = library.document.getElementById("placesList");
let right = library.document.getElementById("placeContent");
info("withLibrary: executing the task");
@ -477,8 +483,8 @@ function promisePopupHidden(popup) {
}
// Identify a bookmark node in the Bookmarks Toolbar by its guid.
function getToolbarNodeForItemGuid(itemGuid) {
let children = document.getElementById("PlacesToolbarItems").childNodes;
function getToolbarNodeForItemGuid(itemGuid, win = window) {
let children = win.document.getElementById("PlacesToolbarItems").childNodes;
for (let child of children) {
if (itemGuid === child._placesNode.bookmarkGuid) {
return child;

View file

@ -709,6 +709,12 @@ export var ReportBrokenSite = new (class ReportBrokenSite {
prefs["privacy.resistFingerprinting"]
);
gPrefs.softwareWebrender.set(prefs["gfx.webrender.software"]);
gPrefs.thirdPartyCookieBlockingEnabled.set(
prefs["network.cookie.cookieBehavior.optInPartitioning"]
);
gPrefs.thirdPartyCookieBlockingEnabledInPbm.set(
prefs["network.cookie.cookieBehavior.optInPartitioning.pbmode"]
);
if (security) {
for (const [name, value] of Object.entries(security)) {

View file

@ -177,6 +177,14 @@ async function getExpectedWebCompatInfo(tab, snapshot, fullAppData = false) {
"gfx.webrender.software",
false
),
thirdPartyCookieBlockingEnabled: Services.prefs.getBoolPref(
"network.cookie.cookieBehavior.optInPartitioning",
false
),
thirdPartyCookieBlockingEnabledInPbm: Services.prefs.getBoolPref(
"network.cookie.cookieBehavior.optInPartitioning.pbmode",
false
),
},
security: {
antispyware: securityStringToArray(registeredAntiSpyware),

View file

@ -67,6 +67,10 @@ async function reformatExpectedWebCompatInfo(tab, overrides) {
opaqueResponseBlocking: "browser.opaqueResponseBlocking",
resistFingerprintingEnabled: "privacy.resistFingerprinting",
softwareWebrender: "gfx.webrender.software",
thirdPartyCookieBlockingEnabled:
"network.cookie.cookieBehavior.optInPartitioning",
thirdPartyCookieBlockingEnabledInPbm:
"network.cookie.cookieBehavior.optInPartitioning.pbmode",
})) {
if (key in prefs) {
finalPrefs[pref] = prefs[key];

View file

@ -37,26 +37,31 @@ function getTimeZone(tab) {
);
}
add_task(async function test_new_window() {
async function run_test(enabled) {
const overrides = enabled ? "+JSDateTimeUTC" : "-JSDateTimeUTC";
await SpecialPowers.pushPrefEnv({
set: [
["privacy.fingerprintingProtection", true],
["privacy.fingerprintingProtection.overrides", "+JSDateTimeUTC"],
["privacy.fingerprintingProtection.overrides", overrides],
],
});
SpecialPowers.Cu.getJSTestingFunctions().setTimeZone("PST8PDT");
// Open a tab for extracting the time zone from XSLT.
const tab = await BrowserTestUtils.openNewForegroundTab({
gBrowser,
opening: TEST_PATH + "file_dummy.html",
forceNewProcess: true,
});
SpecialPowers.Cu.getJSTestingFunctions().setTimeZone("America/Toronto");
const timeZone = await getTimeZone(tab);
ok(timeZone.endsWith("+00:00"), "Timezone was spoofed.");
const expected = enabled ? "+00:00" : "-07:00";
ok(timeZone.endsWith(expected), `Timezone is ${expected}.`);
BrowserTestUtils.removeTab(tab);
await SpecialPowers.popPrefEnv();
});
}
add_task(() => run_test(true));
add_task(() => run_test(false));

View file

@ -14,18 +14,19 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1363508
<div id="target0" style="width: 50px; height: 50px; background: green"></div>
<div id="target1" style="width: 50px; height: 50px; background: black"></div>
<script type="application/javascript">
/** Test for Bug 1363508 */
SimpleTest.waitForExplicitFinish();
const { AppConstants } = SpecialPowers.ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
var target0 = window.document.getElementById("target0");
var target1 = window.document.getElementById("target1");
var utils = SpecialPowers.Ci.nsIDOMWindowUtils;
// A helper function to check that whether the pointer is spoofed correctly.
function checkPointerEvent(aEvent) {
is(aEvent.pointerId, utils.DEFAULT_MOUSE_POINTER_ID,
"The spoofed pointer event should always have the mouse pointer id.");
is(aEvent.width, 1, "The spoofed pointer event should always have width as 1.");
is(aEvent.height, 1, "The spoofed pointer event should always have width as 1.");
if (aEvent.buttons === 0) {
@ -39,8 +40,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1363508
is(aEvent.tiltX, 0, "The spoofed pointer event should always have tiltX as 0.");
is(aEvent.tiltY, 0, "The spoofed pointer event should always have tiltY as 0.");
is(aEvent.twist, 0, "The spoofed pointer event should always have twist as 0.");
is(aEvent.pointerType, "mouse", "The spoofed pointer event should always has mouse pointerType.");
is(aEvent.isPrimary, true, "The spoofed pointer event should only receive primary pointer events.");
if (AppConstants.platform == "macosx") {
is(aEvent.pointerId, utils.DEFAULT_MOUSE_POINTER_ID,
"The spoofed pointer event should always have the mouse pointer id.");
is(aEvent.pointerType, "mouse", "The spoofed pointer event should always has mouse pointerType.");
is(aEvent.isPrimary, true, "The spoofed pointer event should only receive primary pointer events.");
}
}
// A helper function to create a promise for waiting the event.

View file

@ -595,11 +595,17 @@ export var ShellService = new Proxy(ShellServiceInternal, {
if (name in target) {
return target[name];
}
if (target.shellService) {
// n.b. Functions may be present or absent dependent on whether the
// `nsIShellService` has been queried for the interface implementing it, as
// querying the interface adds it's functions to the queried JS object. This
// is more likely to happen for Firefox Desktop than a Firefox Background
// Task. The fix is to not rely on this behavior on the `nsIShellService`
// directly, and instead query the interface containing the function.
if (target.shellService && name in target.shellService) {
return target.shellService[name];
}
Services.console.logStringMessage(
`${name} not found in ShellService: ${target.shellService}`
lazy.log.warn(
`${name.toString()} not found in ShellService: ${target.shellService}`
);
return undefined;
},

View file

@ -8,6 +8,7 @@ import { css, html } from "lit.all.mjs";
import { MozLitElement } from "toolkit/content/widgets/lit-utils.mjs";
import customElementsManifest from "../custom-elements.json";
import { insertFTLIfNeeded, connectFluent } from "./fluent-utils.mjs";
import chromeMap from "./chrome-map.js";
// Base Fluent set up.
connectFluent();
@ -25,6 +26,33 @@ window.RPMGetFormatURLPref = () => {
/* NOOP */
};
/**
* Function to automatically import reusable components into all stories. This
* helps ensure that components composed of multiple `moz-` elements will render
* correctly, since these elements would otherwise be lazily imported.
*/
function importReusableComponents() {
let sourceMap = chromeMap[2];
let mozElements = new Set();
for (let key of Object.keys(sourceMap)) {
if (
key.startsWith("dist/bin/chrome/toolkit/content/global/elements/moz-") &&
key.endsWith(".mjs")
) {
mozElements.add(key.split("/").pop().replace(".mjs", ""));
}
}
mozElements.forEach(elementName => {
// eslint-disable-next-line no-unsanitized/method
import(`toolkit/content/widgets/${elementName}/${elementName}.mjs`);
});
// Manually import the two components that don't follow our naming conventions.
import("toolkit/content/widgets/panel-list/panel-list.js");
import("toolkit/content/widgets/named-deck.js");
}
importReusableComponents();
/**
* Wrapper component used to decorate all of our stories by providing access to
* `in-content/common.css` without leaking styles that conflict Storybook's CSS.

View file

@ -417,6 +417,8 @@ urlbar-searchmode-history =
.label = History
urlbar-searchmode-actions =
.label = Actions
urlbar-searchmode-exit-button =
.tooltiptext = Close
urlbar-searchmode-popup-description = This time search with:
urlbar-searchmode-popup-search-settings = Search Settings

View file

@ -377,13 +377,13 @@ class TestProvider extends UrlbarTestUtils.TestProvider {
{
name: DISMISS_ONE_COMMAND,
l10n: {
id: "firefox-suggest-weather-command-not-interested",
id: "firefox-suggest-command-not-interested",
},
},
{
name: DISMISS_ALL_COMMAND,
l10n: {
id: "firefox-suggest-weather-command-not-interested",
id: "firefox-suggest-command-not-interested",
},
},
];

View file

@ -440,7 +440,7 @@ add_task(async function test_countryAndStateFieldLabels() {
for (let countryOption of doc.querySelector("#country").options) {
// Clear L10N textContent to not leave leftovers between country tests
for (const labelEl of doc.querySelectorAll(".label-text")) {
doc.l10n.setAttributes(labelEl, "");
delete labelEl.dataset["l10n-id"];
labelEl.textContent = "";
}

View file

@ -145,4 +145,25 @@ add_heuristic_tests([
},
],
},
{
description: "address field matches cc-number as well as address-line1",
fixtureData: `
<html><body><form>
<label for="first-name">First Name</label>
<input id="first-name">
<label for="last-name">Last Name</label>
<input id="last-name">
<label for="a1">Saisir une adresse numero de maison inclus</label>
<input id="a1">
</form></body></html>`,
expectedResult: [
{
fields: [
{ fieldName: "given-name", reason: "regex-heuristic" },
{ fieldName: "family-name", reason: "regex-heuristic" },
{ fieldName: "address-line1", reason: "update-heuristic-alternate" },
],
},
],
},
]);

View file

@ -110,7 +110,7 @@ const TESTCASES = [
description: 'input element with "submit" type',
document: `<input id="targetElement" type="submit" />`,
elementId: "targetElement",
expectedReturnValue: [null, null, null],
expectedReturnValue: [[], null, null],
},
{
description: "The signature in 'name' attr of an email input",
@ -130,7 +130,7 @@ const TESTCASES = [
<input id="targetElement" />
</label>`,
elementId: "targetElement",
expectedReturnValue: [null, null, null],
expectedReturnValue: [[], null, null],
},
{
description: '"County" field with "United State" string',
@ -261,7 +261,7 @@ add_task(async function test_regexp_list() {
elementId: label,
expectedReturnValue: SUPPORT_LIST[label]
? [SUPPORT_LIST[label], null, null]
: [null, null, null],
: [[], null, null],
};
info(testcase.description);
info(testcase.document);
@ -283,7 +283,7 @@ add_task(async function test_autofill_creditCards_autocomplete_off_pref() {
<label for="targetElement"> Card Number</label>
<input id="targetElement" type="text">
</form>`;
let expected = [null, null, null];
let expected = [[], null, null];
info(`Set pref so that credit card autofill respects autocomplete="off"`);
Services.prefs.setBoolPref(
FormAutofill.AUTOFILL_CREDITCARDS_AUTOCOMPLETE_OFF_PREF,
@ -326,7 +326,7 @@ add_task(async function test_autofill_addresses_autocomplete_off_pref() {
let document = `<form autocomplete="off">
<input id="given-name">
</form>`;
let expected = [null, null, null];
let expected = [[], null, null];
info(`Set pref so that address autofill respects autocomplete="off"`);
Services.prefs.setBoolPref(
FormAutofill.AUTOFILL_ADDRESSES_AUTOCOMPLETE_OFF_PREF,

View file

@ -16,7 +16,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"af": {
"pin": false,
@ -35,7 +35,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"an": {
"pin": false,
@ -54,7 +54,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ar": {
"pin": false,
@ -73,7 +73,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ast": {
"pin": false,
@ -92,7 +92,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"az": {
"pin": false,
@ -111,7 +111,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"be": {
"pin": false,
@ -130,7 +130,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"bg": {
"pin": false,
@ -149,7 +149,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"bn": {
"pin": false,
@ -168,7 +168,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"bo": {
"pin": false,
@ -187,7 +187,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"br": {
"pin": false,
@ -206,7 +206,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"brx": {
"pin": false,
@ -225,7 +225,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"bs": {
"pin": false,
@ -244,7 +244,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ca": {
"pin": false,
@ -263,7 +263,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ca-valencia": {
"pin": false,
@ -282,7 +282,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"cak": {
"pin": false,
@ -301,7 +301,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ckb": {
"pin": false,
@ -320,7 +320,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"cs": {
"pin": false,
@ -339,7 +339,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"cy": {
"pin": false,
@ -358,7 +358,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"da": {
"pin": false,
@ -377,7 +377,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"de": {
"pin": false,
@ -396,7 +396,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"dsb": {
"pin": false,
@ -415,7 +415,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"el": {
"pin": false,
@ -434,7 +434,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"en-CA": {
"pin": false,
@ -453,7 +453,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"en-GB": {
"pin": false,
@ -472,7 +472,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"eo": {
"pin": false,
@ -491,7 +491,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"es-AR": {
"pin": false,
@ -510,7 +510,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"es-CL": {
"pin": false,
@ -529,7 +529,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"es-ES": {
"pin": false,
@ -548,7 +548,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"es-MX": {
"pin": false,
@ -567,7 +567,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"et": {
"pin": false,
@ -586,7 +586,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"eu": {
"pin": false,
@ -605,7 +605,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"fa": {
"pin": false,
@ -624,7 +624,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ff": {
"pin": false,
@ -643,7 +643,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"fi": {
"pin": false,
@ -662,7 +662,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"fr": {
"pin": false,
@ -681,7 +681,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"fur": {
"pin": false,
@ -700,7 +700,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"fy-NL": {
"pin": false,
@ -719,7 +719,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ga-IE": {
"pin": false,
@ -738,7 +738,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"gd": {
"pin": false,
@ -757,7 +757,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"gl": {
"pin": false,
@ -776,7 +776,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"gn": {
"pin": false,
@ -795,7 +795,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"gu-IN": {
"pin": false,
@ -814,7 +814,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"he": {
"pin": false,
@ -833,7 +833,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"hi-IN": {
"pin": false,
@ -852,7 +852,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"hr": {
"pin": false,
@ -871,7 +871,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"hsb": {
"pin": false,
@ -890,7 +890,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"hu": {
"pin": false,
@ -909,7 +909,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"hy-AM": {
"pin": false,
@ -928,7 +928,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"hye": {
"pin": false,
@ -947,7 +947,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ia": {
"pin": false,
@ -966,7 +966,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"id": {
"pin": false,
@ -985,7 +985,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"is": {
"pin": false,
@ -1004,7 +1004,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"it": {
"pin": false,
@ -1023,7 +1023,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ja": {
"pin": false,
@ -1040,7 +1040,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ja-JP-mac": {
"pin": false,
@ -1048,7 +1048,7 @@
"macosx64",
"macosx64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ka": {
"pin": false,
@ -1067,7 +1067,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"kab": {
"pin": false,
@ -1086,7 +1086,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"kk": {
"pin": false,
@ -1105,7 +1105,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"km": {
"pin": false,
@ -1124,7 +1124,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"kn": {
"pin": false,
@ -1143,7 +1143,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ko": {
"pin": false,
@ -1162,7 +1162,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"lij": {
"pin": false,
@ -1181,7 +1181,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"lo": {
"pin": false,
@ -1200,7 +1200,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"lt": {
"pin": false,
@ -1219,7 +1219,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ltg": {
"pin": false,
@ -1238,7 +1238,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"lv": {
"pin": false,
@ -1257,7 +1257,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"meh": {
"pin": false,
@ -1276,7 +1276,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"mk": {
"pin": false,
@ -1295,7 +1295,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"mr": {
"pin": false,
@ -1314,7 +1314,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ms": {
"pin": false,
@ -1333,7 +1333,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"my": {
"pin": false,
@ -1352,7 +1352,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"nb-NO": {
"pin": false,
@ -1371,7 +1371,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ne-NP": {
"pin": false,
@ -1390,7 +1390,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"nl": {
"pin": false,
@ -1409,7 +1409,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"nn-NO": {
"pin": false,
@ -1428,7 +1428,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"oc": {
"pin": false,
@ -1447,7 +1447,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"pa-IN": {
"pin": false,
@ -1466,7 +1466,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"pl": {
"pin": false,
@ -1485,7 +1485,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"pt-BR": {
"pin": false,
@ -1504,7 +1504,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"pt-PT": {
"pin": false,
@ -1523,7 +1523,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"rm": {
"pin": false,
@ -1542,7 +1542,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ro": {
"pin": false,
@ -1561,7 +1561,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ru": {
"pin": false,
@ -1580,7 +1580,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"sat": {
"pin": false,
@ -1599,7 +1599,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"sc": {
"pin": false,
@ -1618,7 +1618,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"scn": {
"pin": false,
@ -1637,7 +1637,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"sco": {
"pin": false,
@ -1656,7 +1656,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"si": {
"pin": false,
@ -1675,7 +1675,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"sk": {
"pin": false,
@ -1694,7 +1694,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"skr": {
"pin": false,
@ -1713,7 +1713,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"sl": {
"pin": false,
@ -1732,7 +1732,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"son": {
"pin": false,
@ -1751,7 +1751,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"sq": {
"pin": false,
@ -1770,7 +1770,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"sr": {
"pin": false,
@ -1789,7 +1789,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"sv-SE": {
"pin": false,
@ -1808,7 +1808,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"szl": {
"pin": false,
@ -1827,7 +1827,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ta": {
"pin": false,
@ -1846,7 +1846,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"te": {
"pin": false,
@ -1865,7 +1865,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"tg": {
"pin": false,
@ -1884,7 +1884,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"th": {
"pin": false,
@ -1903,7 +1903,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"tl": {
"pin": false,
@ -1922,7 +1922,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"tr": {
"pin": false,
@ -1941,7 +1941,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"trs": {
"pin": false,
@ -1960,7 +1960,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"uk": {
"pin": false,
@ -1979,7 +1979,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"ur": {
"pin": false,
@ -1998,7 +1998,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"uz": {
"pin": false,
@ -2017,7 +2017,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"vi": {
"pin": false,
@ -2036,7 +2036,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"wo": {
"pin": false,
@ -2055,7 +2055,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"xh": {
"pin": false,
@ -2074,7 +2074,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"zh-CN": {
"pin": false,
@ -2093,7 +2093,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
},
"zh-TW": {
"pin": false,
@ -2112,6 +2112,6 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "1fed28beeb63f3ada537d4aca2d0a6ba22881fb4"
"revision": "b0cd6c5308055980e7e0bac86f62b56f6827b9da"
}
}

View file

@ -543,7 +543,6 @@ class IconLoader {
this.actor.sendAsyncMessage("Link:SetIcon", {
pageURL: iconInfo.pageUri.spec,
originalURL: iconInfo.iconUri.spec,
canUseForTab: !iconInfo.isRichIcon,
expiration: undefined,
iconURL: iconInfo.iconUri.spec,
canStoreIcon:
@ -557,7 +556,7 @@ class IconLoader {
// Let the main process that a tab icon is possibly coming.
this.actor.sendAsyncMessage("Link:LoadingIcon", {
originalURL: iconInfo.iconUri.spec,
canUseForTab: !iconInfo.isRichIcon,
isRichIcon: iconInfo.isRichIcon,
});
try {
@ -567,7 +566,6 @@ class IconLoader {
this.actor.sendAsyncMessage("Link:SetIcon", {
pageURL: iconInfo.pageUri.spec,
originalURL: iconInfo.iconUri.spec,
canUseForTab: !iconInfo.isRichIcon,
expiration,
iconURL: dataURL,
canStoreIcon,
@ -583,7 +581,7 @@ class IconLoader {
// Used mainly for tests currently.
this.actor.sendAsyncMessage("Link:SetFailedIcon", {
originalURL: iconInfo.iconUri.spec,
canUseForTab: !iconInfo.isRichIcon,
isRichIcon: iconInfo.isRichIcon,
});
}
} finally {

View file

@ -697,6 +697,10 @@ tab-group {
/* Tab Overflow */
#tabbrowser-arrowscrollbox {
&[orient="horizontal"] {
min-width: 1px;
}
&:not([scrolledtostart])::part(overflow-start-indicator),
&:not([scrolledtoend])::part(overflow-end-indicator) {
width: 7px; /* The width is the sum of the inline margins */
@ -712,10 +716,6 @@ tab-group {
border-bottom: .5px solid transparent;
}
&[orient="horizontal"] {
min-width: 1px;
}
&:not([scrolledtostart])::part(overflow-start-indicator) {
margin-inline: -.5px -6.5px;
}

View file

@ -0,0 +1,121 @@
diff -Nru valgrind-3.20.0/debian/changelog valgrind-3.20.0/debian/changelog
--- valgrind-3.20.0/debian/changelog 2023-01-11 00:51:40.000000000 +0900
+++ valgrind-3.20.0/debian/changelog 2024-09-10 08:52:50.000000000 +0900
@@ -1,3 +1,9 @@
+valgrind (1:3.20.0-1moz1) UNRELEASED; urgency=medium
+
+ * Apply fix for https://bugs.kde.org/show_bug.cgi?id=492663
+
+ -- Mike Hommey <mhommey@mozilla.com> Tue, 10 Sep 2024 08:52:50 +0900
+
valgrind (1:3.20.0-1) experimental; urgency=medium
* New upstream release.
diff -Nru valgrind-3.20.0/debian/patches/fix-upstream-bug492663 valgrind-3.20.0/debian/patches/fix-upstream-bug492663
--- valgrind-3.20.0/debian/patches/fix-upstream-bug492663 1970-01-01 09:00:00.000000000 +0900
+++ valgrind-3.20.0/debian/patches/fix-upstream-bug492663 2024-09-10 08:52:39.000000000 +0900
@@ -0,0 +1,96 @@
+--- valgrind-3.20.0.orig/coregrind/m_debuginfo/debuginfo.c
++++ valgrind-3.20.0/coregrind/m_debuginfo/debuginfo.c
+@@ -1073,7 +1073,8 @@ static ULong di_notify_ACHIEVE_ACCEPT_ST
+ load_client -> VG_(do_exec) -> VG_(do_exec_inner) ->
+ exe_handlers->load_fn ( == VG_(load_ELF) ).
+
+- This does the mmap'ing and creats the associated NSegments.
++ This does the mmap'ing with VG_(am_do_mmap_NO_NOTIFY)
++ and creates the associated NSegments.
+
+ The NSegments may get merged, (see maybe_merge_nsegments)
+ so there could be more PT_LOADs than there are NSegments.
+@@ -1124,7 +1125,7 @@ static ULong di_notify_ACHIEVE_ACCEPT_ST
+ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV, Int use_fd )
+ {
+ NSegment const * seg;
+- Int rw_load_count;
++ Int expected_rw_load_count;
+ const HChar* filename;
+ Bool is_rx_map, is_rw_map, is_ro_map;
+
+@@ -1348,9 +1349,9 @@ ULong VG_(di_notify_mmap)( Addr a, Bool
+ /* We're only interested in mappings of object files. */
+ # if defined(VGO_linux) || defined(VGO_solaris) || defined(VGO_freebsd)
+
+- rw_load_count = 0;
++ expected_rw_load_count = 0;
+
+- elf_ok = ML_(check_elf_and_get_rw_loads) ( actual_fd, filename, &rw_load_count );
++ elf_ok = ML_(check_elf_and_get_rw_loads) ( actual_fd, filename, &expected_rw_load_count, use_fd == -1 );
+
+ if (use_fd == -1) {
+ VG_(close)( actual_fd );
+@@ -1363,7 +1364,7 @@ ULong VG_(di_notify_mmap)( Addr a, Bool
+ # elif defined(VGO_darwin)
+ if (!ML_(is_macho_object_file)( buf1k, (SizeT)sr_Res(preadres) ))
+ return 0;
+- rw_load_count = 1;
++ expected_rw_load_count = 1;
+ # else
+ # error "unknown OS"
+ # endif
+@@ -1423,8 +1424,8 @@ ULong VG_(di_notify_mmap)( Addr a, Bool
+ /* So, finally, are we in an accept state? */
+ vg_assert(!di->have_dinfo);
+ if (di->fsm.have_rx_map &&
+- rw_load_count >= 1 &&
+- di->fsm.rw_map_count == rw_load_count) {
++ expected_rw_load_count >= 1 &&
++ di->fsm.rw_map_count == expected_rw_load_count) {
+ /* Ok, so, finally, we found what we need, and we haven't
+ already read debuginfo for this object. So let's do so now.
+ Yee-ha! */
+@@ -1437,7 +1438,8 @@ ULong VG_(di_notify_mmap)( Addr a, Bool
+ /* If we don't have an rx and rw mapping, go no further. */
+ if (debug)
+ VG_(dmsg)("di_notify_mmap-6: "
+- "no dinfo loaded %s (no rx or no rw mapping)\n", filename);
++ "no dinfo loaded %s (no rx or rw mappings (%d) not reached expected count (%d))\n",
++ filename, di->fsm.rw_map_count, expected_rw_load_count);
+ return 0;
+ }
+ }
+--- valgrind-3.20.0.orig/coregrind/m_debuginfo/priv_readelf.h
++++ valgrind-3.20.0/coregrind/m_debuginfo/priv_readelf.h
+@@ -52,7 +52,8 @@ extern Bool ML_(is_elf_object_file)( con
+ */
+ extern Bool ML_(read_elf_debug_info) ( DebugInfo* di );
+
+-extern Bool ML_(check_elf_and_get_rw_loads) ( Int fd, const HChar* filename, Int * rw_load_count );
++extern Bool ML_(check_elf_and_get_rw_loads) ( Int fd, const HChar* filename,
++ Int * rw_load_count, Bool from_nsegments );
+
+
+ #endif /* ndef __PRIV_READELF_H */
+--- valgrind-3.20.0.orig/coregrind/m_debuginfo/readelf.c
++++ valgrind-3.20.0/coregrind/m_debuginfo/readelf.c
+@@ -3650,7 +3650,8 @@ Bool ML_(read_elf_debug_info) ( struct _
+ /* NOTREACHED */
+ }
+
+-Bool ML_(check_elf_and_get_rw_loads) ( Int fd, const HChar* filename, Int * rw_load_count )
++Bool ML_(check_elf_and_get_rw_loads) ( Int fd, const HChar* filename,
++ Int * rw_load_count, Bool from_nsegments )
+ {
+ Bool res, ok;
+ UWord i;
+@@ -3719,7 +3720,7 @@ Bool ML_(check_elf_and_get_rw_loads) ( I
+ * second PT_LOAD falls exactly on 0x1000) then the NSegements
+ * will get merged and VG_(di_notify_mmap) only gets called once. */
+ if (*rw_load_count == 2 &&
+- ehdr_m.e_type == ET_EXEC &&
++ from_nsegments &&
+ a_phdr.p_offset == VG_PGROUNDDN(a_phdr.p_offset) )
+ {
+ *rw_load_count = 1;
diff -Nru valgrind-3.20.0/debian/patches/series valgrind-3.20.0/debian/patches/series
--- valgrind-3.20.0/debian/patches/series 2022-11-11 00:49:21.000000000 +0900
+++ valgrind-3.20.0/debian/patches/series 2024-09-10 08:52:21.000000000 +0900
@@ -7,3 +7,4 @@
11_arm64-cache-flush.patch
13_fix-path-to-vgdb.patch
armhf_neon.patch
+fix-upstream-bug492663

View file

@ -70,10 +70,11 @@ set_config("MOZ_REPLACE_MALLOC_STATIC", replace_malloc_static)
# crash reporter.
@depends(
build_project,
milestone,
target,
when="--enable-jemalloc",
)
def phc_default(build_project, target):
def phc_default(build_project, milestone, target):
if build_project == "js":
return False
@ -85,6 +86,7 @@ def phc_default(build_project, target):
(target.os == "GNU" and target.kernel == "Linux")
or (target.kernel == "WINNT")
or (target.os == "OSX")
or (target.os == "Android" and milestone.is_early_beta_or_earlier)
)

View file

@ -18,7 +18,7 @@ src:*/media/libvpx/libvpx/vp8/encoder/encodeframe.c
src:*/third_party/aom/av1/common/quant_common.c
# crashtest
src:*/parser/expat/lib/xmlparse.c
src:*/mfbt/lz4/lz4.c
src:*/mozglue/static/lz4/lz4.c
src:*/media/libogg/src/ogg_framing.c
# mochitest gl2c dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-pack-parameters.html
src:*/dom/canvas/WebGLContextGL.cpp

View file

@ -112,7 +112,7 @@ src:*/modules/zlib/src/*
# Our LZ4 implementation uses overflows. By listing it here we might
# miss some unintended overflows in that implementation, but we can't
# check for it right now.
src:*/mfbt/lz4.c
src:*/mozglue/static/lz4/lz4.c
# Apparently this overflows a lot, because it contains some allocators
# that keep overflowing, not sure why. Disabling by function didn't seem

View file

@ -119,7 +119,7 @@ src:*/modules/zlib/src/*
# Our LZ4 implementation uses overflows. By listing it here we might
# miss some unintended overflows in that implementation, but we can't
# check for it right now.
src:*/mfbt/lz4/*
src:*/mozglue/static/lz4/*
# Apparently this overflows a lot, because it contains some allocators
# that keep overflowing, not sure why. Disabling by function didn't seem

View file

@ -22,7 +22,8 @@ add_task(async function () {
);
const URL_IFRAME = buildURLWithContent(
"example.org",
`<h1>example.org</h1>` + `<script>document.cookie = "hello=world";</script>`
`<h1>example.org</h1>` +
`<script>document.cookie = "hello=world; SameSite=None; Secure; Partitioned;";</script>`
);
// open tab

View file

@ -69,13 +69,21 @@ async function setPartitionedStorage(browser, type, key) {
content.localStorage.setItem(storageKey, storageValue);
};
const thirdPartyHandler = async (storageType, storageKey, storageValue) => {
if (storageType == "cookie") {
content.document.cookie = `${storageKey}=${storageValue}; SameSite=None; Secure; Partitioned;`;
return;
}
content.localStorage.setItem(storageKey, storageValue);
};
// Set first party storage.
await SpecialPowers.spawn(browser, [type, key, "first"], handler);
// Set third-party (partitioned) storage in the iframe.
await SpecialPowers.spawn(
browser.browsingContext.children[0],
[type, key, "third"],
handler
thirdPartyHandler
);
}

View file

@ -4,30 +4,18 @@
:root {
--badge-active-background-color: var(--blue-60);
--badge-active-border-color: #FFFFFFB3;
--badge-background-color: white;
--badge-border-color: #CACAD1;
--badge-color: var(--grey-60);
--badge-hover-background-color: #DFDFE8;
--badge-interactive-background-color: var(--grey-20);
--badge-interactive-color: var(--grey-90);
--badge-scrollable-color: #8000D7;
--badge-scrollable-background-color: #FFFFFF;
--badge-active-border-color: light-dark(rgba(255, 255, 255, 0.7), #FFF6);
--badge-background-color: light-dark(white, var(--grey-80));
--badge-border-color: light-dark(#CACAD1, var(--grey-50));
--badge-color: light-dark(var(--grey-60), var(--grey-40));
--badge-hover-background-color: light-dark(#DFDFE8, var(--grey-80));
--badge-interactive-background-color: light-dark(var(--grey-20), var(--grey-70));
--badge-interactive-color: light-dark(var(--grey-90), var(--grey-30));
--badge-scrollable-color: light-dark(#8000D7, #B98EFF);
--badge-scrollable-background-color: light-dark(#FFFFFF, var(--badge-interactive-background-color));
--badge-scrollable-active-background-color: #8000D7;
}
.theme-dark:root {
--badge-active-border-color: #FFF6;
--badge-background-color: var(--grey-80);
--badge-border-color: var(--grey-50);
--badge-color: var(--grey-40);
--badge-hover-background-color: var(--grey-80);
--badge-interactive-background-color: var(--grey-70);
--badge-interactive-color: var(--grey-30);
--badge-scrollable-color: #B98EFF;
--badge-scrollable-background-color: var(--badge-interactive-background-color);
}
/* Inspector badge */
.inspector-badge,
.editor.text .whitespace::before,

View file

@ -15,8 +15,23 @@
--tab-line-hover-color: rgba(0,0,0,.2);
--tab-line-selected-color: var(--blue-50);
--toggle-thumb-color: white;
--toggle-thumb-color: light-dark(white, var(--grey-40));
--toggle-thumb-color-pressed: white;
--toggle-track-color: var(--grey-50);
--toggle-track-color-pressed: var(--blue-55);
--toggle-track-border-color: transparent;
/* In regular themes, the disabled style is handled by the lowered opacity,
the colors fall back to their "default" values */
--toggle-disabled-track-border-color: var(--toggle-track-border-color);
--toggle-disabled-track-color-pressed: var(--toggle-track-color-pressed);
--toggle-disabled-thumb-color: var(--toggle-disabled-thumb-color);
--toggle-track-disabled-opacity: 0.5;
/* We don't have distinct :hover style in regular themes, the colors fall back to their
"default" values */
--toggle-hover-track-color: var(--toggle-track-color);
--toggle-hover-track-border-color: var(--toggle-track-border-color);
--toggle-hover-track-color-pressed: var(--toggle-track-color-pressed);
--toggle-hover-thumb-color: var(--toggle-thumb-color);
--searchbox-no-match-background-color: #ffe5e5;
--searchbox-no-match-stroke-color: var(--red-60);
@ -25,6 +40,25 @@
&:not([forced-colors-active]) {
forced-color-adjust: none;
}
/* Forced Colors / High Contrast Mode specifics */
&[forced-colors-active] {
--toggle-track-color: ButtonFace;
--toggle-track-color-pressed: ButtonText;
--toggle-thumb-color: ButtonText;
--toggle-thumb-color-pressed: ButtonFace;
--toggle-track-border-color: ButtonText;
--toggle-hover-track-color: SelectedItemText;
--toggle-hover-track-border-color: SelectedItem;
--toggle-hover-track-color-pressed: SelectedItem;
--toggle-hover-thumb-color: SelectedItem;
/* In High Contrast Mode, the opacity is not lowered, so the disabled style is
handled by modifiying the colors */
--toggle-disabled-track-border-color: GrayText;
--toggle-disabled-track-color-pressed: GrayText;
--toggle-disabled-thumb-color: GrayText;
--toggle-track-disabled-opacity: 1;
}
}
:root.theme-light {
@ -35,8 +69,6 @@
color-scheme: dark;
--tab-line-hover-color: rgba(255,255,255,.2);
--toggle-thumb-color: var(--grey-40);
--searchbox-no-match-background-color: #402325;
--searchbox-no-match-stroke-color: var(--red-50);
}
@ -722,26 +754,43 @@ iframe {
width: 2em;
height: 1em;
border-radius: 1em;
border: 1px solid transparent;
border: 1px solid var(--toggle-track-border-color);
box-sizing: content-box;
/* Animate the thumb position between states of the checkbox. */
/* Animate the background color between states of the checkbox. */
transition: background-color .1s ease-out;
&:checked {
--x-pos: 1.15em;
background-color: var(--toggle-track-color-pressed);
}
&:hover:not(:active, [disabled]) {
background-color: var(--toggle-hover-track-color);
border-color: var(--toggle-hover-track-border-color);
&:checked {
background-color: var(--toggle-hover-track-color-pressed);
}
&:not(:checked)::before {
background-color: var(--toggle-hover-thumb-color);
}
}
&[disabled] {
opacity: var(--toggle-track-disabled-opacity);
--toggle-track-border-color: var(--toggle-disabled-track-border-color);
--toggle-track-color-pressed: var(--toggle-disabled-track-color-pressed);
--toggle-thumb-color: var(--toggle-disabled-thumb-color);
}
}
.devtools-checkbox-toggle[disabled]{
opacity: 0.5;
}
/* For right-to-left layout, the toggle thumb goes in the opposite direction. */
html[dir="rtl"] .devtools-checkbox-toggle {
--x-pos: -.15em;
}
.devtools-checkbox-toggle:checked {
--x-pos: 1.15em;
background-color: var(--blue-55);
}
html[dir="rtl"] .devtools-checkbox-toggle:checked {
--x-pos: -1.15em;
}
@ -759,5 +808,13 @@ html[dir="rtl"] .devtools-checkbox-toggle:checked {
}
.devtools-checkbox-toggle:checked::before {
background-color: white;
background-color: var(--toggle-thumb-color-pressed);
}
/* Remove transition on toggle when prefers reduced motion is enabled */
@media (prefers-reduced-motion) {
.devtools-checkbox-toggle,
.devtools-checkbox-toggle::before {
transition: none;
}
}

View file

@ -3,30 +3,19 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
:root {
--markup-hidden-attr-name-color: var(--grey-43);
--markup-hidden-attr-value-color: var(--grey-55);
--markup-hidden-punctuation-color: var(--grey-43);
--markup-hidden-attr-name-color: light-dark(var(--grey-43), #787878);
--markup-hidden-attr-value-color: light-dark(var(--grey-55), #a4a4a4);
--markup-hidden-punctuation-color: light-dark(var(--grey-43), #787878);
--markup-pseudoclass-disk-color: #e9c600;
--markup-hidden-tag-color: var(--grey-50);
--markup-outline: var(--theme-splitter-color);
--markup-drag-line: var(--grey-40);
--markup-drop-line: var(--blue-55);
--markup-overflow-causing-background-color: rgba(128, 0, 215, 0.15);
--markup-hidden-tag-color: light-dark(var(--grey-50), var(--grey-45));
--markup-outline: light-dark(var(--theme-splitter-color), var(--theme-selection-background));
--markup-drag-line: light-dark(var(--grey-40), var(--grey-55));
--markup-drop-line: light-dark(var(--blue-55), var(--blue-50));
--markup-overflow-causing-background-color: light-dark(rgba(128, 0, 215, 0.15), rgba(148, 0, 255, 0.38));
--markup-new-attr-size: 2ch;
--markup-new-attr-focused-margin-inline: 1ch 2px;
}
.theme-dark:root {
--markup-hidden-attr-name-color: #787878;
--markup-hidden-attr-value-color: #a4a4a4;
--markup-hidden-punctuation-color: #787878;
--markup-hidden-tag-color: var(--grey-45);
--markup-outline: var(--theme-selection-background);
--markup-drag-line: var(--grey-55);
--markup-drop-line: var(--blue-50);
--markup-overflow-causing-background-color: rgba(148, 0, 255, 0.38);
}
* {
padding: 0;
margin: 0;

View file

@ -9271,6 +9271,8 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
// XXXbz mTiming should know what channel it's for, so we don't
// need this hackery.
const bool isJavaScript = SchemeIsJavascript(aLoadState->URI());
const bool isExternalProtocol =
nsContentUtils::IsExternalProtocol(aLoadState->URI());
const bool isDownload = !aLoadState->FileName().IsVoid();
const bool toBeReset = !isJavaScript && MaybeInitTiming();
@ -9281,6 +9283,9 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
}
// Check if the page doesn't want to be unloaded. The javascript:
// protocol handler deals with this for javascript: URLs.
// NOTE(emilio): As of this writing, other browsers fire beforeunload for
// external protocols, so keep doing that even though they don't return data
// and thus we won't really unload this...
if (!isJavaScript && !isDownload &&
!aLoadState->NotifiedBeforeUnloadListeners() && mDocumentViewer) {
// Check if request is exempted from HTTPSOnlyMode and if https-first is
@ -9380,7 +9385,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
// In the case where they do result in data, the javascript: URL channel takes
// care of stopping current network activity. Similarly, downloads don't
// unload this document...
if (!isJavaScript && !isDownload) {
if (!isJavaScript && !isDownload && !isExternalProtocol) {
// Stop any current network activity.
// Also stop content if this is a zombie doc. otherwise
// the onload will be delayed by other loads initiated in the

View file

@ -299,7 +299,7 @@ nsDOMAttributeMap* Element::Attributes() {
}
void Element::SetPointerCapture(int32_t aPointerId, ErrorResult& aError) {
if (OwnerDoc()->ShouldResistFingerprinting(RFPTarget::PointerEvents) &&
if (OwnerDoc()->ShouldResistFingerprinting(RFPTarget::PointerId) &&
aPointerId != PointerEventHandler::GetSpoofedPointerIdForRFP()) {
aError.ThrowNotFoundError("Invalid pointer id");
return;
@ -328,7 +328,7 @@ void Element::SetPointerCapture(int32_t aPointerId, ErrorResult& aError) {
}
void Element::ReleasePointerCapture(int32_t aPointerId, ErrorResult& aError) {
if (OwnerDoc()->ShouldResistFingerprinting(RFPTarget::PointerEvents) &&
if (OwnerDoc()->ShouldResistFingerprinting(RFPTarget::PointerId) &&
aPointerId != PointerEventHandler::GetSpoofedPointerIdForRFP()) {
aError.ThrowNotFoundError("Invalid pointer id");
return;

View file

@ -886,7 +886,7 @@ uint32_t Navigator::MaxTouchPoints(CallerType aCallerType) {
if (aCallerType != CallerType::System &&
nsContentUtils::ShouldResistFingerprinting(GetDocShell(),
RFPTarget::PointerEvents)) {
return 0;
return SPOOFED_MAX_TOUCH_POINTS;
}
nsCOMPtr<nsIWidget> widget =

View file

@ -3,8 +3,11 @@
onbeforeunload = function() {
opener.onChildBeforeUnload();
};
onload = function() {
onload = async function() {
let ongoingLoad = fetch(location.href);
location.href = "this-protocol-is-unlikely-to-exist://foo";
// Load shouldn't be canceled.
await ongoingLoad;
setTimeout(function() {
opener.onChildLoadTimedOut();
}, 1000);

View file

@ -744,6 +744,12 @@ void ClientWebGLContext::SetDrawingBufferColorSpace(
Run<RPROC(SetDrawingBufferColorSpace)>(*mDrawingBufferColorSpace);
}
void ClientWebGLContext::SetUnpackColorSpace(
const dom::PredefinedColorSpace val) {
mUnpackColorSpace = val;
Run<RPROC(SetUnpackColorSpace)>(*mUnpackColorSpace);
}
void ClientWebGLContext::GetContextAttributes(
dom::Nullable<dom::WebGLContextAttributes>& retval) {
retval.SetNull();
@ -4423,10 +4429,18 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
const auto sdType = sd.type();
const auto& contextInfo = mNotLost->info;
// TODO (Bug 754256): Figure out the source colorSpace.
const auto& webgl = this;
dom::PredefinedColorSpace srcColorSpace = dom::PredefinedColorSpace::Srgb;
dom::PredefinedColorSpace dstColorSpace =
webgl->mUnpackColorSpace ? *webgl->mUnpackColorSpace
: dom::PredefinedColorSpace::Srgb;
bool sameColorSpace = (srcColorSpace == dstColorSpace);
const auto fallbackReason = [&]() -> Maybe<std::string> {
auto fallbackReason =
BlitPreventReason(level, offset, respecFormat, pi, *desc,
contextInfo.optionalRenderableFormatBits);
auto fallbackReason = BlitPreventReason(
level, offset, respecFormat, pi, *desc,
contextInfo.optionalRenderableFormatBits, sameColorSpace);
if (fallbackReason) return fallbackReason;
const bool canUploadViaSd = contextInfo.uploadableSdTypes[sdType];

View file

@ -1057,6 +1057,7 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal,
private:
std::optional<dom::PredefinedColorSpace> mDrawingBufferColorSpace;
std::optional<dom::PredefinedColorSpace> mUnpackColorSpace;
public:
auto DrawingBufferColorSpace() const {
@ -1065,6 +1066,12 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal,
}
void SetDrawingBufferColorSpace(dom::PredefinedColorSpace);
auto UnpackColorSpace() const {
return mUnpackColorSpace ? *mUnpackColorSpace
: dom::PredefinedColorSpace::Srgb;
}
void SetUnpackColorSpace(dom::PredefinedColorSpace);
// -
void GetContextAttributes(dom::Nullable<dom::WebGLContextAttributes>& retval);

View file

@ -204,6 +204,9 @@ class HostWebGLContext final : public SupportsWeakPtr {
void SetDrawingBufferColorSpace(const dom::PredefinedColorSpace val) const {
mContext->SetDrawingBufferColorSpace(val);
}
void SetUnpackColorSpace(const dom::PredefinedColorSpace val) const {
mContext->SetUnpackColorSpace(val);
}
void Resize(const uvec2& size) { return mContext->Resize(size); }
uvec2 DrawingBufferSize() { return mContext->DrawingBufferSize(); }

View file

@ -408,6 +408,12 @@ bool TexUnpackBlob::ConvertIfNeeded(
dstOrigin = srcOrigin;
}
// TODO (Bug 754256): Figure out the source colorSpace.
dom::PredefinedColorSpace srcColorSpace = dom::PredefinedColorSpace::Srgb;
dom::PredefinedColorSpace dstColorSpace =
webgl->mUnpackColorSpace ? *webgl->mUnpackColorSpace
: dom::PredefinedColorSpace::Srgb;
if (srcFormat != dstFormat) {
webgl->GeneratePerfWarning(
"Conversion requires pixel reformatting. (%u->%u)", uint32_t(srcFormat),
@ -421,6 +427,10 @@ bool TexUnpackBlob::ConvertIfNeeded(
} else if (srcStride != dstStride) {
webgl->GeneratePerfWarning("Conversion requires change in stride. (%u->%u)",
uint32_t(srcStride), uint32_t(dstStride));
} else if (srcColorSpace != dstColorSpace) {
webgl->GeneratePerfWarning(
"Conversion requires colorSpace conversion. (%u->%u)",
uint32_t(srcColorSpace), uint32_t(dstColorSpace));
} else {
return true;
}
@ -446,7 +456,8 @@ bool TexUnpackBlob::ConvertIfNeeded(
bool wasTrivial;
if (!ConvertImage(rowLength, rowCount, srcBegin, srcStride, srcOrigin,
srcFormat, srcIsPremult, dstBegin, dstStride, dstOrigin,
dstFormat, dstIsPremult, &wasTrivial)) {
dstFormat, dstIsPremult, srcColorSpace, dstColorSpace,
&wasTrivial)) {
webgl->ErrorImplementationBug("ConvertImage failed.");
return false;
}
@ -673,7 +684,8 @@ bool TexUnpackImage::Validate(const WebGLContext* const webgl,
Maybe<std::string> BlitPreventReason(
const int32_t level, const ivec3& offset, const GLenum internalFormat,
const webgl::PackingInfo& pi, const TexUnpackBlobDesc& desc,
const OptionalRenderableFormatBits optionalRenderableFormatBits) {
const OptionalRenderableFormatBits optionalRenderableFormatBits,
bool sameColorSpace) {
const auto& size = desc.size;
const auto& unpacking = desc.unpacking;
@ -704,6 +716,10 @@ Maybe<std::string> BlitPreventReason(
}();
if (premultReason) return premultReason;
if (!sameColorSpace) {
return "not same colorSpace";
}
const auto formatReason = [&]() -> const char* {
if (pi.type != LOCAL_GL_UNSIGNED_BYTE) {
return "`unpackType` must be `UNSIGNED_BYTE`";
@ -800,9 +816,16 @@ bool TexUnpackImage::TexOrSubImage(bool isSubImage, bool needsRespec,
// -
const auto reason =
BlitPreventReason(level, {xOffset, yOffset, zOffset}, dui->internalFormat,
pi, mDesc, webgl->mOptionalRenderableFormatBits);
// TODO (Bug 754256): Figure out the source colorSpace.
dom::PredefinedColorSpace srcColorSpace = dom::PredefinedColorSpace::Srgb;
dom::PredefinedColorSpace dstColorSpace =
webgl->mUnpackColorSpace ? *webgl->mUnpackColorSpace
: dom::PredefinedColorSpace::Srgb;
bool sameColorSpace = (srcColorSpace == dstColorSpace);
const auto reason = BlitPreventReason(
level, {xOffset, yOffset, zOffset}, dui->internalFormat, pi, mDesc,
webgl->mOptionalRenderableFormatBits, sameColorSpace);
if (reason) {
webgl->GeneratePerfWarning(
"Failed to hit GPU-copy fast-path."

View file

@ -45,7 +45,8 @@ Maybe<std::string> BlitPreventReason(int32_t level, const ivec3& offset,
GLenum internalFormat,
const webgl::PackingInfo&,
const TexUnpackBlobDesc&,
OptionalRenderableFormatBits);
OptionalRenderableFormatBits,
bool sameColorSpace);
class TexUnpackBlob {
public:

View file

@ -549,12 +549,17 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr {
const bool webvr);
std::optional<dom::PredefinedColorSpace> mDrawingBufferColorSpace;
std::optional<dom::PredefinedColorSpace> mUnpackColorSpace;
std::optional<color::ColorProfileDesc> mDisplayProfile;
void SetDrawingBufferColorSpace(const dom::PredefinedColorSpace val) {
mDrawingBufferColorSpace = val;
}
void SetUnpackColorSpace(const dom::PredefinedColorSpace val) {
mUnpackColorSpace = val;
}
void ClearVRSwapChain();
void RunContextLossTimer();

View file

@ -94,6 +94,7 @@ DEFINE_ASYNC(HostWebGLContext::Present)
DEFINE_ASYNC(HostWebGLContext::SampleCoverage)
DEFINE_ASYNC(HostWebGLContext::Scissor)
DEFINE_ASYNC(HostWebGLContext::SetDrawingBufferColorSpace)
DEFINE_ASYNC(HostWebGLContext::SetUnpackColorSpace)
DEFINE_ASYNC(HostWebGLContext::ShaderSource)
DEFINE_ASYNC(HostWebGLContext::StencilFuncSeparate)
DEFINE_ASYNC(HostWebGLContext::StencilMaskSeparate)

View file

@ -4,6 +4,7 @@
#include "WebGLContext.h"
#include "WebGLTexelConversions.h"
#include "GLBlitHelper.h"
namespace mozilla {
@ -82,7 +83,9 @@ class WebGLImageConverter {
* generating useless code.
*/
template <WebGLTexelFormat SrcFormat, WebGLTexelFormat DstFormat,
WebGLTexelPremultiplicationOp PremultiplicationOp>
WebGLTexelPremultiplicationOp PremultiplicationOp,
dom::PredefinedColorSpace SrcColorSpace,
dom::PredefinedColorSpace DstColorSpace>
void run() {
// check for never-called cases. We early-return to allow the compiler
// to avoid generating this code. It would be tempting to abort() instead,
@ -92,8 +95,11 @@ class WebGLImageConverter {
// the caller must check that and abort in that case. See
// WebGLContext::ConvertImage.
bool sameColorSpace = (SrcColorSpace == DstColorSpace);
if (SrcFormat == DstFormat &&
PremultiplicationOp == WebGLTexelPremultiplicationOp::None) {
PremultiplicationOp == WebGLTexelPremultiplicationOp::None &&
sameColorSpace) {
// Should have used a fast exit path earlier, rather than entering this
// function. we explicitly return here to allow the compiler to avoid
// generating this code
@ -184,23 +190,49 @@ class WebGLImageConverter {
const SrcType* srcRowStart = static_cast<const SrcType*>(mSrcStart);
DstType* dstRowStart = static_cast<DstType*>(mDstStart);
static auto inColorSpace2 = gfx::ToColorSpace2(SrcColorSpace);
static auto outColorSpace2 = gfx::ToColorSpace2(DstColorSpace);
auto inColorProfile = gl::GLBlitHelper::ToColorProfileDesc(inColorSpace2);
auto outColorProfile = gl::GLBlitHelper::ToColorProfileDesc(outColorSpace2);
const auto conversion = color::ColorProfileConversionDesc::From({
.src = *inColorProfile,
.dst = *outColorProfile,
});
// the loop performing the texture format conversion
for (size_t i = 0; i < mHeight; ++i) {
const SrcType* srcRowEnd = srcRowStart + mWidth * NumElementsPerSrcTexel;
const SrcType* srcPtr = srcRowStart;
DstType* dstPtr = dstRowStart;
while (srcPtr != srcRowEnd) {
// convert a single texel. We proceed in 3 steps: unpack the source
// convert a single texel. We proceed in 4 steps: unpack the source
// texel so the corresponding interchange format (e.g. unpack RGB565 to
// RGBA8), convert the resulting data type to the destination type (e.g.
// convert from RGBA8 to RGBA32F), and finally pack the destination
// texel (e.g. pack RGBA32F to RGB32F).
// RGBA8), do colorSpace conversion if necessary, convert the resulting
// data type to the destination type (e.g. convert from RGBA8 to
// RGBA32F), and finally pack the destination texel (e.g. pack RGBA32F
// to RGB32F).
IntermediateSrcType unpackedSrc[MaxElementsPerTexel];
IntermediateDstType unpackedDst[MaxElementsPerTexel];
// unpack a src texel to corresponding intermediate src format.
// for example, unpack RGB565 to RGBA8
unpack<SrcFormat>(srcPtr, unpackedSrc);
if (!sameColorSpace) {
// do colorSpace conversion, which leaves alpha untouched
float srcAsFloat[MaxElementsPerTexel];
convertType(unpackedSrc, srcAsFloat);
auto inTexelVec =
color::vec3({srcAsFloat[0], srcAsFloat[1], srcAsFloat[2]});
auto outTexelVec = conversion.DstFromSrc(inTexelVec);
srcAsFloat[0] = outTexelVec[0];
srcAsFloat[1] = outTexelVec[1];
srcAsFloat[2] = outTexelVec[2];
convertType(srcAsFloat, unpackedSrc);
}
// convert the data type to the destination type, if needed.
// for example, convert RGBA8 to RGBA32F
convertType(unpackedSrc, unpackedDst);
@ -218,11 +250,54 @@ class WebGLImageConverter {
mSuccess = true;
}
template <WebGLTexelFormat SrcFormat, WebGLTexelFormat DstFormat,
WebGLTexelPremultiplicationOp PremultiplicationOp,
dom::PredefinedColorSpace SrcColorSpace>
void run(dom::PredefinedColorSpace dstColorSpace) {
#define WEBGLIMAGECONVERTER_CASE_DSTCOLORSPACE(DstColorSpace) \
case DstColorSpace: \
return run<SrcFormat, DstFormat, PremultiplicationOp, SrcColorSpace, \
DstColorSpace>();
switch (dstColorSpace) {
WEBGLIMAGECONVERTER_CASE_DSTCOLORSPACE(dom::PredefinedColorSpace::Srgb)
WEBGLIMAGECONVERTER_CASE_DSTCOLORSPACE(
dom::PredefinedColorSpace::Display_p3)
default:
MOZ_ASSERT(false, "unhandled case. Coding mistake?");
}
#undef WEBGLIMAGECONVERTER_CASE_DSTCOLORSPACE
}
template <WebGLTexelFormat SrcFormat, WebGLTexelFormat DstFormat,
WebGLTexelPremultiplicationOp PremultiplicationOp>
void run(dom::PredefinedColorSpace srcColorSpace,
dom::PredefinedColorSpace dstColorSpace) {
#define WEBGLIMAGECONVERTER_CASE_SRCCOLORSPACE(SrcColorSpace) \
case SrcColorSpace: \
return run<SrcFormat, DstFormat, PremultiplicationOp, SrcColorSpace>( \
dstColorSpace);
switch (srcColorSpace) {
WEBGLIMAGECONVERTER_CASE_SRCCOLORSPACE(dom::PredefinedColorSpace::Srgb)
WEBGLIMAGECONVERTER_CASE_SRCCOLORSPACE(
dom::PredefinedColorSpace::Display_p3)
default:
MOZ_ASSERT(false, "unhandled case. Coding mistake?");
}
#undef WEBGLIMAGECONVERTER_CASE_SRCCOLORSPACE
}
template <WebGLTexelFormat SrcFormat, WebGLTexelFormat DstFormat>
void run(WebGLTexelPremultiplicationOp premultiplicationOp) {
void run(WebGLTexelPremultiplicationOp premultiplicationOp,
dom::PredefinedColorSpace srcColorSpace,
dom::PredefinedColorSpace dstColorSpace) {
#define WEBGLIMAGECONVERTER_CASE_PREMULTIPLICATIONOP(PremultiplicationOp) \
case PremultiplicationOp: \
return run<SrcFormat, DstFormat, PremultiplicationOp>();
return run<SrcFormat, DstFormat, PremultiplicationOp>(srcColorSpace, \
dstColorSpace);
switch (premultiplicationOp) {
WEBGLIMAGECONVERTER_CASE_PREMULTIPLICATIONOP(
@ -240,10 +315,13 @@ class WebGLImageConverter {
template <WebGLTexelFormat SrcFormat>
void run(WebGLTexelFormat dstFormat,
WebGLTexelPremultiplicationOp premultiplicationOp) {
#define WEBGLIMAGECONVERTER_CASE_DSTFORMAT(DstFormat) \
case DstFormat: \
return run<SrcFormat, DstFormat>(premultiplicationOp);
WebGLTexelPremultiplicationOp premultiplicationOp,
dom::PredefinedColorSpace srcColorSpace,
dom::PredefinedColorSpace dstColorSpace) {
#define WEBGLIMAGECONVERTER_CASE_DSTFORMAT(DstFormat) \
case DstFormat: \
return run<SrcFormat, DstFormat>(premultiplicationOp, srcColorSpace, \
dstColorSpace);
switch (dstFormat) {
// 1-channel formats
@ -283,10 +361,13 @@ class WebGLImageConverter {
public:
void run(WebGLTexelFormat srcFormat, WebGLTexelFormat dstFormat,
WebGLTexelPremultiplicationOp premultiplicationOp) {
#define WEBGLIMAGECONVERTER_CASE_SRCFORMAT(SrcFormat) \
case SrcFormat: \
return run<SrcFormat>(dstFormat, premultiplicationOp);
WebGLTexelPremultiplicationOp premultiplicationOp,
dom::PredefinedColorSpace srcColorSpace,
dom::PredefinedColorSpace dstColorSpace) {
#define WEBGLIMAGECONVERTER_CASE_SRCFORMAT(SrcFormat) \
case SrcFormat: \
return run<SrcFormat>(dstFormat, premultiplicationOp, srcColorSpace, \
dstColorSpace);
switch (srcFormat) {
// 1-channel formats
@ -343,6 +424,8 @@ bool ConvertImage(size_t width, size_t height, const void* srcBegin,
WebGLTexelFormat srcFormat, bool srcPremultiplied,
void* dstBegin, size_t dstStride, gl::OriginPos dstOrigin,
WebGLTexelFormat dstFormat, bool dstPremultiplied,
dom::PredefinedColorSpace srcColorSpace,
dom::PredefinedColorSpace dstColorSpace,
bool* const out_wasTrivial) {
*out_wasTrivial = true;
@ -378,8 +461,10 @@ bool ConvertImage(size_t width, size_t height, const void* srcBegin,
dstItrStride = -dstItrStride;
}
bool sameColorSpace = (srcColorSpace == dstColorSpace);
if (srcFormat == dstFormat &&
premultOp == WebGLTexelPremultiplicationOp::None) {
premultOp == WebGLTexelPremultiplicationOp::None && sameColorSpace) {
// Fast exit path: we just have to memcpy all the rows.
const auto bytesPerPixel = TexelBytesForFormat(srcFormat);
@ -397,8 +482,7 @@ bool ConvertImage(size_t width, size_t height, const void* srcBegin,
WebGLImageConverter converter(width, height, srcItr, dstItr, srcStride,
dstItrStride);
converter.run(srcFormat, dstFormat, premultOp);
converter.run(srcFormat, dstFormat, premultOp, srcColorSpace, dstColorSpace);
if (!converter.Success()) {
// the dst image may be left uninitialized, so we better not try to
// continue even in release builds. This should never happen anyway,

View file

@ -48,6 +48,8 @@ bool ConvertImage(size_t width, size_t height, const void* srcBegin,
WebGLTexelFormat srcFormat, bool srcPremultiplied,
void* dstBegin, size_t dstStride, gl::OriginPos dstOrigin,
WebGLTexelFormat dstFormat, bool dstPremultiplied,
dom::PredefinedColorSpace srcColorSpace,
dom::PredefinedColorSpace dstColorSpace,
bool* out_wasTrivial);
//////////////////////////////////////////////////////////////////////////////////////////
@ -1382,6 +1384,16 @@ MOZ_ALWAYS_INLINE void convertType<uint8_t, float>(
dst[3] = src[3] * scaleFactor;
}
template <>
MOZ_ALWAYS_INLINE void convertType<float, uint8_t>(const float* __restrict src,
uint8_t* __restrict dst) {
const float scaleFactor = 255.0f;
dst[0] = uint8_t(src[0] * scaleFactor);
dst[1] = uint8_t(src[1] * scaleFactor);
dst[2] = uint8_t(src[2] * scaleFactor);
dst[3] = uint8_t(src[3] * scaleFactor);
}
template <>
MOZ_ALWAYS_INLINE void convertType<uint8_t, uint16_t>(
const uint8_t* __restrict src, uint16_t* __restrict dst) {

View file

@ -1828,34 +1828,6 @@ fail-if = [
"os == 'linux'",
]
# Bug 1673105 for mac+WR
["generated/test_2_conformance2__textures__video__tex-2d-rgb565-rgb-unsigned_byte.html"]
skip-if = ["os == 'mac'"]
["generated/test_2_conformance2__textures__video__tex-2d-rgb5_a1-rgba-unsigned_byte.html"]
skip-if = ["os == 'mac'"]
["generated/test_2_conformance2__textures__video__tex-2d-rgb8-rgb-unsigned_byte.html"]
skip-if = ["os == 'mac'"]
["generated/test_2_conformance2__textures__video__tex-2d-rgba4-rgba-unsigned_byte.html"]
skip-if = ["os == 'mac'"]
["generated/test_2_conformance2__textures__video__tex-2d-rgba8-rgba-unsigned_byte.html"]
skip-if = ["os == 'mac'"]
["generated/test_2_conformance2__textures__video__tex-2d-srgb8-rgb-unsigned_byte.html"]
skip-if = ["os == 'mac'"]
["generated/test_2_conformance2__textures__video__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html"]
skip-if = ["os == 'mac'"]
["generated/test_2_conformance__textures__video__tex-2d-rgb-rgb-unsigned_byte.html"]
skip-if = ["os == 'mac'"]
["generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_byte.html"]
skip-if = ["os == 'mac'"]
["generated/test_conformance__extensions__angle-instanced-arrays.html"]
skip-if = ["os == 'mac' && os_version == '10.15'"]

View file

@ -68,6 +68,7 @@ dictionary DnsCacheEntry {
boolean trr = false;
DOMString originAttributesSuffix = "";
DOMString flags = "";
unsigned short type = 0;
};
[GenerateConversionToJS]

View file

@ -5,6 +5,7 @@ prefs = [
"dom.security.credentialmanagement.identity.select_first_in_ui_lists=true",
"dom.security.credentialmanagement.identity.reject_delay.enabled=false",
"privacy.antitracking.enableWebcompat=false", # disables opener heuristic
"network.cookie.cookieBehavior.optInPartitioning=false", # disables blocking third-party cookies
]
scheme = "https"
skip-if = [

View file

@ -229,17 +229,19 @@ void PointerEvent::GetPointerType(nsAString& aPointerType) {
return;
}
#if SPOOFED_MAX_TOUCH_POINTS <= 0
if (ShouldResistFingerprinting()) {
aPointerType.AssignLiteral("mouse");
return;
}
#endif
ConvertPointerTypeToString(mEvent->AsPointerEvent()->mInputSource,
aPointerType);
}
int32_t PointerEvent::PointerId() {
return ShouldResistFingerprinting()
return (ShouldResistFingerprinting(true))
? PointerEventHandler::GetSpoofedPointerIdForRFP()
: mEvent->AsPointerEvent()->pointerId;
}
@ -419,7 +421,7 @@ void PointerEvent::GetPredictedEvents(
aPointerEvents.AppendElements(mPredictedEvents);
}
bool PointerEvent::ShouldResistFingerprinting() const {
bool PointerEvent::ShouldResistFingerprinting(bool aForPointerId) const {
// There are three simple situations we don't need to spoof this pointer
// event.
// 1. The pref privcy.resistFingerprinting' is false, we fast return here
@ -428,17 +430,19 @@ bool PointerEvent::ShouldResistFingerprinting() const {
// 3. This event is a mouse pointer event.
// We don't need to check for the system group since pointer events won't be
// dispatched to the system group.
if (!nsContentUtils::ShouldResistFingerprinting("Efficiency Check",
RFPTarget::PointerEvents) ||
RFPTarget target =
aForPointerId ? RFPTarget::PointerId : RFPTarget::PointerEvents;
if (!nsContentUtils::ShouldResistFingerprinting("Efficiency Check", target) ||
!mEvent->IsTrusted() ||
mEvent->AsPointerEvent()->mInputSource ==
MouseEvent_Binding::MOZ_SOURCE_MOUSE) {
(mEvent->AsPointerEvent()->mInputSource ==
MouseEvent_Binding::MOZ_SOURCE_MOUSE &&
SPOOFED_MAX_TOUCH_POINTS == 0)) {
return false;
}
// Pref is checked above, so use true as fallback.
nsCOMPtr<Document> doc = GetDocument();
return doc ? doc->ShouldResistFingerprinting(RFPTarget::PointerEvents) : true;
return doc ? doc->ShouldResistFingerprinting(target) : true;
}
} // namespace mozilla::dom

View file

@ -62,7 +62,7 @@ class PointerEvent : public MouseEvent {
private:
// This method returns the boolean to indicate whether spoofing pointer
// event for fingerprinting resistance.
bool ShouldResistFingerprinting() const;
bool ShouldResistFingerprinting(bool aForPointerId = false) const;
// When the instance is a trusted `pointermove` event but the widget event
// does not have proper coalesced events (typically, the event is synthesized

View file

@ -343,7 +343,7 @@ void PointerEventHandler::CheckPointerCaptureState(WidgetPointerEvent* aEvent) {
// from chrome if the capture info exists in this case. And we don't have to
// do anything if the pointer id is the same as the spoofed one.
if (nsContentUtils::ShouldResistFingerprinting("Efficiency Check",
RFPTarget::PointerEvents) &&
RFPTarget::PointerId) &&
aEvent->pointerId != (uint32_t)GetSpoofedPointerIdForRFP() &&
!captureInfo) {
PointerCaptureInfo* spoofedCaptureInfo =

View file

@ -0,0 +1,17 @@
<script id="worker" type="javascript/worker">
(() => {
const func_0 = (e) => {
e.returnValue = false
}
self.addEventListener("error", func_0, {"passive": true})
const ref = new WeakRef(self)
self.reportError(ref)
})()
</script>
<script>
window.addEventListener("DOMContentLoaded", () => {
const blob = new Blob([document.querySelector('#worker').textContent], { type: "text/javascript" })
const sw = new SharedWorker(window.URL.createObjectURL(blob))
sw.port.postMessage([], [])
})
</script>

View file

@ -17,3 +17,4 @@ load recursive-DOMNodeInserted.html
load recursive-onload.html
load 1397711.html
load 1856737.html
load 1917654.html

View file

@ -2,8 +2,12 @@
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window onload="start()"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
<linkset>
<html:link rel="localization" href="browser/places.ftl"/>
</linkset>
<script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
<hbox id="sidebar-search-container" align="center">

View file

@ -410,7 +410,8 @@ void Queue::CopyExternalImageToTexture(
if (!ConvertImage(dstWidth, dstHeight, srcBegin, srcStride, srcOriginPos,
srcFormat, srcPremultiplied, dstBegin, dstStrideVal,
dstOriginPos, dstFormat, aDestination.mPremultipliedAlpha,
&wasTrivial)) {
dom::PredefinedColorSpace::Srgb,
dom::PredefinedColorSpace::Srgb, &wasTrivial)) {
MOZ_ASSERT_UNREACHABLE("ConvertImage failed!");
aRv.ThrowInvalidStateError(
nsPrintfCString("Failed to convert source to destination format "

View file

@ -539,7 +539,7 @@ interface mixin WebGLRenderingContextBase {
default to the value "srgb". */
[Pref="webgl.drawing_buffer_color_space"]
attribute PredefinedColorSpace drawingBufferColorSpace;
//attribute PredefinedColorSpace unpackColorSpace;
attribute PredefinedColorSpace unpackColorSpace;
[WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
[WebGLHandlesContextLoss] boolean isContextLost();

View file

@ -323,8 +323,8 @@ void WorkerErrorReport::ReportError(
MOZ_ASSERT(globalScope->GetWrapperPreserveColor() == global);
RefPtr<ErrorEvent> event =
ErrorEvent::Constructor(aTarget, u"error"_ns, init);
RefPtr<ErrorEvent> event = ErrorEvent::Constructor(
aTarget ? aTarget : globalScope, u"error"_ns, init);
event->SetTrusted(true);
if (NS_FAILED(EventDispatcher::DispatchDOMEvent(

View file

@ -135,13 +135,14 @@ const uint32_t XML_HTTP_REQUEST_ARRAYBUFFER_MIN_SIZE = 32 * 1024;
const int32_t XML_HTTP_REQUEST_MAX_CONTENT_LENGTH_PREALLOCATE =
1 * 1024 * 1024 * 1024LL;
namespace {
const nsString kLiteralString_readystatechange = u"readystatechange"_ns;
const nsString kLiteralString_xmlhttprequest = u"xmlhttprequest"_ns;
const nsString kLiteralString_DOMContentLoaded = u"DOMContentLoaded"_ns;
const nsCString kLiteralString_charset = "charset"_ns;
const nsCString kLiteralString_UTF_8 = "UTF-8"_ns;
} // namespace
constexpr nsLiteralString kLiteralString_readystatechange =
u"readystatechange"_ns;
// constexpr nsLiteralString kLiteralString_xmlhttprequest =
// u"xmlhttprequest"_ns;
constexpr nsLiteralString kLiteralString_DOMContentLoaded =
u"DOMContentLoaded"_ns;
constexpr nsLiteralCString kLiteralString_charset = "charset"_ns;
constexpr nsLiteralCString kLiteralString_UTF_8 = "UTF-8"_ns;
#define NS_PROGRESS_EVENT_INTERVAL 50
#define MAX_SYNC_TIMEOUT_WHEN_UNLOADING 10000 /* 10 secs */

View file

@ -3,6 +3,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/. */
#include "base/process_util.h"
#include "nsAuth.h"
#include "nsAuthSambaNTLM.h"
#include "nspr.h"
@ -12,12 +13,9 @@
#include "mozilla/Telemetry.h"
#include <stdlib.h>
#include <sys/wait.h>
nsAuthSambaNTLM::nsAuthSambaNTLM()
: mInitialMessage(nullptr),
mChildPID(nullptr),
mFromChildFD(nullptr),
mToChildFD(nullptr) {}
nsAuthSambaNTLM::nsAuthSambaNTLM() = default;
nsAuthSambaNTLM::~nsAuthSambaNTLM() {
// ntlm_auth reads from stdin regularly so closing our file handles
@ -27,78 +25,48 @@ nsAuthSambaNTLM::~nsAuthSambaNTLM() {
}
void nsAuthSambaNTLM::Shutdown() {
if (mFromChildFD) {
PR_Close(mFromChildFD);
mFromChildFD = nullptr;
}
if (mToChildFD) {
PR_Close(mToChildFD);
mToChildFD = nullptr;
}
if (mChildPID) {
PR_KillProcess(mChildPID);
mChildPID = nullptr;
mFromChildFD = nullptr;
mToChildFD = nullptr;
if (mChildPID != -1) {
// Kill and wait for the process to exit.
kill(mChildPID, SIGKILL);
int status = 0;
pid_t result;
do {
result = waitpid(mChildPID, &status, 0);
} while (result == -1 && errno == EINTR);
mChildPID = -1;
}
}
NS_IMPL_ISUPPORTS(nsAuthSambaNTLM, nsIAuthModule)
static bool SpawnIOChild(char* const* aArgs, PRProcess** aPID,
PRFileDesc** aFromChildFD, PRFileDesc** aToChildFD) {
PRFileDesc* toChildPipeRead;
PRFileDesc* toChildPipeWrite;
if (PR_CreatePipe(&toChildPipeRead, &toChildPipeWrite) != PR_SUCCESS) {
return false;
}
PR_SetFDInheritable(toChildPipeRead, true);
PR_SetFDInheritable(toChildPipeWrite, false);
PRFileDesc* fromChildPipeRead;
PRFileDesc* fromChildPipeWrite;
if (PR_CreatePipe(&fromChildPipeRead, &fromChildPipeWrite) != PR_SUCCESS) {
PR_Close(toChildPipeRead);
PR_Close(toChildPipeWrite);
return false;
}
PR_SetFDInheritable(fromChildPipeRead, false);
PR_SetFDInheritable(fromChildPipeWrite, true);
PRProcessAttr* attr = PR_NewProcessAttr();
if (!attr) {
PR_Close(fromChildPipeRead);
PR_Close(fromChildPipeWrite);
PR_Close(toChildPipeRead);
PR_Close(toChildPipeWrite);
[[nodiscard]] static bool CreatePipe(mozilla::UniqueFileHandle* aReadPipe,
mozilla::UniqueFileHandle* aWritePipe) {
int fds[2];
if (pipe(fds) == -1) {
return false;
}
PR_ProcessAttrSetStdioRedirect(attr, PR_StandardInput, toChildPipeRead);
PR_ProcessAttrSetStdioRedirect(attr, PR_StandardOutput, fromChildPipeWrite);
PRProcess* process = PR_CreateProcess(aArgs[0], aArgs, nullptr, attr);
PR_DestroyProcessAttr(attr);
PR_Close(fromChildPipeWrite);
PR_Close(toChildPipeRead);
if (!process) {
LOG(("ntlm_auth exec failure [%d]", PR_GetError()));
PR_Close(fromChildPipeRead);
PR_Close(toChildPipeWrite);
return false;
}
*aPID = process;
*aFromChildFD = fromChildPipeRead;
*aToChildFD = toChildPipeWrite;
aReadPipe->reset(fds[0]);
aWritePipe->reset(fds[1]);
return true;
}
static bool WriteString(PRFileDesc* aFD, const nsACString& aString) {
int32_t length = aString.Length();
static bool WriteString(const mozilla::UniqueFileHandle& aFD,
const nsACString& aString) {
size_t length = aString.Length();
const char* s = aString.BeginReading();
LOG(("Writing to ntlm_auth: %s", s));
while (length > 0) {
int result = PR_Write(aFD, s, length);
ssize_t result;
do {
result = write(aFD.get(), s, length);
} while (result == -1 && errno == EINTR);
if (result <= 0) return false;
s += result;
length -= result;
@ -106,14 +74,18 @@ static bool WriteString(PRFileDesc* aFD, const nsACString& aString) {
return true;
}
static bool ReadLine(PRFileDesc* aFD, nsACString& aString) {
static bool ReadLine(const mozilla::UniqueFileHandle& aFD,
nsACString& aString) {
// ntlm_auth is defined to only send one line in response to each of our
// input lines. So this simple unbuffered strategy works as long as we
// read the response immediately after sending one request.
aString.Truncate();
for (;;) {
char buf[1024];
int result = PR_Read(aFD, buf, sizeof(buf));
ssize_t result;
do {
result = read(aFD.get(), buf, sizeof(buf));
} while (result == -1 && errno == EINTR);
if (result <= 0) return false;
aString.Append(buf, result);
if (buf[result - 1] == '\n') {
@ -160,17 +132,39 @@ nsresult nsAuthSambaNTLM::SpawnNTLMAuthHelper() {
const char* username = PR_GetEnv("USER");
if (!username) return NS_ERROR_FAILURE;
const char* const args[] = {"ntlm_auth",
"--helper-protocol",
"ntlmssp-client-1",
"--use-cached-creds",
"--username",
username,
nullptr};
// Use base::LaunchApp to run the child process. This code is posix-only, as
// this will not be used on Windows.
{
mozilla::UniqueFileHandle toChildPipeRead;
mozilla::UniqueFileHandle toChildPipeWrite;
if (!CreatePipe(&toChildPipeRead, &toChildPipeWrite)) {
return NS_ERROR_FAILURE;
}
bool isOK = SpawnIOChild(const_cast<char* const*>(args), &mChildPID,
&mFromChildFD, &mToChildFD);
if (!isOK) return NS_ERROR_FAILURE;
mozilla::UniqueFileHandle fromChildPipeRead;
mozilla::UniqueFileHandle fromChildPipeWrite;
if (!CreatePipe(&fromChildPipeRead, &fromChildPipeWrite)) {
return NS_ERROR_FAILURE;
}
base::LaunchOptions options;
options.fds_to_remap.push_back(
std::pair{toChildPipeRead.get(), STDIN_FILENO});
options.fds_to_remap.push_back(
std::pair{fromChildPipeWrite.get(), STDOUT_FILENO});
std::vector<std::string> argvVec{"ntlm_auth", "--helper-protocol",
"ntlmssp-client-1", "--use-cached-creds",
"--username", username};
auto result = base::LaunchApp(argvVec, std::move(options), &mChildPID);
if (result.isErr()) {
return NS_ERROR_FAILURE;
}
mToChildFD = std::move(toChildPipeWrite);
mFromChildFD = std::move(fromChildPipeRead);
}
if (!WriteString(mToChildFD, "YR\n"_ns)) return NS_ERROR_FAILURE;
nsCString line;

View file

@ -12,6 +12,7 @@
#include "prio.h"
#include "prproces.h"
#include "mozilla/Attributes.h"
#include "mozilla/UniquePtrExtensions.h"
/**
* This is an implementation of NTLM authentication that does single-signon
@ -41,11 +42,11 @@ class nsAuthSambaNTLM final : public nsIAuthModule {
void Shutdown();
uint8_t* mInitialMessage; /* free with free() */
uint8_t* mInitialMessage = nullptr; /* free with free() */
uint32_t mInitialMessageLen{};
PRProcess* mChildPID;
PRFileDesc* mFromChildFD;
PRFileDesc* mToChildFD;
pid_t mChildPID = -1;
mozilla::UniqueFileHandle mFromChildFD;
mozilla::UniqueFileHandle mToChildFD;
};
#endif /* nsAuthSambaNTLM_h__ */

View file

@ -1715,9 +1715,6 @@ color::ColorspaceDesc ToColorspaceDesc(const gfx::YUVRangedColorSpace cs) {
MOZ_CRASH("Bad YUVRangedColorSpace.");
}
static std::optional<color::ColorProfileDesc> ToColorProfileDesc(
gfx::ColorSpace2);
} // namespace gl
namespace gfx {
@ -1728,7 +1725,8 @@ namespace gl {
// -
static std::optional<color::ColorProfileDesc> ToColorProfileDesc(
/* static */
std::optional<color::ColorProfileDesc> GLBlitHelper::ToColorProfileDesc(
const gfx::ColorSpace2 cspace) {
color::ColorspaceDesc cspaceDesc;
switch (cspace) {

View file

@ -200,6 +200,9 @@ class GLBlitHelper final {
gfx::IntSize mYuvUploads_UVSize = {0, 0};
public:
static std::optional<color::ColorProfileDesc> ToColorProfileDesc(
gfx::ColorSpace2);
struct ColorLutKey : DeriveCmpOpMembers<ColorLutKey> {
std::variant<gfx::ColorSpace2, gfx::YUVRangedColorSpace> src;
gfx::ColorSpace2 dst;

View file

@ -178,6 +178,8 @@ static const char* const sExtensionNames[] = {
"GL_EXT_timer_query",
"GL_EXT_transform_feedback",
"GL_EXT_unpack_subimage",
"GL_EXT_semaphore",
"GL_EXT_semaphore_fd",
"GL_IMG_read_format",
"GL_IMG_texture_compression_pvrtc",
"GL_IMG_texture_npot",
@ -1497,6 +1499,30 @@ void GLContext::LoadMoreSymbols(const SymbolLoader& loader) {
fnLoadForFeature(symbols, GLFeature::provoking_vertex);
}
if (IsExtensionSupported(EXT_semaphore)) {
const SymLoadStruct symbols[] = {
{(PRFuncPtr*)&mSymbols.fDeleteSemaphoresEXT,
{{"glDeleteSemaphoresEXT"}}},
{(PRFuncPtr*)&mSymbols.fGenSemaphoresEXT, {{"glGenSemaphoresEXT"}}},
{(PRFuncPtr*)&mSymbols.fGetSemaphoreParameterui64vEXT,
{{"glGetSemaphoreParameterui64vEXT"}}},
{(PRFuncPtr*)&mSymbols.fIsSemaphoreEXT, {{"glIsSemaphoreEXT"}}},
{(PRFuncPtr*)&mSymbols.fSemaphoreParameterui64vEXT,
{{"glSemaphoreParameterui64vEXT"}}},
{(PRFuncPtr*)&mSymbols.fSignalSemaphoreEXT, {{"glSignalSemaphoreEXT"}}},
{(PRFuncPtr*)&mSymbols.fWaitSemaphoreEXT, {{"glWaitSemaphoreEXT"}}},
END_SYMBOLS};
fnLoadForExt(symbols, EXT_semaphore);
}
if (IsExtensionSupported(EXT_semaphore_fd)) {
const SymLoadStruct symbols[] = {
{(PRFuncPtr*)&mSymbols.fImportSemaphoreFdEXT,
{{"glImportSemaphoreFdEXT"}}},
END_SYMBOLS};
fnLoadForExt(symbols, EXT_semaphore_fd);
}
// Load developer symbols, don't fail if we can't find them.
const SymLoadStruct devSymbols[] = {CORE_SYMBOL(GetTexImage),
CORE_SYMBOL(GetTexLevelParameteriv),

View file

@ -457,6 +457,8 @@ class GLContext : public GenericAtomicRefCounted, public SupportsWeakPtr {
EXT_timer_query,
EXT_transform_feedback,
EXT_unpack_subimage,
EXT_semaphore,
EXT_semaphore_fd,
IMG_read_format,
IMG_texture_compression_pvrtc,
IMG_texture_npot,
@ -3432,6 +3434,68 @@ class GLContext : public GenericAtomicRefCounted, public SupportsWeakPtr {
AFTER_GL_CALL;
}
// -----------------------------------------------------------------------------
// GL_EXT_semaphore
void fDeleteSemaphoresEXT(GLsizei n, const GLuint* semaphores) {
BEFORE_GL_CALL;
mSymbols.fDeleteSemaphoresEXT(n, semaphores);
AFTER_GL_CALL;
}
void fGenSemaphoresEXT(GLsizei n, GLuint* semaphores) {
BEFORE_GL_CALL;
mSymbols.fGenSemaphoresEXT(n, semaphores);
AFTER_GL_CALL;
}
void fGetSemaphoreParameterui64vEXT(GLuint semaphore, GLenum pname,
GLuint64* params) {
BEFORE_GL_CALL;
mSymbols.fGetSemaphoreParameterui64vEXT(semaphore, pname, params);
AFTER_GL_CALL;
}
realGLboolean fIsSemaphoreEXT(GLuint semaphore) {
realGLboolean ret = false;
BEFORE_GL_CALL;
ret = mSymbols.fIsSemaphoreEXT(semaphore);
AFTER_GL_CALL;
return ret;
}
void fSemaphoreParameterui64vEXT(GLuint semaphore, GLenum pname,
const GLuint64* params) {
BEFORE_GL_CALL;
mSymbols.fSemaphoreParameterui64vEXT(semaphore, pname, params);
AFTER_GL_CALL;
}
void fSignalSemaphoreEXT(GLuint semaphore, GLuint numBufferBarriers,
const GLuint* buffers, GLuint numTextureBarriers,
const GLuint* textures, const GLenum* dstLayouts) {
BEFORE_GL_CALL;
mSymbols.fSignalSemaphoreEXT(semaphore, numBufferBarriers, buffers,
numTextureBarriers, textures, dstLayouts);
AFTER_GL_CALL;
}
void fWaitSemaphoreEXT(GLuint semaphore, GLuint numBufferBarriers,
const GLuint* buffers, GLuint numTextureBarriers,
const GLuint* textures, const GLenum* srcLayouts) {
BEFORE_GL_CALL;
mSymbols.fWaitSemaphoreEXT(semaphore, numBufferBarriers, buffers,
numTextureBarriers, textures, srcLayouts);
AFTER_GL_CALL;
}
// -----------------------------------------------------------------------------
// GL_EXT_semaphore_fd
void fImportSemaphoreFdEXT(GLuint semaphore, GLenum handleType, GLint fd) {
BEFORE_GL_CALL;
mSymbols.fImportSemaphoreFdEXT(semaphore, handleType, fd);
AFTER_GL_CALL;
}
// -
#undef BEFORE_GL_CALL

View file

@ -459,6 +459,21 @@ struct GLContextSymbols final {
// provoking_vertex
void(GLAPIENTRY* fProvokingVertex)(GLenum);
// GL_EXT_semaphore
void(GLAPIENTRY* fDeleteSemaphoresEXT)(GLsizei, const GLuint*);
void(GLAPIENTRY* fGenSemaphoresEXT)(GLsizei, GLuint*);
void(GLAPIENTRY* fGetSemaphoreParameterui64vEXT)(GLuint, GLenum, GLuint64*);
realGLboolean(GLAPIENTRY* fIsSemaphoreEXT)(GLuint);
void(GLAPIENTRY* fSemaphoreParameterui64vEXT)(GLuint, GLenum,
const GLuint64*);
void(GLAPIENTRY* fSignalSemaphoreEXT)(GLuint, GLuint, const GLuint*, GLuint,
const GLuint*, const GLenum*);
void(GLAPIENTRY* fWaitSemaphoreEXT)(GLuint, GLuint, const GLuint*, GLuint,
const GLuint*, const GLenum*);
// GL_EXT_semaphore_fd
void(GLAPIENTRY* fImportSemaphoreFdEXT)(GLuint, GLenum, GLint);
};
} // namespace gl

View file

@ -314,6 +314,26 @@ TEST(Colorspaces, SrgbFromDisplayP3)
EXPECT_NEAR(srgbLinear.z(), 0.096, 0.001);
}
TEST(Colorspaces, DisplayP3FromSrgb)
{
const auto p3C = ColorspaceDesc{
Chromaticities::DisplayP3(),
PiecewiseGammaDesc::DisplayP3(),
};
const auto srgbC = ColorspaceDesc{
Chromaticities::Srgb(),
PiecewiseGammaDesc::Srgb(),
};
const auto p3FromSrgb = ColorspaceTransform::Create(srgbC, p3C);
// E.g.
// https://colorjs.io/apps/convert/?color=color(srgb%200.4%200.8%200.4)&precision=4
auto p3 = p3FromSrgb.DstFromSrc(vec3{{0.4, 0.8, 0.4}});
EXPECT_NEAR(p3.x(), 0.502, 0.001);
EXPECT_NEAR(p3.y(), 0.791, 0.001);
EXPECT_NEAR(p3.z(), 0.445, 0.001);
}
// -
template <class Fn, class Tuple, size_t... I>

View file

@ -10,6 +10,7 @@
#include "InputData.h" // for MouseInput, etc
#include "InputBlockState.h" // for InputBlockState
#include "OverscrollHandoffState.h" // for OverscrollHandoffState
#include "nsLayoutUtils.h" // for IsSmoothScrollingEnabled
#include "mozilla/EventForwards.h"
#include "mozilla/dom/WheelEventBinding.h" // for WheelEvent constants
#include "mozilla/EventStateManager.h" // for EventStateManager
@ -331,7 +332,7 @@ APZEventResult APZInputBridge::ReceiveInputEvent(
if (Maybe<APZWheelAction> action = ActionForWheelEvent(&wheelEvent)) {
ScrollWheelInput::ScrollMode scrollMode =
ScrollWheelInput::SCROLLMODE_INSTANT;
if (StaticPrefs::general_smoothScroll() &&
if (nsLayoutUtils::IsSmoothScrollingEnabled() &&
((wheelEvent.mDeltaMode ==
dom::WheelEvent_Binding::DOM_DELTA_LINE &&
StaticPrefs::general_smoothScroll_mouseWheel()) ||

View file

@ -7,6 +7,7 @@
#include "mozilla/layers/APZPublicUtils.h"
#include "AsyncPanZoomController.h"
#include "nsLayoutUtils.h"
#include "mozilla/HelperMacros.h"
#include "mozilla/StaticPrefs_general.h"
@ -36,9 +37,10 @@ ScrollAnimationBezierPhysicsSettings ComputeBezierAnimationSettingsForOrigin(
int32_t minMS = 0;
int32_t maxMS = 0;
bool isOriginSmoothnessEnabled = false;
bool isGeneralSmoothnessEnabled = nsLayoutUtils::IsSmoothScrollingEnabled();
#define READ_DURATIONS(prefbase) \
isOriginSmoothnessEnabled = StaticPrefs::general_smoothScroll() && \
isOriginSmoothnessEnabled = isGeneralSmoothnessEnabled && \
StaticPrefs::general_smoothScroll_##prefbase(); \
if (isOriginSmoothnessEnabled) { \
minMS = StaticPrefs::general_smoothScroll_##prefbase##_durationMinMS(); \
@ -88,7 +90,8 @@ ScrollAnimationBezierPhysicsSettings ComputeBezierAnimationSettingsForOrigin(
}
ScrollMode GetScrollModeForOrigin(ScrollOrigin origin) {
if (!StaticPrefs::general_smoothScroll()) return ScrollMode::Instant;
bool isSmoothScrollingEnabled = nsLayoutUtils::IsSmoothScrollingEnabled();
if (!isSmoothScrollingEnabled) return ScrollMode::Instant;
switch (origin) {
case ScrollOrigin::Lines:
return StaticPrefs::general_smoothScroll_lines() ? ScrollMode::Smooth
@ -101,8 +104,8 @@ ScrollMode GetScrollModeForOrigin(ScrollOrigin origin) {
: ScrollMode::Instant;
default:
MOZ_ASSERT(false, "Unknown keyboard scroll origin");
return StaticPrefs::general_smoothScroll() ? ScrollMode::Smooth
: ScrollMode::Instant;
return isSmoothScrollingEnabled ? ScrollMode::Smooth
: ScrollMode::Instant;
}
}

View file

@ -8,6 +8,7 @@
#include "AsyncPanZoomController.h"
#include "FrameMetrics.h"
#include "nsLayoutUtils.h"
#include "mozilla/layers/APZPublicUtils.h"
#include "nsPoint.h"
#include "ScrollAnimationPhysics.h"
@ -28,7 +29,7 @@ GenericScrollAnimation::GenericScrollAnimation(AsyncPanZoomController& aApzc,
// ScrollAnimationBezierPhysics (despite its name) handles the case of
// general.smoothScroll being disabled whereas ScrollAnimationMSDPhysics does
// not (ie it scrolls smoothly).
if (StaticPrefs::general_smoothScroll() &&
if (nsLayoutUtils::IsSmoothScrollingEnabled() &&
StaticPrefs::general_smoothScroll_msdPhysics_enabled()) {
mAnimationPhysics = MakeUnique<ScrollAnimationMSDPhysics>(aInitialPosition);
} else {

View file

@ -8,6 +8,7 @@
#include <tuple>
#include "AsyncPanZoomController.h"
#include "nsLayoutUtils.h"
#include "mozilla/StaticPrefs_general.h"
#include "mozilla/layers/APZPublicUtils.h"
#include "nsPoint.h"
@ -35,7 +36,7 @@ WheelScrollAnimation::WheelScrollAnimation(
ScrollWheelInput::ScrollDeltaType aDeltaType)
: GenericScrollAnimation(aApzc, aInitialPosition,
OriginForDeltaType(aDeltaType)) {
MOZ_ASSERT(StaticPrefs::general_smoothScroll(),
MOZ_ASSERT(nsLayoutUtils::IsSmoothScrollingEnabled(),
"We shouldn't be creating a WheelScrollAnimation if smooth "
"scrolling is disabled");
mDirectionForcedToOverscroll =

View file

@ -240,18 +240,15 @@ EnvironmentArray BuildEnvironmentArray(const environment_map& env_vars_to_set);
class AppProcessBuilder {
public:
AppProcessBuilder();
// This function will fork a new process for use as a
// content processes.
bool ForkProcess(const std::vector<std::string>& argv,
LaunchOptions&& options, ProcessHandle* process_handle);
// This function will be called in the child process to initializes
// the environment of the content process. It should be called
// after the message loop of the main thread, to make sure the fork
// server is destroyed properly in the child process.
//
// The message loop may allocate resources like file descriptors.
// If this function is called before the end of the loop, the
// reosurces may be destroyed while the loop is still alive.
// This function will fork a new process for use as a content
// processes. The next two functions substitute for the
// corresponding exec().
bool ForkProcess(LaunchOptions&& options, ProcessHandle* process_handle);
// This function must be called with the argument and environment
// information to be used by the following call to InitAppProcess.
void SetExecInfo(std::vector<std::string>&& aArgv, environment_map&& aEnv);
// This function will be called in the child process to initialize
// the environment of the content process.
void InitAppProcess(int* argcp, char*** argvp);
private:
@ -259,6 +256,7 @@ class AppProcessBuilder {
mozilla::ipc::FileDescriptorShuffle shuffle_;
std::vector<std::string> argv_;
environment_map env_;
};
void InitForkServerProcess();

View file

@ -64,14 +64,13 @@ namespace base {
#if defined(MOZ_ENABLE_FORKSERVER)
AppProcessBuilder::AppProcessBuilder() {}
static void ReplaceEnviroment(const LaunchOptions& options) {
for (auto& elt : options.env_map) {
static void ReplaceEnviroment(const environment_map& env_map) {
for (auto& elt : env_map) {
setenv(elt.first.c_str(), elt.second.c_str(), 1);
}
}
bool AppProcessBuilder::ForkProcess(const std::vector<std::string>& argv,
LaunchOptions&& options,
bool AppProcessBuilder::ForkProcess(LaunchOptions&& options,
ProcessHandle* process_handle) {
auto cleanFDs = mozilla::MakeScopeExit([&] {
for (auto& elt : options.fds_to_remap) {
@ -91,7 +90,6 @@ bool AppProcessBuilder::ForkProcess(const std::vector<std::string>& argv,
} launcher;
# endif
argv_ = argv;
if (!shuffle_.Init(options.fds_to_remap)) {
return false;
}
@ -114,7 +112,6 @@ bool AppProcessBuilder::ForkProcess(const std::vector<std::string>& argv,
if (pid == 0) {
cleanFDs.release();
ReplaceEnviroment(options);
} else {
gProcessLog.print("==> process %d launched child process %d\n",
GetCurrentProcId(), pid);
@ -126,6 +123,12 @@ bool AppProcessBuilder::ForkProcess(const std::vector<std::string>& argv,
return true;
}
void AppProcessBuilder::SetExecInfo(std::vector<std::string>&& aArgv,
environment_map&& aEnv) {
argv_ = std::move(aArgv);
env_ = std::move(aEnv);
}
void AppProcessBuilder::ReplaceArguments(int* argcp, char*** argvp) {
// Change argc & argv of main() with the arguments passing
// through IPC.
@ -163,6 +166,7 @@ void AppProcessBuilder::InitAppProcess(int* argcp, char*** argvp) {
shuffle_.Forget();
ReplaceArguments(argcp, argvp);
ReplaceEnviroment(env_);
}
static void InstallChildSignalHandler() {

View file

@ -97,21 +97,21 @@ inline void CleanString(std::string& str) {
}
}
inline void PrepareArguments(std::vector<std::string>& aArgv,
inline void PrepareArguments(std::vector<std::string>* aArgv,
nsTArray<nsCString>& aArgvArray) {
for (auto& elt : aArgvArray) {
aArgv.push_back(elt.get());
aArgv->push_back(elt.get());
CleanCString(elt);
}
}
// Prepare aOptions->env_map
inline void PrepareEnv(base::LaunchOptions* aOptions,
inline void PrepareEnv(base::environment_map* aEnvOut,
nsTArray<EnvVar>& aEnvMap) {
for (auto& elt : aEnvMap) {
nsCString& var = std::get<0>(elt);
nsCString& val = std::get<1>(elt);
aOptions->env_map[var.get()] = val.get();
(*aEnvOut)[var.get()] = val.get();
CleanCString(var);
CleanCString(val);
}
@ -140,41 +140,71 @@ static void ReadParamInfallible(IPC::MessageReader* aReader, P* aResult,
}
/**
* Parse a Message to get a list of arguments and fill a LaunchOptions.
* Parse a Message to obtain a `LaunchOptions` and the attached fd
* that the child will use to receive its `SubprocessExecInfo`.
*/
inline bool ParseForkNewSubprocess(IPC::Message& aMsg,
std::vector<std::string>& aArgv,
UniqueFileHandle* aExecFd,
base::LaunchOptions* aOptions) {
if (aMsg.type() != Msg_ForkNewSubprocess__ID) {
MOZ_LOG(gForkServiceLog, LogLevel::Verbose,
("unknown message type %d\n", aMsg.type()));
("unknown message type %d (!= %d)\n", aMsg.type(),
Msg_ForkNewSubprocess__ID));
return false;
}
IPC::MessageReader reader(aMsg);
nsTArray<nsCString> argv_array;
nsTArray<EnvVar> env_map;
nsTArray<FdMapping> fds_remap;
// FIXME(jld): This should all be fallible, but that will have to
// wait until bug 1752638 before it makes sense.
#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
ReadParamInfallible(&reader, &aOptions->fork_flags,
"Error deserializing 'int'");
ReadParamInfallible(&reader, &aOptions->sandbox_chroot,
"Error deserializing 'bool'");
#endif
ReadParamInfallible(&reader, &argv_array,
"Error deserializing 'nsCString[]'");
ReadParamInfallible(&reader, &env_map, "Error deserializing 'EnvVar[]'");
ReadParamInfallible(&reader, aExecFd,
"Error deserializing 'UniqueFileHandle'");
ReadParamInfallible(&reader, &fds_remap, "Error deserializing 'FdMapping[]'");
reader.EndRead();
PrepareArguments(aArgv, argv_array);
PrepareEnv(aOptions, env_map);
PrepareFdsRemap(aOptions, fds_remap);
return true;
}
/**
* Parse a `Message`, in the forked child process, to get the argument
* and environment strings.
*/
inline bool ParseSubprocessExecInfo(IPC::Message& aMsg,
std::vector<std::string>* aArgv,
base::environment_map* aEnv) {
if (aMsg.type() != Msg_SubprocessExecInfo__ID) {
MOZ_LOG(gForkServiceLog, LogLevel::Verbose,
("unexpected message type %d (!= %d)\n", aMsg.type(),
Msg_SubprocessExecInfo__ID));
return false;
}
IPC::MessageReader reader(aMsg);
nsTArray<nsCString> argv_array;
nsTArray<EnvVar> env_map;
// FIXME(jld): We may want to do something nicer than crashing,
// given that this process doesn't have crash reporting set up yet.
ReadParamInfallible(&reader, &argv_array,
"Error deserializing 'nsCString[]'");
ReadParamInfallible(&reader, &env_map, "Error deserializing 'EnvVar[]'");
reader.EndRead();
PrepareArguments(aArgv, argv_array);
PrepareEnv(aEnv, env_map);
return true;
}
inline void SanitizeBuffers(IPC::Message& aMsg, std::vector<std::string>& aArgv,
base::LaunchOptions& aOptions) {
// Clean all buffers in the message to make sure content processes
@ -204,21 +234,38 @@ inline void SanitizeBuffers(IPC::Message& aMsg, std::vector<std::string>& aArgv,
* process. |mAppProcBuilder| is null for the fork server.
*/
void ForkServer::OnMessageReceived(UniquePtr<IPC::Message> message) {
std::vector<std::string> argv;
UniqueFileHandle execFd;
base::LaunchOptions options;
if (!ParseForkNewSubprocess(*message, argv, &options)) {
if (!ParseForkNewSubprocess(*message, &execFd, &options)) {
return;
}
base::ProcessHandle child_pid = -1;
mAppProcBuilder = MakeUnique<base::AppProcessBuilder>();
if (!mAppProcBuilder->ForkProcess(argv, std::move(options), &child_pid)) {
if (!mAppProcBuilder->ForkProcess(std::move(options), &child_pid)) {
MOZ_CRASH("fail to fork");
}
MOZ_ASSERT(child_pid >= 0);
if (child_pid == 0) {
// Content process
MiniTransceiver execTcver(execFd.get());
UniquePtr<IPC::Message> execMsg;
if (!execTcver.Recv(execMsg)) {
// Crashing here isn't great, because the crash reporter isn't
// set up, but we don't have a lot of options currently. Also,
// receive probably won't fail unless the parent also crashes.
printf_stderr("ForkServer: SubprocessExecInfo receive error\n");
MOZ_CRASH();
}
std::vector<std::string> argv;
base::environment_map env;
if (!ParseSubprocessExecInfo(*execMsg, &argv, &env)) {
printf_stderr("ForkServer: SubprocessExecInfo parse error\n");
MOZ_CRASH();
}
mAppProcBuilder->SetExecInfo(std::move(argv), std::move(env));
return;
}
@ -230,11 +277,6 @@ void ForkServer::OnMessageReceived(UniquePtr<IPC::Message> message) {
IPC::MessageWriter writer(reply);
WriteIPDLParam(&writer, nullptr, child_pid);
mTcver->SendInfallible(reply, "failed to send a reply message");
// Without this, the content processes that is forked later are
// able to read the content of buffers even the buffers have been
// released.
SanitizeBuffers(*message, argv, options);
}
/**

View file

@ -38,6 +38,7 @@ class ForkServer {
enum {
Msg_ForkNewSubprocess__ID = 0x7f0, // a random picked number
Reply_ForkNewSubprocess__ID,
Msg_SubprocessExecInfo__ID,
};
} // namespace ipc

View file

@ -27,28 +27,47 @@ extern LazyLogModule gForkServiceLog;
mozilla::UniquePtr<ForkServiceChild> ForkServiceChild::sForkServiceChild;
Atomic<bool> ForkServiceChild::sForkServiceUsed;
#ifndef SOCK_CLOEXEC
static bool ConfigurePipeFd(int aFd) {
int flags = fcntl(aFd, F_GETFD, 0);
return flags != -1 && fcntl(aFd, F_SETFD, flags | FD_CLOEXEC) != -1;
}
#endif
// Create a socketpair with both ends marked as close-on-exec
static Result<Ok, LaunchError> CreateSocketPair(UniqueFileHandle& aFD0,
UniqueFileHandle& aFD1) {
int fds[2];
#ifdef SOCK_CLOXEC
constexpr int type = SOCK_STREAM | SOCK_CLOEXEC;
#else
constexpr int type = SOCK_STREAM;
#endif
if (socketpair(AF_UNIX, type, 0, fds) < 0) {
return Err(LaunchError("FSC::CSP::sp", errno));
}
#ifndef SOCK_CLOEXEC
if (!ConfigurePipeFd(server.get()) || !ConfigurePipeFd(client.get())) {
return Err(LaunchError("FSC::CSP::cfg", errno));
}
#endif
aFD0.reset(fds[0]);
aFD1.reset(fds[1]);
return Ok();
}
void ForkServiceChild::StartForkServer() {
// Create the socket to use for communication, and mark both ends as
// FD_CLOEXEC.
int fds[2];
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
UniqueFileHandle server;
UniqueFileHandle client;
if (CreateSocketPair(server, client).isErr()) {
MOZ_LOG(gForkServiceLog, LogLevel::Error,
("failed to create fork server socket"));
return;
}
UniqueFileHandle server(fds[0]);
UniqueFileHandle client(fds[1]);
if (!ConfigurePipeFd(server.get()) || !ConfigurePipeFd(client.get())) {
MOZ_LOG(gForkServiceLog, LogLevel::Error,
("failed to configure fork server socket"));
return;
}
GeckoChildProcessHost* subprocess =
new GeckoChildProcessHost(GeckoProcessType_ForkServer, false);
@ -78,23 +97,44 @@ ForkServiceChild::~ForkServiceChild() {
Result<Ok, LaunchError> ForkServiceChild::SendForkNewSubprocess(
const Args& aArgs, pid_t* aPid) {
mRecvPid = -1;
IPC::Message msg(MSG_ROUTING_CONTROL, Msg_ForkNewSubprocess__ID);
IPC::MessageWriter writer(msg);
UniqueFileHandle execParent;
{
UniqueFileHandle execChild;
IPC::Message msg(MSG_ROUTING_CONTROL, Msg_ForkNewSubprocess__ID);
MOZ_TRY(CreateSocketPair(execParent, execChild));
IPC::MessageWriter writer(msg);
#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
WriteIPDLParam(&writer, nullptr, aArgs.mForkFlags);
WriteIPDLParam(&writer, nullptr, aArgs.mChroot);
WriteIPDLParam(&writer, nullptr, aArgs.mForkFlags);
WriteIPDLParam(&writer, nullptr, aArgs.mChroot);
#endif
WriteIPDLParam(&writer, nullptr, aArgs.mArgv);
WriteIPDLParam(&writer, nullptr, aArgs.mEnv);
WriteIPDLParam(&writer, nullptr, aArgs.mFdsRemap);
if (!mTcver->Send(msg)) {
MOZ_LOG(gForkServiceLog, LogLevel::Verbose,
("the pipe to the fork server is closed or having errors"));
OnError();
return Err(LaunchError("FSC::SFNS::Send"));
WriteIPDLParam(&writer, nullptr, std::move(execChild));
WriteIPDLParam(&writer, nullptr, aArgs.mFdsRemap);
if (!mTcver->Send(msg)) {
MOZ_LOG(gForkServiceLog, LogLevel::Verbose,
("the pipe to the fork server is closed or having errors"));
OnError();
return Err(LaunchError("FSC::SFNS::Send"));
}
}
{
MiniTransceiver execTcver(execParent.get());
IPC::Message execMsg(MSG_ROUTING_CONTROL, Msg_SubprocessExecInfo__ID);
IPC::MessageWriter execWriter(execMsg);
WriteIPDLParam(&execWriter, nullptr, aArgs.mArgv);
WriteIPDLParam(&execWriter, nullptr, aArgs.mEnv);
if (!execTcver.Send(execMsg)) {
MOZ_LOG(gForkServiceLog, LogLevel::Verbose,
("failed to send exec info to the fork server"));
OnError();
return Err(LaunchError("FSC::SFNS::Send2"));
}
}
execParent = nullptr;
UniquePtr<IPC::Message> reply;
if (!mTcver->Recv(reply)) {
MOZ_LOG(gForkServiceLog, LogLevel::Verbose,

View file

@ -280,7 +280,7 @@ bool BytecodeEmitter::emitCheck(JSOp op, ptrdiff_t delta,
}
#ifdef DEBUG
bool BytecodeEmitter::checkStrictOrSloppy(JSOp op) {
bool BytecodeEmitter::checkStrictOrSloppy(JSOp op) const {
if (IsCheckStrictOp(op) && !sc->strict()) {
return false;
}
@ -654,7 +654,7 @@ bool BytecodeEmitter::updateSourceCoordNotesIfNonLiteral(ParseNode* node) {
return updateSourceCoordNotes(node->pn_pos.begin);
}
uint32_t BytecodeEmitter::getOffsetForLoop(ParseNode* nextpn) {
uint32_t BytecodeEmitter::getOffsetForLoop(ParseNode* nextpn) const {
// Try to give the JSOp::LoopHead the same line number as the next
// instruction. nextpn is often a block, in which case the next instruction
// typically comes from the first statement inside.
@ -822,24 +822,7 @@ bool BytecodeEmitter::emitEnvCoordOp(JSOp op, EnvironmentCoordinate ec) {
return true;
}
JSOp BytecodeEmitter::strictifySetNameOp(JSOp op) {
switch (op) {
case JSOp::SetName:
if (sc->strict()) {
op = JSOp::StrictSetName;
}
break;
case JSOp::SetGName:
if (sc->strict()) {
op = JSOp::StrictSetGName;
}
break;
default:;
}
return op;
}
bool BytecodeEmitter::checkSideEffects(ParseNode* pn, bool* answer) {
bool BytecodeEmitter::checkSideEffects(ParseNode* pn, bool* answer) const {
AutoCheckRecursionLimit recursion(fc);
if (!recursion.check(fc)) {
return false;
@ -1388,16 +1371,16 @@ restart:
"BytecodeEmitter::checkSideEffects");
}
bool BytecodeEmitter::isInLoop() {
bool BytecodeEmitter::isInLoop() const {
return findInnermostNestableControl<LoopControl>();
}
bool BytecodeEmitter::checkSingletonContext() {
bool BytecodeEmitter::checkSingletonContext() const {
MOZ_ASSERT_IF(sc->treatAsRunOnce(), sc->isTopLevelContext());
return sc->treatAsRunOnce() && !isInLoop();
}
bool BytecodeEmitter::needsImplicitThis() {
bool BytecodeEmitter::needsImplicitThis() const {
// Short-circuit if there is an enclosing 'with' scope.
if (sc->inWith()) {
return true;
@ -1414,10 +1397,10 @@ bool BytecodeEmitter::needsImplicitThis() {
return false;
}
size_t BytecodeEmitter::countThisEnvironmentHops() {
size_t BytecodeEmitter::countThisEnvironmentHops() const {
unsigned numHops = 0;
for (BytecodeEmitter* current = this; current; current = current->parent) {
for (const auto* current = this; current; current = current->parent) {
for (EmitterScope* es = current->innermostEmitterScope(); es;
es = es->enclosingInFrame()) {
if (es->scope(current).is<FunctionScope>()) {
@ -1470,7 +1453,8 @@ bool BytecodeEmitter::emitSuperBase() {
return emit1(JSOp::SuperBase);
}
void BytecodeEmitter::reportError(ParseNode* pn, unsigned errorNumber, ...) {
void BytecodeEmitter::reportError(ParseNode* pn, unsigned errorNumber,
...) const {
uint32_t offset = pn ? pn->pn_pos.begin : *scriptStartOffset;
va_list args;
@ -1482,7 +1466,8 @@ void BytecodeEmitter::reportError(ParseNode* pn, unsigned errorNumber, ...) {
va_end(args);
}
void BytecodeEmitter::reportError(uint32_t offset, unsigned errorNumber, ...) {
void BytecodeEmitter::reportError(uint32_t offset, unsigned errorNumber,
...) const {
va_list args;
va_start(args, errorNumber);
@ -2539,7 +2524,7 @@ bool BytecodeEmitter::emitCheckIsCallable() {
}
#endif
bool BytecodeEmitter::getNslots(uint32_t* nslots) {
bool BytecodeEmitter::getNslots(uint32_t* nslots) const {
uint64_t nslots64 =
maxFixedSlots + static_cast<uint64_t>(bytecodeSection().maxStackDepth());
if (nslots64 > UINT32_MAX) {
@ -2840,7 +2825,7 @@ bool BytecodeEmitter::emitSetOrInitializeDestructuring(
}
JSOp BytecodeEmitter::getIterCallOp(JSOp callOp,
SelfHostedIter selfHostedIter) {
SelfHostedIter selfHostedIter) const {
if (emitterMode == BytecodeEmitter::SelfHosting) {
MOZ_ASSERT(selfHostedIter != SelfHostedIter::Deny);
@ -3112,9 +3097,7 @@ bool BytecodeEmitter::emitAnonymousFunctionWithName(
if (node->is<FunctionNode>()) {
// Function doesn't have 'name' property at this point.
// Set function's name at compile time.
if (!setFunName(node->as<FunctionNode>().funbox(), name)) {
return false;
}
setFunName(node->as<FunctionNode>().funbox(), name);
return emitTree(node);
}
@ -3150,20 +3133,17 @@ bool BytecodeEmitter::emitAnonymousFunctionWithComputedName(
return emitClass(&node->as<ClassNode>(), ClassNameKind::ComputedName);
}
bool BytecodeEmitter::setFunName(FunctionBox* funbox,
TaggedParserAtomIndex name) {
void BytecodeEmitter::setFunName(FunctionBox* funbox,
TaggedParserAtomIndex name) const {
// The inferred name may already be set if this function is an interpreted
// lazy function and we OOM'ed after we set the inferred name the first
// time.
if (funbox->hasInferredName()) {
MOZ_ASSERT(!funbox->emitBytecode);
MOZ_ASSERT(funbox->displayAtom() == name);
return true;
} else {
funbox->setInferredName(name);
}
funbox->setInferredName(name);
return true;
}
bool BytecodeEmitter::emitInitializer(ParseNode* initializer,
@ -8242,7 +8222,7 @@ bool BytecodeEmitter::emitCalleeAndThis(ParseNode* callee, CallNode* maybeCall,
ParseNode* BytecodeEmitter::getCoordNode(ParseNode* callNode,
ParseNode* calleeNode, JSOp op,
ListNode* argsList) {
ListNode* argsList) const {
ParseNode* coordNode = callNode;
if (op == JSOp::Call || op == JSOp::SpreadCall) {
// Default to using the location of the `(` itself.
@ -9153,9 +9133,8 @@ bool BytecodeEmitter::emitConditionalExpression(
// constant name or numeric index, there is no accessor specified, and the value
// can be encoded by an ObjLiteral instruction (constant number, string,
// boolean, null/undefined).
void BytecodeEmitter::isPropertyListObjLiteralCompatible(ListNode* obj,
bool* withValues,
bool* withoutValues) {
void BytecodeEmitter::isPropertyListObjLiteralCompatible(
ListNode* obj, bool* withValues, bool* withoutValues) const {
bool keysOK = true;
bool valuesOK = true;
uint32_t propCount = 0;
@ -9222,7 +9201,7 @@ void BytecodeEmitter::isPropertyListObjLiteralCompatible(ListNode* obj,
*withoutValues = keysOK;
}
bool BytecodeEmitter::isArrayObjLiteralCompatible(ListNode* array) {
bool BytecodeEmitter::isArrayObjLiteralCompatible(ListNode* array) const {
for (ParseNode* elem : array->contents()) {
if (elem->isKind(ParseNodeKind::Spread)) {
return false;
@ -9857,7 +9836,7 @@ bool BytecodeEmitter::emitObjLiteralArray(ListNode* array) {
return true;
}
bool BytecodeEmitter::isRHSObjLiteralCompatible(ParseNode* value) {
bool BytecodeEmitter::isRHSObjLiteralCompatible(ParseNode* value) const {
return value->isKind(ParseNodeKind::NumberExpr) ||
value->isKind(ParseNodeKind::TrueExpr) ||
value->isKind(ParseNodeKind::FalseExpr) ||
@ -9923,7 +9902,7 @@ static bool HasDecorators(ParseNode* member) {
#endif
mozilla::Maybe<MemberInitializers> BytecodeEmitter::setupMemberInitializers(
ListNode* classMembers, FieldPlacement placement) {
ListNode* classMembers, FieldPlacement placement) const {
bool isStatic = placement == FieldPlacement::Static;
size_t numFields = 0;
@ -10656,8 +10635,9 @@ bool BytecodeEmitter::emitPrivateMethodInitializer(
return true;
}
const MemberInitializers& BytecodeEmitter::findMemberInitializersForCall() {
for (BytecodeEmitter* current = this; current; current = current->parent) {
const MemberInitializers& BytecodeEmitter::findMemberInitializersForCall()
const {
for (const auto* current = this; current; current = current->parent) {
if (current->sc->isFunctionBox()) {
FunctionBox* funbox = current->sc->asFunctionBox();
@ -12169,9 +12149,7 @@ bool BytecodeEmitter::emitClass(
bool needsHomeObject = ctor->funbox()->needsHomeObject();
// HERITAGE is consumed inside emitFunction.
if (nameKind == ClassNameKind::InferredName) {
if (!setFunName(ctor->funbox(), nameForAnonymousClass)) {
return false;
}
setFunName(ctor->funbox(), nameForAnonymousClass);
}
if (!emitFunction(ctor, isDerived)) {
// [stack] HOMEOBJ CTOR
@ -13163,7 +13141,8 @@ bool BytecodeEmitter::intoScriptStencil(ScriptIndex scriptIndex) {
return true;
}
SelfHostedIter BytecodeEmitter::getSelfHostedIterFor(ParseNode* parseNode) {
SelfHostedIter BytecodeEmitter::getSelfHostedIterFor(
ParseNode* parseNode) const {
if (emitterMode == BytecodeEmitter::SelfHosting &&
parseNode->isKind(ParseNodeKind::CallExpr)) {
auto* callee = parseNode->as<CallNode>().callee();

View file

@ -425,12 +425,12 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
return true;
}
bool isInLoop();
[[nodiscard]] bool checkSingletonContext();
bool isInLoop() const;
[[nodiscard]] bool checkSingletonContext() const;
bool needsImplicitThis();
bool needsImplicitThis() const;
size_t countThisEnvironmentHops();
size_t countThisEnvironmentHops() const;
[[nodiscard]] bool emitThisEnvironmentCallee();
[[nodiscard]] bool emitSuperBase();
@ -453,8 +453,8 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
}
}
void reportError(ParseNode* pn, unsigned errorNumber, ...);
void reportError(uint32_t offset, unsigned errorNumber, ...);
void reportError(ParseNode* pn, unsigned errorNumber, ...) const;
void reportError(uint32_t offset, unsigned errorNumber, ...) const;
// Fill in a ScriptStencil using this BCE data.
bool intoScriptStencil(ScriptIndex scriptIndex);
@ -469,10 +469,10 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
// statement, we define useless code as code with no side effects, because
// the main effect, the value left on the stack after the code executes,
// will be discarded by a pop bytecode.
[[nodiscard]] bool checkSideEffects(ParseNode* pn, bool* answer);
[[nodiscard]] bool checkSideEffects(ParseNode* pn, bool* answer) const;
#ifdef DEBUG
[[nodiscard]] bool checkStrictOrSloppy(JSOp op);
[[nodiscard]] bool checkStrictOrSloppy(JSOp op) const;
#endif
// Add TryNote to the tryNoteList array. The start and end offset are
@ -522,7 +522,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
// Calculate the `nslots` value for ImmutableScriptData constructor parameter.
// Fails if it overflows.
[[nodiscard]] bool getNslots(uint32_t* nslots);
[[nodiscard]] bool getNslots(uint32_t* nslots) const;
// Emit function code for the tree rooted at body.
[[nodiscard]] bool emitFunctionScript(FunctionNode* funNode);
@ -533,8 +533,6 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
[[nodiscard]] bool updateSourceCoordNotes(uint32_t offset);
[[nodiscard]] bool updateSourceCoordNotesIfNonLiteral(ParseNode* node);
JSOp strictifySetNameOp(JSOp op);
[[nodiscard]] bool emitCheck(JSOp op, ptrdiff_t delta,
BytecodeOffset* offset);
@ -611,7 +609,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
[[nodiscard]] bool emitCall(JSOp op, uint16_t argc, ParseNode* pn = nullptr);
[[nodiscard]] bool emitCallIncDec(UnaryNode* incDec);
uint32_t getOffsetForLoop(ParseNode* nextpn);
uint32_t getOffsetForLoop(ParseNode* nextpn) const;
enum class GotoKind { Break, Continue };
[[nodiscard]] bool emitGoto(NestableControl* target, GotoKind kind);
@ -642,8 +640,8 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
// values) or in template mode (field names only, no values) for the property
// list?
void isPropertyListObjLiteralCompatible(ListNode* obj, bool* withValues,
bool* withoutValues);
bool isArrayObjLiteralCompatible(ListNode* array);
bool* withoutValues) const;
bool isArrayObjLiteralCompatible(ListNode* array) const;
[[nodiscard]] bool emitPropertyList(ListNode* obj, PropertyEmitter& pe,
PropListType type);
@ -657,13 +655,13 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
[[nodiscard]] bool emitObjLiteralArray(ListNode* array);
// Is a field value JSOp::Object-compatible?
[[nodiscard]] bool isRHSObjLiteralCompatible(ParseNode* value);
[[nodiscard]] bool isRHSObjLiteralCompatible(ParseNode* value) const;
[[nodiscard]] bool emitObjLiteralValue(ObjLiteralWriter& writer,
ParseNode* value);
mozilla::Maybe<MemberInitializers> setupMemberInitializers(
ListNode* classMembers, FieldPlacement placement);
ListNode* classMembers, FieldPlacement placement) const;
[[nodiscard]] bool emitCreateFieldKeys(ListNode* obj,
FieldPlacement placement);
[[nodiscard]] bool emitCreateMemberInitializers(ClassEmitter& ce,
@ -674,7 +672,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
bool hasHeritage
#endif
);
const MemberInitializers& findMemberInitializersForCall();
const MemberInitializers& findMemberInitializersForCall() const;
[[nodiscard]] bool emitInitializeInstanceMembers(
bool isDerivedClassConstructor);
[[nodiscard]] bool emitInitializeStaticFields(ListNode* classMembers);
@ -820,7 +818,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
// two in the latter case) elements from the stack.
[[nodiscard]] bool emitCopyDataProperties(CopyOption option);
JSOp getIterCallOp(JSOp callOp, SelfHostedIter selfHostedIter);
JSOp getIterCallOp(JSOp callOp, SelfHostedIter selfHostedIter) const;
// Push the operands for emit(Async)Iterator onto the stack.
[[nodiscard]] bool emitIterable(ParseNode* value,
@ -870,7 +868,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
[[nodiscard]] bool emitAnonymousFunctionWithComputedName(
ParseNode* node, FunctionPrefixKind prefixKind);
[[nodiscard]] bool setFunName(FunctionBox* fun, TaggedParserAtomIndex name);
void setFunName(FunctionBox* fun, TaggedParserAtomIndex name) const;
[[nodiscard]] bool emitInitializer(ParseNode* initializer,
ParseNode* pattern);
@ -940,7 +938,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
[[nodiscard]] ParseNode* getCoordNode(ParseNode* callNode,
ParseNode* calleeNode, JSOp op,
ListNode* argsList);
ListNode* argsList) const;
[[nodiscard]] bool emitArguments(ListNode* argsList, bool isCall,
bool isSpread, CallOrNewEmitter& cone);
@ -1074,7 +1072,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
#endif
private:
[[nodiscard]] SelfHostedIter getSelfHostedIterFor(ParseNode* parseNode);
[[nodiscard]] SelfHostedIter getSelfHostedIterFor(ParseNode* parseNode) const;
[[nodiscard]] bool emitSelfHostedGetBuiltinConstructorOrPrototype(
CallNode* callNode, bool isConstructor);

View file

@ -105,7 +105,7 @@ struct MOZ_STACK_CLASS GCThingList {
uint32_t length() const { return vector.length(); }
const ScriptThingsStackVector& objects() { return vector; }
const ScriptThingsStackVector& objects() const { return vector; }
AbstractScopePtr getScope(size_t index) const;

View file

@ -26,7 +26,8 @@ DecoratorEmitter::DecoratorEmitter(BytecodeEmitter* bce) : bce_(bce) {}
// A helper function to read the decorators in reverse order to how they were
// parsed.
bool DecoratorEmitter::reverseDecoratorsToApplicationOrder(
const ListNode* decorators, DecoratorsVector& vec) {
const ListNode* decorators, DecoratorsVector& vec) const {
MOZ_ASSERT(!decorators->empty());
if (!vec.resize(decorators->count())) {
ReportOutOfMemory(bce_->fc);
return false;

View file

@ -74,7 +74,7 @@ class MOZ_STACK_CLASS DecoratorEmitter {
using DecoratorsVector = js::Vector<ParseNode*, 2, js::SystemAllocPolicy>;
[[nodiscard]] bool reverseDecoratorsToApplicationOrder(
const ListNode* decorators, DecoratorsVector& vec);
const ListNode* decorators, DecoratorsVector& vec) const;
};
} /* namespace js::frontend */

View file

@ -196,23 +196,21 @@ bool NameOpEmitter::prepareForRhs() {
switch (loc_.kind()) {
case NameLocation::Kind::Dynamic:
case NameLocation::Kind::Import:
case NameLocation::Kind::DynamicAnnexBVar:
if (!bce_->makeAtomIndex(name_, ParserAtom::Atomize::Yes, &atomIndex_)) {
return false;
}
if (loc_.kind() == NameLocation::Kind::DynamicAnnexBVar) {
// Annex B vars always go on the nearest variable environment,
// even if lexical environments in between contain same-named
// bindings.
if (!bce_->emit1(JSOp::BindVar)) {
// [stack] ENV
return false;
}
} else {
if (!bce_->emitAtomOp(JSOp::BindName, atomIndex_)) {
// [stack] ENV
return false;
}
if (!bce_->emitAtomOp(JSOp::BindName, atomIndex_)) {
// [stack] ENV
return false;
}
emittedBindOp_ = true;
break;
case NameLocation::Kind::DynamicAnnexBVar:
// Annex B vars always go on the nearest variable environment, even if
// lexical environments in between contain same-named bindings.
if (!bce_->emit1(JSOp::BindVar)) {
// [stack] ENV
return false;
}
emittedBindOp_ = true;
break;
@ -227,14 +225,14 @@ bool NameOpEmitter::prepareForRhs() {
// InitGLexical always gets the global lexical scope. It doesn't
// need a BindName/BindGName.
MOZ_ASSERT(bce_->innermostScope().is<GlobalScope>());
} else if (bce_->sc->hasNonSyntacticScope()) {
if (!bce_->emitAtomOp(JSOp::BindName, atomIndex_)) {
// [stack] ENV
return false;
}
emittedBindOp_ = true;
} else {
if (!bce_->emitAtomOp(JSOp::BindGName, atomIndex_)) {
JSOp op;
if (bce_->sc->hasNonSyntacticScope()) {
op = JSOp::BindName;
} else {
op = JSOp::BindGName;
}
if (!bce_->emitAtomOp(op, atomIndex_)) {
// [stack] ENV
return false;
}
@ -242,15 +240,10 @@ bool NameOpEmitter::prepareForRhs() {
}
break;
case NameLocation::Kind::Intrinsic:
break;
case NameLocation::Kind::NamedLambdaCallee:
break;
case NameLocation::Kind::ArgumentSlot:
break;
case NameLocation::Kind::FrameSlot:
break;
case NameLocation::Kind::DebugEnvironmentCoordinate:
break;
case NameLocation::Kind::EnvironmentCoordinate:
break;
}
@ -270,7 +263,7 @@ bool NameOpEmitter::prepareForRhs() {
// [stack] ENV ENV
return false;
}
if (!bce_->emitAtomOp(JSOp::GetBoundName, name_)) {
if (!bce_->emitAtomOp(JSOp::GetBoundName, atomIndex_)) {
// [stack] ENV V
return false;
}
@ -288,6 +281,24 @@ bool NameOpEmitter::prepareForRhs() {
return true;
}
JSOp NameOpEmitter::strictifySetNameOp(JSOp op) const {
switch (op) {
case JSOp::SetName:
if (bce_->sc->strict()) {
op = JSOp::StrictSetName;
}
break;
case JSOp::SetGName:
if (bce_->sc->strict()) {
op = JSOp::StrictSetGName;
}
break;
default:
MOZ_CRASH("Invalid SetName op");
}
return op;
}
#if defined(__clang__) && defined(XP_WIN) && \
(defined(_M_X64) || defined(__x86_64__))
// Work around a CPU bug. See bug 1524257.
@ -296,12 +307,22 @@ __attribute__((__aligned__(32)))
bool NameOpEmitter::emitAssignment() {
MOZ_ASSERT(state_ == State::Rhs);
// [stack] # If emittedBindOp_
// [stack] ENV V
// [stack] # else
// [stack] V
switch (loc_.kind()) {
case NameLocation::Kind::Dynamic:
case NameLocation::Kind::Import:
MOZ_ASSERT(emittedBindOp_);
if (!bce_->emitAtomOp(strictifySetNameOp(JSOp::SetName), atomIndex_)) {
return false;
}
break;
case NameLocation::Kind::DynamicAnnexBVar:
if (!bce_->emitAtomOp(bce_->strictifySetNameOp(JSOp::SetName),
atomIndex_)) {
MOZ_ASSERT(emittedBindOp_);
if (!bce_->emitAtomOp(strictifySetNameOp(JSOp::SetName), name_)) {
return false;
}
break;
@ -311,9 +332,9 @@ bool NameOpEmitter::emitAssignment() {
MOZ_ASSERT(bce_->outermostScope().hasNonSyntacticScopeOnChain() ==
bce_->sc->hasNonSyntacticScope());
if (bce_->sc->hasNonSyntacticScope()) {
op = bce_->strictifySetNameOp(JSOp::SetName);
op = strictifySetNameOp(JSOp::SetName);
} else {
op = bce_->strictifySetNameOp(JSOp::SetGName);
op = strictifySetNameOp(JSOp::SetGName);
}
} else {
op = JSOp::InitGLexical;
@ -390,25 +411,21 @@ bool NameOpEmitter::emitAssignment() {
return false;
}
}
}
if (loc_.bindingKind() == BindingKind::NamedLambdaCallee) {
} else if (loc_.bindingKind() == BindingKind::NamedLambdaCallee) {
// Assigning to the named lambda is a no-op in sloppy mode and throws
// in strict mode.
if (!bce_->sc->strict()) {
break;
}
op = JSOp::ThrowSetConst;
if (bce_->sc->strict()) {
if (!bce_->emitAtomOp(op, name_)) {
return false;
}
}
if (op == JSOp::ThrowSetConst) {
if (!bce_->emitAtomOp(op, name_)) {
return false;
}
} else {
if (op == JSOp::ThrowSetConst) {
if (!bce_->emitAtomOp(op, name_)) {
return false;
}
} else {
if (!bce_->emitEnvCoordOp(op, loc_.environmentCoordinate())) {
return false;
}
if (!bce_->emitEnvCoordOp(op, loc_.environmentCoordinate())) {
return false;
}
}
if (op == JSOp::InitAliasedLexical) {

View file

@ -167,6 +167,8 @@ class MOZ_STACK_CLASS NameOpEmitter {
[[nodiscard]] bool isInitialize() const { return kind_ == Kind::Initialize; }
JSOp strictifySetNameOp(JSOp op) const;
public:
[[nodiscard]] bool emittedBindOp() const { return emittedBindOp_; }

View file

@ -261,9 +261,9 @@ class SharedContext {
bool hasExplicitUseStrict() const { return hasExplicitUseStrict_; }
void setExplicitUseStrict() { hasExplicitUseStrict_ = true; }
ImmutableScriptFlags immutableFlags() { return immutableFlags_; }
ImmutableScriptFlags immutableFlags() const { return immutableFlags_; }
bool allBindingsClosedOver() { return bindingsAccessedDynamically(); }
bool allBindingsClosedOver() const { return bindingsAccessedDynamically(); }
// The ImmutableFlag tracks if the entire script is strict, while the
// localStrict flag indicates the current region (such as class body) should
@ -277,7 +277,7 @@ class SharedContext {
return retVal;
}
bool isEligibleForArgumentsLength() {
bool isEligibleForArgumentsLength() const {
return eligibleForArgumentsLength && !bindingsAccessedDynamically();
}
void setIneligibleForArgumentsLength() { eligibleForArgumentsLength = false; }
@ -564,7 +564,7 @@ class FunctionBox : public SuspendableContext {
bool isInterpreted() const { return flags_.hasBaseScript(); }
FunctionFlags::FunctionKind kind() { return flags_.kind(); }
FunctionFlags::FunctionKind kind() const { return flags_.kind(); }
bool hasInferredName() const { return flags_.hasInferredName(); }
bool hasGuessedAtom() const { return flags_.hasGuessedAtom(); }
@ -681,7 +681,7 @@ class FunctionBox : public SuspendableContext {
}
}
uint16_t length() { return length_; }
uint16_t length() const { return length_; }
void setLength(uint16_t length) { length_ = length; }
void setArgCount(uint16_t args) {
@ -689,7 +689,7 @@ class FunctionBox : public SuspendableContext {
nargs_ = args;
}
size_t nargs() { return nargs_; }
size_t nargs() const { return nargs_; }
const MemberInitializers& memberInitializers() const {
MOZ_ASSERT(useMemberInitializers());
@ -704,7 +704,7 @@ class FunctionBox : public SuspendableContext {
}
}
ScriptIndex index() { return funcDataIndex_; }
ScriptIndex index() const { return funcDataIndex_; }
void finishScriptFlags();
void copyFunctionFields(ScriptStencil& script);

View file

@ -0,0 +1,38 @@
this.a = 0;
function f(y) {
// Direct eval to make an extensible environment. Variables lookups within
// nested environments are now dynamic.
eval("");
{
// Block lexical environment whose shape guard we want to omit.
let w = y;
function g() {
// BindName "a" # ENV
// Dup # ENV ENV
// GetBoundName "a" # ENV ENV.a
// GetAliasedVar "w" (hops = 0, slot = 2) # ENV ENV.a w
// CheckAliasedLexical "w" (hops = 0, slot = 2) # ENV ENV.a w
// Add # ENV (ENV.a += w)
// NopIsAssignOp # ENV (ENV.a += w)
// SetName "a" # (ENV.a += w)
// Pop #
a += w;
}
for (var i = 0; i < 150; ++i) {
// Introduce a new binding in the global lexical environment which
// shadows the global property "a".
if (i === 100) {
evaluate("let a = 1000");
}
g();
}
assertEq(a, 1050);
assertEq(globalThis.a, 100);
}
}
f(1);

View file

@ -0,0 +1,43 @@
this.a = 0;
function f(y) {
// Direct eval to make an extensible environment. Variables lookups within
// nested environments are now dynamic.
eval("");
let w = y;
// Class with class-body lexical environment whose shape guard we want to omit.
class C {
// Add a private brand to generate a class-body lexical environment.
#private;
static m() {
// BindName "a" # ENV
// Dup # ENV ENV
// GetBoundName "a" # ENV ENV.a
// GetAliasedVar "w" (hops = 2, slot = 2) # ENV ENV.a w
// CheckAliasedLexical "w" (hops = 2, slot = 2) # ENV ENV.a w
// Add # ENV (ENV.a += w)
// NopIsAssignOp # ENV (ENV.a += w)
// StrictSetName "a" # (ENV.a += w)
// Pop #
a += w;
}
}
let g = C.m;
for (var i = 0; i < 150; ++i) {
// Introduce a new binding in the global lexical environment which
// shadows the global property "a".
if (i === 100) {
evaluate("let a = 1000");
}
g();
}
assertEq(a, 1050);
assertEq(globalThis.a, 100);
}
f(1);

View file

@ -0,0 +1,38 @@
this.a = 0;
function f(y) {
// Direct eval to make an extensible environment. Variables lookups within
// nested environments are now dynamic.
eval("");
let w = y;
// Function with NamedLambdaObject environment whose shape guard we want to omit.
let g = function lambda() {
// Eval to introduce a NamedLambdaObject environment.
eval("");
// BindName "a" # ENV
// Dup # ENV ENV
// GetBoundName "a" # ENV ENV.a
// GetName "w" # ENV ENV.a w
// Add # ENV (ENV.a += w)
// NopIsAssignOp # ENV (ENV.a += w)
// SetName "a" # (ENV.a += w)
// Pop #
a += w;
};
for (var i = 0; i < 150; ++i) {
// Introduce a new binding in the global lexical environment which
// shadows the global property "a".
if (i === 100) {
evaluate("let a = 1000");
}
g();
}
assertEq(a, 1050);
assertEq(globalThis.a, 100);
}
f(1);

View file

@ -0,0 +1,9 @@
// |jit-test| --ion-offthread-compile=off; --fuzzing-safe; slow; skip-if: getBuildConfiguration("tsan")
setJitCompilerOption("ion.warmup.trigger", 5)
oomTest(function () {
function foo() {
for (a = 0; a < 10; a++) trialInline(..."use strict")
}
evaluate(foo + "foo()")
})

View file

@ -1199,12 +1199,12 @@ bool DoBindNameFallback(JSContext* cx, BaselineFrame* frame,
TryAttachStub<BindNameIRGenerator>("BindName", cx, frame, stub, envChain,
name);
RootedObject scope(cx);
if (!LookupNameUnqualified(cx, name, envChain, &scope)) {
JSObject* env = LookupNameUnqualified(cx, name, envChain);
if (!env) {
return false;
}
res.setObject(*scope);
res.setObject(*env);
return true;
}

View file

@ -3592,22 +3592,26 @@ AttachDecision GetNameIRGenerator::tryAttachGlobalNameGetter(ObjOperandId objId,
}
static bool NeedEnvironmentShapeGuard(JSContext* cx, JSObject* envObj) {
if (!envObj->is<CallObject>()) {
return true;
}
// We can skip a guard on the call object if the script's bindings are
// guaranteed to be immutable (and thus cannot introduce shadowing variables).
// If the function is a relazified self-hosted function it has no BaseScript
// and we pessimistically create the guard.
CallObject* callObj = &envObj->as<CallObject>();
JSFunction* fun = &callObj->callee();
if (!fun->hasBaseScript() || fun->baseScript()->funHasExtensibleScope() ||
DebugEnvironments::hasDebugEnvironment(cx, *callObj)) {
return true;
if (envObj->is<CallObject>()) {
auto* callObj = &envObj->as<CallObject>();
JSFunction* fun = &callObj->callee();
return !fun->hasBaseScript() ||
fun->baseScript()->funHasExtensibleScope() ||
DebugEnvironments::hasDebugEnvironment(cx, *callObj);
}
return false;
// Similar to the call object case, we can also skip a guard if the lexical
// environment's bindings are immutable.
if (envObj->is<LexicalEnvironmentObject>()) {
return envObj->as<LexicalEnvironmentObject>().isExtensible();
}
// Use a shape guard for all other environment objects.
return true;
}
AttachDecision GetNameIRGenerator::tryAttachEnvironmentName(ObjOperandId objId,

Some files were not shown because too many files have changed in this diff Show more