Commit 0899850a authored by Carsten Schoenert's avatar Carsten Schoenert
Browse files

New upstream version 91.4.0

parent 7fd56f0e
......@@ -20,7 +20,7 @@ rev = "1bb484e96ae724309e3346968e8ffd4c25e61616"
[source."https://github.com/mozilla/cubeb-pulse-rs"]
git = "https://github.com/mozilla/cubeb-pulse-rs"
replace-with = "vendored-sources"
rev = "c87b50aebfa088c1ad30c74819d4e9829f88b2e3"
rev = "b0acd9e16c0249d61835a2d23735fbcbd8cbef64"
[source."https://github.com/mozilla/cubeb-coreaudio-rs"]
git = "https://github.com/mozilla/cubeb-coreaudio-rs"
......@@ -97,6 +97,11 @@ git = "https://github.com/bytecodealliance/wasmtime"
replace-with = "vendored-sources"
rev = "824fa69756523f2b6d49029fe25de94130b1f144"
[source."https://github.com/alexcrichton/cc-rs/"]
git = "https://github.com/alexcrichton/cc-rs/"
replace-with = "vendored-sources"
rev = "b2f6b146b75299c444e05bbde50d03705c7c4b6e"
[source."https://github.com/PLSysSec/rlbox_lucet_sandbox/"]
git = "https://github.com/PLSysSec/rlbox_lucet_sandbox/"
replace-with = "vendored-sources"
......
......@@ -491,9 +491,8 @@ dependencies = [
[[package]]
name = "cc"
version = "1.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787"
version = "1.0.71"
source = "git+https://github.com/alexcrichton/cc-rs/?rev=b2f6b146b75299c444e05bbde50d03705c7c4b6e#b2f6b146b75299c444e05bbde50d03705c7c4b6e"
dependencies = [
"jobserver",
]
......@@ -1028,7 +1027,7 @@ dependencies = [
[[package]]
name = "cubeb-pulse"
version = "0.3.0"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=c87b50aebfa088c1ad30c74819d4e9829f88b2e3#c87b50aebfa088c1ad30c74819d4e9829f88b2e3"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=b0acd9e16c0249d61835a2d23735fbcbd8cbef64#b0acd9e16c0249d61835a2d23735fbcbd8cbef64"
dependencies = [
"cubeb-backend",
"pulse",
......@@ -3870,7 +3869,7 @@ dependencies = [
[[package]]
name = "pulse"
version = "0.3.0"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=c87b50aebfa088c1ad30c74819d4e9829f88b2e3#c87b50aebfa088c1ad30c74819d4e9829f88b2e3"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=b0acd9e16c0249d61835a2d23735fbcbd8cbef64#b0acd9e16c0249d61835a2d23735fbcbd8cbef64"
dependencies = [
"bitflags",
"pulse-ffi",
......@@ -3879,7 +3878,7 @@ dependencies = [
[[package]]
name = "pulse-ffi"
version = "0.1.0"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=c87b50aebfa088c1ad30c74819d4e9829f88b2e3#c87b50aebfa088c1ad30c74819d4e9829f88b2e3"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=b0acd9e16c0249d61835a2d23735fbcbd8cbef64#b0acd9e16c0249d61835a2d23735fbcbd8cbef64"
dependencies = [
"libc",
]
......
......@@ -109,3 +109,8 @@ path = "third_party/rust/failure"
[patch.crates-io.prost-derive]
path = "third_party/rust/prost-derive"
# Pick upstream patch for GCC 11 on armhf linux.
[patch.crates-io.cc]
git = "https://github.com/alexcrichton/cc-rs/"
rev = "b2f6b146b75299c444e05bbde50d03705c7c4b6e"
......@@ -663,20 +663,22 @@ static bool VisitDocAccessibleParentDescendantsAtTopLevelInContentProcess(
already_AddRefed<IAccessible> MsaaAccessible::GetRemoteIAccessibleFor(
const VARIANT& aVarChild) {
a11y::RootAccessible* root = LocalAcc()->RootAccessible();
const nsTArray<DocAccessibleParent*>* remoteDocs =
const nsTArray<DocAccessibleParent*>* rawRemoteDocs =
DocManager::TopLevelRemoteDocs();
if (!remoteDocs) {
if (!rawRemoteDocs) {
return nullptr;
}
nsTArray<RefPtr<DocAccessibleParent>> remoteDocs(rawRemoteDocs->Length());
for (auto rawRemoteDoc : *rawRemoteDocs) {
remoteDocs.AppendElement(rawRemoteDoc);
}
RefPtr<IAccessible> result;
// We intentionally leave the call to remoteDocs->Length() inside the loop
// condition because it is possible for reentry to occur in the call to
// GetProxiedAccessibleInSubtree() such that remoteDocs->Length() is mutated.
for (size_t i = 0; i < remoteDocs->Length(); i++) {
DocAccessibleParent* topRemoteDoc = remoteDocs->ElementAt(i);
for (auto topRemoteDoc : remoteDocs) {
if (topRemoteDoc->IsShutdown()) {
continue;
}
LocalAccessible* outerDoc = topRemoteDoc->OuterDocOfRemoteBrowser();
if (!outerDoc) {
continue;
......
......@@ -23,6 +23,12 @@ ChromeUtils.defineModuleGetter(
"resource://gre/modules/E10SUtils.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"BrowserUtils",
"resource://gre/modules/BrowserUtils.jsm"
);
class ClickHandlerChild extends JSWindowActorChild {
handleEvent(event) {
if (
......@@ -59,7 +65,9 @@ class ClickHandlerChild extends JSWindowActorChild {
}
}
let [href, node, principal] = this._hrefAndLinkNodeForClickEvent(event);
let [href, node, principal] = BrowserUtils.hrefAndLinkNodeForClickEvent(
event
);
let csp = ownerDoc.csp;
if (csp) {
......@@ -133,65 +141,4 @@ class ClickHandlerChild extends JSWindowActorChild {
this.sendAsyncMessage("Content:Click", json);
}
}
/**
* Extracts linkNode and href for the current click target.
*
* @param event
* The click event.
* @return [href, linkNode, linkPrincipal].
*
* @note linkNode will be null if the click wasn't on an anchor
* element. This includes SVG links, because callers expect |node|
* to behave like an <a> element, which SVG links (XLink) don't.
*/
_hrefAndLinkNodeForClickEvent(event) {
let content = this.contentWindow;
function isHTMLLink(aNode) {
// Be consistent with what nsContextMenu.js does.
return (
(aNode instanceof content.HTMLAnchorElement && aNode.href) ||
(aNode instanceof content.HTMLAreaElement && aNode.href) ||
aNode instanceof content.HTMLLinkElement
);
}
let node = event.composedTarget;
while (node && !isHTMLLink(node)) {
node = node.flattenedTreeParentNode;
}
if (node) {
return [node.href, node, node.ownerDocument.nodePrincipal];
}
// If there is no linkNode, try simple XLink.
let href, baseURI;
node = event.composedTarget;
while (node && !href) {
if (
node.nodeType == content.Node.ELEMENT_NODE &&
(node.localName == "a" ||
node.namespaceURI == "http://www.w3.org/1998/Math/MathML")
) {
href =
node.getAttribute("href") ||
node.getAttributeNS("http://www.w3.org/1999/xlink", "href");
if (href) {
baseURI = node.ownerDocument.baseURIObject;
break;
}
}
node = node.flattenedTreeParentNode;
}
// In case of XLink, we don't return the node we got href from since
// callers expect <a>-like elements.
// Note: makeURI() will throw if aUri is not a valid URI.
return [
href ? Services.io.newURI(href, null, baseURI).spec : null,
null,
node && node.ownerDocument.nodePrincipal,
];
}
}
......@@ -55,6 +55,11 @@ class ClickHandlerParent extends JSWindowActorParent {
// This is heavily based on contentAreaClick from browser.js (Bug 903016)
// The data is set up in a way to look like an Event.
let browser = this.manager.browsingContext.top.embedderElement;
if (!browser) {
// Can be null if the tab disappeared by the time we got the message.
// Just bail.
return;
}
let window = browser.ownerGlobal;
if (!data.href) {
......
......@@ -122,8 +122,17 @@ var PointerlockFsWarning = {
this._timeoutHide.start();
},
close() {
if (!this._element) {
/**
* Close the full screen or pointerlock warning.
* @param {('fullscreen-warning'|'pointerlock-warning')} elementId - Id of the
* warning element to close. If the id does not match the currently shown
* warning this is a no-op.
*/
close(elementId) {
if (!elementId) {
throw new Error("Must pass id of warning element to close");
}
if (!this._element || this._element.id != elementId) {
return;
}
// Cancel any pending timeout
......@@ -245,7 +254,7 @@ var PointerLock = {
},
exited() {
PointerlockFsWarning.close();
PointerlockFsWarning.close("pointerlock-warning");
},
};
......@@ -447,7 +456,7 @@ var FullScreen = {
// If we have a current pointerlock warning shown then hide it
// before transition.
PointerlockFsWarning.close();
PointerlockFsWarning.close("pointerlock-warning");
// If it is a remote browser, send a message to ask the content
// to enter fullscreen state. We don't need to do so if it is an
......@@ -569,7 +578,7 @@ var FullScreen = {
true
);
PointerlockFsWarning.close();
PointerlockFsWarning.close("fullscreen-warning");
gBrowser.tabContainer.removeEventListener(
"TabSelect",
this.exitDomFullScreen
......
......@@ -118,6 +118,9 @@ let propNameWhitelist = [
// This variable is used from CSS embedded in JS in adjustableTitle.js
{ propName: "--icon-url", isFromDevTools: false },
// This variable is used from CSS embedded in JS in pdf.js
{ propName: "--zoom-factor", isFromDevTools: false },
];
// Add suffix to stylesheets' URI so that we always load them here and
......
......@@ -91,7 +91,7 @@
#downloadsPanel-blockedSubview,
#downloadsPanel-mainView {
font: caption;
width: 35em;
min-width: 37em;
padding: 0.62em;
}
......
......@@ -117,7 +117,7 @@
<panelview id="downloadsPanel-mainView">
<vbox class="panel-view-body-unscrollable">
<richlistbox id="downloadsListBox"
data-l10n-id="downloads-panel-list"
data-l10n-id="downloads-panel-items"
data-l10n-attrs="style"
context="downloadsContextMenu"
onmouseover="DownloadsView.onDownloadMouseOver(event);"
......
......@@ -423,50 +423,10 @@ var Policies = {
});
}
if (
param.Default !== undefined ||
param.AcceptThirdParty !== undefined ||
param.RejectTracker !== undefined ||
param.Locked
) {
const ACCEPT_COOKIES = 0;
const REJECT_THIRD_PARTY_COOKIES = 1;
const REJECT_ALL_COOKIES = 2;
const REJECT_UNVISITED_THIRD_PARTY = 3;
const REJECT_TRACKER = 4;
let newCookieBehavior = ACCEPT_COOKIES;
if (param.Default !== undefined && !param.Default) {
newCookieBehavior = REJECT_ALL_COOKIES;
} else if (param.AcceptThirdParty) {
if (param.AcceptThirdParty == "never") {
newCookieBehavior = REJECT_THIRD_PARTY_COOKIES;
} else if (param.AcceptThirdParty == "from-visited") {
newCookieBehavior = REJECT_UNVISITED_THIRD_PARTY;
}
} else if (param.RejectTracker !== undefined && param.RejectTracker) {
newCookieBehavior = REJECT_TRACKER;
}
setDefaultPref(
"network.cookie.cookieBehavior",
newCookieBehavior,
param.Locked
);
setDefaultPref(
"network.cookie.cookieBehavior.pbmode",
newCookieBehavior,
param.Locked
);
}
const KEEP_COOKIES_UNTIL_EXPIRATION = 0;
const KEEP_COOKIES_UNTIL_END_OF_SESSION = 2;
if (param.ExpireAtSessionEnd !== undefined || param.Locked) {
let newLifetimePolicy = KEEP_COOKIES_UNTIL_EXPIRATION;
let newLifetimePolicy = Ci.nsICookieService.ACCEPT_NORMALLY;
if (param.ExpireAtSessionEnd) {
newLifetimePolicy = KEEP_COOKIES_UNTIL_END_OF_SESSION;
newLifetimePolicy = Ci.nsICookieService.ACCEPT_SESSION;
}
setDefaultPref(
......@@ -475,6 +435,68 @@ var Policies = {
param.Locked
);
}
// New Cookie Behavior option takes precendence
let defaultPref = Services.prefs.getDefaultBranch("");
let newCookieBehavior = defaultPref.getIntPref(
"network.cookie.cookieBehavior"
);
let newCookieBehaviorPB = defaultPref.getIntPref(
"network.cookie.cookieBehavior.pbmode"
);
if ("Behavior" in param || "BehaviorPrivateBrowsing" in param) {
let behaviors = {
accept: Ci.nsICookieService.BEHAVIOR_ACCEPT,
"reject-foreign": Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN,
reject: Ci.nsICookieService.BEHAVIOR_REJECT,
"limit-foreign": Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN,
"reject-tracker": Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER,
"reject-tracker-and-partition-foreign":
Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN,
};
if ("Behavior" in param) {
newCookieBehavior = behaviors[param.Behavior];
}
if ("BehaviorPrivateBrowsing" in param) {
newCookieBehaviorPB = behaviors[param.BehaviorPrivateBrowsing];
}
} else {
// Default, AcceptThirdParty, and RejectTracker are being
// deprecated in favor of Behavior. They will continue
// to be supported, though.
if (
param.Default !== undefined ||
param.AcceptThirdParty !== undefined ||
param.RejectTracker !== undefined ||
param.Locked
) {
newCookieBehavior = Ci.nsICookieService.BEHAVIOR_ACCEPT;
if (param.Default !== undefined && !param.Default) {
newCookieBehavior = Ci.nsICookieService.BEHAVIOR_REJECT;
} else if (param.AcceptThirdParty) {
if (param.AcceptThirdParty == "never") {
newCookieBehavior = Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN;
} else if (param.AcceptThirdParty == "from-visited") {
newCookieBehavior = Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN;
}
} else if (param.RejectTracker) {
newCookieBehavior = Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER;
}
}
// With the old cookie policy, we made private browsing the same.
newCookieBehaviorPB = newCookieBehavior;
}
// We set the values no matter what just in case the policy was only used to lock.
setDefaultPref(
"network.cookie.cookieBehavior",
newCookieBehavior,
param.Locked
);
setDefaultPref(
"network.cookie.cookieBehavior.pbmode",
newCookieBehaviorPB,
param.Locked
);
},
},
......@@ -1123,6 +1145,13 @@ var Policies = {
locked
);
}
if ("SponsoredTopSites" in param) {
setDefaultPref(
"browser.newtabpage.activity-stream.showSponsoredTopSites",
param.SponsoredTopSites,
locked
);
}
if ("Highlights" in param) {
setDefaultPref(
"browser.newtabpage.activity-stream.feeds.section.highlights",
......@@ -1142,6 +1171,13 @@ var Policies = {
locked
);
}
if ("SponsoredPocket" in param) {
setDefaultPref(
"browser.newtabpage.activity-stream.showSponsored",
param.SponsoredPocket,
locked
);
}
if ("Snippets" in param) {
setDefaultPref(
"browser.newtabpage.activity-stream.feeds.snippets",
......@@ -1549,6 +1585,7 @@ var Policies = {
"geo.",
"gfx.",
"intl.",
"keyword.enabled",
"layers.",
"layout.",
"media.",
......@@ -1558,6 +1595,7 @@ var Policies = {
"print.",
"signon.",
"spellchecker.",
"toolkit.legacyUserProfileCustomizations.stylesheets",
"ui.",
"widget.",
];
......
......@@ -217,7 +217,18 @@
"Locked": {
"type": "boolean"
},
"Behavior": {
"type": "string",
"enum": ["accept", "reject-foreign", "reject", "limit-foreign", "reject-tracker", "reject-tracker-and-partition-foreign"]
},
"BehaviorPrivateBrowsing": {
"type": "string",
"enum": ["accept", "reject-foreign", "reject", "limit-foreign", "reject-tracker", "reject-tracker-and-partition-foreign"]
}
}
},
......@@ -526,12 +537,18 @@
"TopSites": {
"type": "boolean"
},
"SponsoredTopSites": {
"type": "boolean"
},
"Highlights": {
"type": "boolean"
},
"Pocket": {
"type": "boolean"
},
"SponsoredPocket": {
"type": "boolean"
},
"Snippets": {
"type": "boolean"
},
......
......@@ -82,8 +82,10 @@ add_task(async function test_firefoxhome_preferences_set() {
FirefoxHome: {
Search: false,
TopSites: false,
SponsoredTopSites: false,
Highlights: false,
Pocket: false,
SponsoredPocket: false,
Snippets: false,
Locked: true,
},
......@@ -94,8 +96,11 @@ add_task(async function test_firefoxhome_preferences_set() {
let data = {
Search: "browser.newtabpage.activity-stream.showSearch",
TopSites: "browser.newtabpage.activity-stream.feeds.topsites",
SponsoredTopSites:
"browser.newtabpage.activity-stream.showSponsoredTopSites",
Highlights: "browser.newtabpage.activity-stream.feeds.section.highlights",
Pocket: "browser.newtabpage.activity-stream.feeds.section.topstories",
SponsoredPocket: "browser.newtabpage.activity-stream.showSponsored",
Snippets: "browser.newtabpage.activity-stream.feeds.snippets",
};
for (let [section, preference] of Object.entries(data)) {
......
......@@ -132,6 +132,19 @@ add_task(async function test_open_managedbookmark() {
await openContextMenuPromise;
info("Opened context menu");
ok(
document.getElementById("placesContext_open:newprivatewindow").hidden,
"Private Browsing menu should be hidden"
);
ok(
document.getElementById("placesContext_openContainer:tabs").hidden,
"Open in Tabs should be hidden"
);
ok(
document.getElementById("placesContext_delete").hidden,
"Delete should be hidden"
);
let tabCreatedPromise = BrowserTestUtils.waitForNewTab(gBrowser, null, true);
let openInNewTabOption = document.getElementById("placesContext_open:newtab");
......
{
"policies": {
"DisablePrivateBrowsing": true,
"DisplayBookmarksToolbar": true,
"ManagedBookmarks": [{
"toplevel_name": "Folder 1"
......
......@@ -817,6 +817,90 @@ const POLICIES_TESTS = [
"network.http.windows-sso.enabled": true,
},
},
{
policies: {
Cookies: {
Behavior: "accept",
BehaviorPrivateBrowsing: "reject-foreign",
Locked: true,
},
},
lockedPrefs: {
"network.cookie.cookieBehavior": 0,
"network.cookie.cookieBehavior.pbmode": 1,
},
},
{
policies: {
Cookies: {
Behavior: "reject-foreign",
BehaviorPrivateBrowsing: "reject",
Locked: true,
},
},
lockedPrefs: {
"network.cookie.cookieBehavior": 1,
"network.cookie.cookieBehavior.pbmode": 2,
},
},
{
policies: {
Cookies: {
Behavior: "reject",
BehaviorPrivateBrowsing: "limit-foreign",
Locked: true,
},
},
lockedPrefs: {
"network.cookie.cookieBehavior": 2,
"network.cookie.cookieBehavior.pbmode": 3,
},
},
{
policies: {
Cookies: {
Behavior: "limit-foreign",
BehaviorPrivateBrowsing: "reject-tracker",
Locked: true,
},
},
lockedPrefs: {
"network.cookie.cookieBehavior": 3,
"network.cookie.cookieBehavior.pbmode": 4,
},
},
{
policies: {
Cookies: {
Behavior: "reject-tracker",
BehaviorPrivateBrowsing: "reject-tracker-and-partition-foreign",
Locked: true,
},
},
lockedPrefs: {