зеркало из https://github.com/mozilla/gecko-dev.git
Merge autoland to mozilla-central. a=merge
This commit is contained in:
Коммит
d16b35de84
|
@ -50,7 +50,7 @@ rev = "fb7a2b12ced3b43e6a268621989c6191d1ed7e39"
|
|||
[source."https://github.com/mozilla/application-services"]
|
||||
git = "https://github.com/mozilla/application-services"
|
||||
replace-with = "vendored-sources"
|
||||
rev = "d8503475f43dbf1d78eef4e23b0578d0fada3f39"
|
||||
rev = "b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb"
|
||||
|
||||
[source."https://github.com/mozilla-spidermonkey/jsparagus"]
|
||||
git = "https://github.com/mozilla-spidermonkey/jsparagus"
|
||||
|
|
|
@ -240,3 +240,4 @@ browser/extensions/translations/extension/
|
|||
|
||||
# "scaffolding" used by uniffi which isn't valid JS in its original form.
|
||||
toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/
|
||||
toolkit/components/uniffi-bindgen-gecko-js/components/generated/*
|
||||
|
|
|
@ -1535,7 +1535,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "error-support"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=d8503475f43dbf1d78eef4e23b0578d0fada3f39#d8503475f43dbf1d78eef4e23b0578d0fada3f39"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb#b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb"
|
||||
dependencies = [
|
||||
"log",
|
||||
]
|
||||
|
@ -2185,6 +2185,7 @@ dependencies = [
|
|||
"rust_minidump_writer_linux",
|
||||
"static_prefs",
|
||||
"storage",
|
||||
"tabs",
|
||||
"tokio-reactor",
|
||||
"tokio-threadpool",
|
||||
"unic-langid",
|
||||
|
@ -2664,7 +2665,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "interrupt-support"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=d8503475f43dbf1d78eef4e23b0578d0fada3f39#d8503475f43dbf1d78eef4e23b0578d0fada3f39"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb#b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"parking_lot 0.12.999",
|
||||
|
@ -3751,7 +3752,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "nss_build_common"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=d8503475f43dbf1d78eef4e23b0578d0fada3f39#d8503475f43dbf1d78eef4e23b0578d0fada3f39"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb#b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb"
|
||||
|
||||
[[package]]
|
||||
name = "nsstring"
|
||||
|
@ -4930,7 +4931,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "sql-support"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=d8503475f43dbf1d78eef4e23b0578d0fada3f39#d8503475f43dbf1d78eef4e23b0578d0fada3f39"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb#b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb"
|
||||
dependencies = [
|
||||
"ffi-support",
|
||||
"interrupt-support",
|
||||
|
@ -5112,7 +5113,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "sync-guid"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=d8503475f43dbf1d78eef4e23b0578d0fada3f39#d8503475f43dbf1d78eef4e23b0578d0fada3f39"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb#b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"rand 0.8.5",
|
||||
|
@ -5123,7 +5124,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "sync15"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=d8503475f43dbf1d78eef4e23b0578d0fada3f39#d8503475f43dbf1d78eef4e23b0578d0fada3f39"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb#b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"error-support",
|
||||
|
@ -5150,6 +5151,30 @@ dependencies = [
|
|||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tabs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb#b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"error-support",
|
||||
"interrupt-support",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"rusqlite",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"sql-support",
|
||||
"sync-guid",
|
||||
"sync15",
|
||||
"thiserror",
|
||||
"uniffi",
|
||||
"uniffi_build",
|
||||
"uniffi_macros",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tap"
|
||||
version = "1.0.1"
|
||||
|
@ -5858,7 +5883,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
|||
[[package]]
|
||||
name = "viaduct"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=d8503475f43dbf1d78eef4e23b0578d0fada3f39#d8503475f43dbf1d78eef4e23b0578d0fada3f39"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb#b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb"
|
||||
dependencies = [
|
||||
"ffi-support",
|
||||
"log",
|
||||
|
@ -6014,7 +6039,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "webext-storage"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=d8503475f43dbf1d78eef4e23b0578d0fada3f39#d8503475f43dbf1d78eef4e23b0578d0fada3f39"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb#b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb"
|
||||
dependencies = [
|
||||
"error-support",
|
||||
"ffi-support",
|
||||
|
|
11
Cargo.toml
11
Cargo.toml
|
@ -157,11 +157,12 @@ midir = { git = "https://github.com/mozilla/midir.git", rev = "e1b4dcb767f9e69af
|
|||
minidump_writer_linux = { git = "https://github.com/rust-minidump/minidump-writer.git", rev = "75ada456c92a429704691a85e1cb42fef8cafc0d" }
|
||||
|
||||
# application-services overrides to make updating them all simpler.
|
||||
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "d8503475f43dbf1d78eef4e23b0578d0fada3f39" }
|
||||
sql-support = { git = "https://github.com/mozilla/application-services", rev = "d8503475f43dbf1d78eef4e23b0578d0fada3f39" }
|
||||
sync15 = { git = "https://github.com/mozilla/application-services", rev = "d8503475f43dbf1d78eef4e23b0578d0fada3f39" }
|
||||
viaduct = { git = "https://github.com/mozilla/application-services", rev = "d8503475f43dbf1d78eef4e23b0578d0fada3f39" }
|
||||
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "d8503475f43dbf1d78eef4e23b0578d0fada3f39" }
|
||||
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb" }
|
||||
sql-support = { git = "https://github.com/mozilla/application-services", rev = "b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb" }
|
||||
sync15 = { git = "https://github.com/mozilla/application-services", rev = "b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb" }
|
||||
tabs = { git = "https://github.com/mozilla/application-services", rev = "b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb" }
|
||||
viaduct = { git = "https://github.com/mozilla/application-services", rev = "b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb" }
|
||||
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "b09ffe23ee60a066176e5d7f9f2c6cd95c528ceb" }
|
||||
|
||||
# Patch mio 0.6 to use winapi 0.3 and miow 0.3, getting rid of winapi 0.2.
|
||||
# There is not going to be new version of mio 0.6, mio now being >= 0.7.11.
|
||||
|
|
|
@ -1675,12 +1675,30 @@ void LocalAccessible::Value(nsString& aValue) const {
|
|||
|
||||
double LocalAccessible::MaxValue() const {
|
||||
double checkValue = AttrNumericValue(nsGkAtoms::aria_valuemax);
|
||||
return IsNaN(checkValue) && !NativeHasNumericValue() ? 100 : checkValue;
|
||||
if (IsNaN(checkValue) && !NativeHasNumericValue()) {
|
||||
// aria-valuemax isn't present and this element doesn't natively provide a
|
||||
// maximum value. Use the ARIA default.
|
||||
const nsRoleMapEntry* roleMap = ARIARoleMap();
|
||||
if (roleMap && roleMap->role == roles::SPINBUTTON) {
|
||||
return UnspecifiedNaN<double>();
|
||||
}
|
||||
return 100;
|
||||
}
|
||||
return checkValue;
|
||||
}
|
||||
|
||||
double LocalAccessible::MinValue() const {
|
||||
double checkValue = AttrNumericValue(nsGkAtoms::aria_valuemin);
|
||||
return IsNaN(checkValue) && !NativeHasNumericValue() ? 0 : checkValue;
|
||||
if (IsNaN(checkValue) && !NativeHasNumericValue()) {
|
||||
// aria-valuemin isn't present and this element doesn't natively provide a
|
||||
// minimum value. Use the ARIA default.
|
||||
const nsRoleMapEntry* roleMap = ARIARoleMap();
|
||||
if (roleMap && roleMap->role == roles::SPINBUTTON) {
|
||||
return UnspecifiedNaN<double>();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return checkValue;
|
||||
}
|
||||
|
||||
double LocalAccessible::Step() const {
|
||||
|
@ -1690,6 +1708,12 @@ double LocalAccessible::Step() const {
|
|||
double LocalAccessible::CurValue() const {
|
||||
double checkValue = AttrNumericValue(nsGkAtoms::aria_valuenow);
|
||||
if (IsNaN(checkValue) && !NativeHasNumericValue()) {
|
||||
// aria-valuenow isn't present and this element doesn't natively provide a
|
||||
// current value. Use the ARIA default.
|
||||
const nsRoleMapEntry* roleMap = ARIARoleMap();
|
||||
if (roleMap && roleMap->role == roles::SPINBUTTON) {
|
||||
return UnspecifiedNaN<double>();
|
||||
}
|
||||
double minValue = MinValue();
|
||||
return minValue + ((MaxValue() - minValue) / 2);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,14 @@
|
|||
testValue(`${role}_vtvn`, "juice", 6, 0, 100, 0);
|
||||
}
|
||||
|
||||
testValue("spinbutton_default", "", 0, 0, 0, 0);
|
||||
testValue("spinbutton_min1max50", "", 0, 1, 50, 0);
|
||||
testValue("spinbutton_max200", "", 0, 0, 200, 0);
|
||||
testValue("spinbutton_min10", "", 0, 10, 0, 0);
|
||||
testValue("spinbutton_vt", "juice", 0, 0, 0, 0);
|
||||
testValue("spinbutton_vn", "6", 6, 0, 0, 0);
|
||||
testValue("spinbutton_vtvn", "juice", 6, 0, 0, 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
@ -63,6 +71,15 @@
|
|||
<div id="scrollbar_vt" role="scrollbar" aria-valuetext="juice">orange scrollbar</div>
|
||||
<div id="scrollbar_vn" role="scrollbar" aria-valuenow="6">chocolate scrollbar</div>
|
||||
<div id="scrollbar_vtvn" role="scrollbar" aria-valuetext="juice" aria-valuenow="6">apple scrollbar</div>
|
||||
|
||||
<!-- ARIA spinbuttons -->
|
||||
<div id="spinbutton_default" role="spinbutton">vanilla spinbutton</div>
|
||||
<div id="spinbutton_min1max50" role="spinbutton" aria-valuemin="1" aria-valuemax="50">banana spinbutton</div>
|
||||
<div id="spinbutton_max200" role="spinbutton" aria-valuemax="200">cherry spinbutton</div>
|
||||
<div id="spinbutton_min10" role="spinbutton" aria-valuemin="10">strawberry spinbutton</div>
|
||||
<div id="spinbutton_vt" role="spinbutton" aria-valuetext="juice">orange spinbutton</div>
|
||||
<div id="spinbutton_vn" role="spinbutton" aria-valuenow="6">chocolate spinbutton</div>
|
||||
<div id="spinbutton_vtvn" role="spinbutton" aria-valuetext="juice" aria-valuenow="6">apple spinbutton</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
<!-- This HBOX is duplicated below with class="update" -->
|
||||
<hbox align="baseline">
|
||||
<label id="version"/>
|
||||
<label id="releasenotes" is="text-link" hidden="true" flex="1" data-l10n-id="releaseNotes-link"/>
|
||||
<label id="releasenotes" is="text-link" hidden="true" data-l10n-id="releaseNotes-link"/>
|
||||
</hbox>
|
||||
#endif
|
||||
|
||||
|
@ -106,7 +106,7 @@
|
|||
<!-- This HBOX is duplicated above without class="update" -->
|
||||
<hbox align="baseline">
|
||||
<label id="version" class="update"/>
|
||||
<label id="releasenotes" is="text-link" hidden="true" flex="1" data-l10n-id="releaseNotes-link"/>
|
||||
<label id="releasenotes" is="text-link" hidden="true" data-l10n-id="releaseNotes-link"/>
|
||||
</hbox>
|
||||
<description class="text-blurb">
|
||||
<label is="text-link" onclick="openHelpLink('firefox-help')" data-l10n-id="aboutdialog-help-user"/>
|
||||
|
|
|
@ -161,6 +161,7 @@ class ProtectionCategory {
|
|||
return false;
|
||||
}
|
||||
this.categoryItem.classList.toggle("blocked", this.enabled);
|
||||
this.categoryItem.classList.toggle("subviewbutton-nav", this.enabled);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1631,6 +1632,10 @@ var gProtectionsHandler = {
|
|||
"notFound",
|
||||
!blocker.isDetected(event)
|
||||
);
|
||||
blocker.categoryItem.classList.toggle(
|
||||
"subviewbutton-nav",
|
||||
blocker.isDetected(event)
|
||||
);
|
||||
}
|
||||
|
||||
// And the popup attributes:
|
||||
|
|
|
@ -9079,8 +9079,7 @@ const SafeBrowsingNotificationBox = {
|
|||
*/
|
||||
class TabDialogBox {
|
||||
static _containerFor(browser) {
|
||||
// Return the .browserContainer
|
||||
return browser.parentNode.parentNode;
|
||||
return browser.closest(".browserContainer, .webextension-popup-stack");
|
||||
}
|
||||
|
||||
constructor(browser) {
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
<link rel="localization" href="browser/protectionsPanel.ftl"/>
|
||||
<link rel="localization" href="browser/appmenu.ftl"/>
|
||||
<link rel="localization" href="browser/panelUI.ftl"/>
|
||||
<link rel="localization" href="preview/identityCredentialNotification.ftl"/>
|
||||
<link rel="localization" href="preview/interventions.ftl"/>
|
||||
<link rel="localization" href="browser/sidebarMenu.ftl"/>
|
||||
<link rel="localization" href="browser/allTabsMenu.ftl"/>
|
||||
|
|
|
@ -302,6 +302,8 @@
|
|||
data-l10n-id="urlbar-midi-notification-anchor"/>
|
||||
<image id="webauthn-notification-icon" class="notification-anchor-icon" role="button"
|
||||
data-l10n-id="urlbar-web-authn-anchor"/>
|
||||
<image id="identity-credential-notification-icon" class="notification-anchor-icon" role="button"
|
||||
data-l10n-id="urlbar-identity-credential-anchor"/>
|
||||
<image id="storage-access-notification-icon" class="notification-anchor-icon storage-access-icon" role="button"
|
||||
data-l10n-id="urlbar-storage-access-anchor"/>
|
||||
</box>
|
||||
|
|
|
@ -931,70 +931,71 @@ function makePreview(row) {
|
|||
isBG) &&
|
||||
isProtocolAllowed
|
||||
) {
|
||||
// We need to wait for the image to finish loading before using width & height
|
||||
newImage.addEventListener(
|
||||
"loadend",
|
||||
function() {
|
||||
physWidth = newImage.width || 0;
|
||||
physHeight = newImage.height || 0;
|
||||
function loadOrErrorListener() {
|
||||
newImage.removeEventListener("load", loadOrErrorListener);
|
||||
newImage.removeEventListener("error", loadOrErrorListener);
|
||||
physWidth = newImage.width || 0;
|
||||
physHeight = newImage.height || 0;
|
||||
|
||||
// "width" and "height" attributes must be set to newImage,
|
||||
// even if there is no "width" or "height attribute in item;
|
||||
// otherwise, the preview image cannot be displayed correctly.
|
||||
// Since the image might have been loaded out-of-process, we expect
|
||||
// the item to tell us its width / height dimensions. Failing that
|
||||
// the item should tell us the natural dimensions of the image. Finally
|
||||
// failing that, we'll assume that the image was never loaded in the
|
||||
// other process (this can be true for favicons, for example), and so
|
||||
// we'll assume that we can use the natural dimensions of the newImage
|
||||
// we just created. If the natural dimensions of newImage are not known
|
||||
// then the image is probably broken.
|
||||
if (!isBG) {
|
||||
newImage.width =
|
||||
("width" in item && item.width) || newImage.naturalWidth;
|
||||
newImage.height =
|
||||
("height" in item && item.height) || newImage.naturalHeight;
|
||||
// "width" and "height" attributes must be set to newImage,
|
||||
// even if there is no "width" or "height attribute in item;
|
||||
// otherwise, the preview image cannot be displayed correctly.
|
||||
// Since the image might have been loaded out-of-process, we expect
|
||||
// the item to tell us its width / height dimensions. Failing that
|
||||
// the item should tell us the natural dimensions of the image. Finally
|
||||
// failing that, we'll assume that the image was never loaded in the
|
||||
// other process (this can be true for favicons, for example), and so
|
||||
// we'll assume that we can use the natural dimensions of the newImage
|
||||
// we just created. If the natural dimensions of newImage are not known
|
||||
// then the image is probably broken.
|
||||
if (!isBG) {
|
||||
newImage.width =
|
||||
("width" in item && item.width) || newImage.naturalWidth;
|
||||
newImage.height =
|
||||
("height" in item && item.height) || newImage.naturalHeight;
|
||||
} else {
|
||||
// the Width and Height of an HTML tag should not be used for its background image
|
||||
// (for example, "table" can have "width" or "height" attributes)
|
||||
newImage.width = item.naturalWidth || newImage.naturalWidth;
|
||||
newImage.height = item.naturalHeight || newImage.naturalHeight;
|
||||
}
|
||||
|
||||
if (item.SVGImageElement) {
|
||||
newImage.width = item.SVGImageElementWidth;
|
||||
newImage.height = item.SVGImageElementHeight;
|
||||
}
|
||||
|
||||
width = newImage.width;
|
||||
height = newImage.height;
|
||||
|
||||
document.getElementById("theimagecontainer").collapsed = false;
|
||||
document.getElementById("brokenimagecontainer").collapsed = true;
|
||||
|
||||
if (url) {
|
||||
if (width != physWidth || height != physHeight) {
|
||||
document.l10n.setAttributes(
|
||||
document.getElementById("imagedimensiontext"),
|
||||
"media-dimensions-scaled",
|
||||
{
|
||||
dimx: formatNumber(physWidth),
|
||||
dimy: formatNumber(physHeight),
|
||||
scaledx: formatNumber(width),
|
||||
scaledy: formatNumber(height),
|
||||
}
|
||||
);
|
||||
} else {
|
||||
// the Width and Height of an HTML tag should not be used for its background image
|
||||
// (for example, "table" can have "width" or "height" attributes)
|
||||
newImage.width = item.naturalWidth || newImage.naturalWidth;
|
||||
newImage.height = item.naturalHeight || newImage.naturalHeight;
|
||||
document.l10n.setAttributes(
|
||||
document.getElementById("imagedimensiontext"),
|
||||
"media-dimensions",
|
||||
{ dimx: formatNumber(width), dimy: formatNumber(height) }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item.SVGImageElement) {
|
||||
newImage.width = item.SVGImageElementWidth;
|
||||
newImage.height = item.SVGImageElementHeight;
|
||||
}
|
||||
|
||||
width = newImage.width;
|
||||
height = newImage.height;
|
||||
|
||||
document.getElementById("theimagecontainer").collapsed = false;
|
||||
document.getElementById("brokenimagecontainer").collapsed = true;
|
||||
|
||||
if (url) {
|
||||
if (width != physWidth || height != physHeight) {
|
||||
document.l10n.setAttributes(
|
||||
document.getElementById("imagedimensiontext"),
|
||||
"media-dimensions-scaled",
|
||||
{
|
||||
dimx: formatNumber(physWidth),
|
||||
dimy: formatNumber(physHeight),
|
||||
scaledx: formatNumber(width),
|
||||
scaledy: formatNumber(height),
|
||||
}
|
||||
);
|
||||
} else {
|
||||
document.l10n.setAttributes(
|
||||
document.getElementById("imagedimensiontext"),
|
||||
"media-dimensions",
|
||||
{ dimx: formatNumber(width), dimy: formatNumber(height) }
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
// We need to wait for the image to finish loading before using width & height
|
||||
newImage.addEventListener("load", loadOrErrorListener);
|
||||
newImage.addEventListener("error", loadOrErrorListener);
|
||||
|
||||
newImage.setAttribute("triggeringprincipal", triggeringPrinStr);
|
||||
newImage.setAttribute("src", url);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
noautofocus="true"
|
||||
role="alert"/>
|
||||
|
||||
<popupnotification id="webRTC-shareDevices-notification" hidden="true"
|
||||
<popupnotification id="webRTC-shareDevices-notification" hidden="true"
|
||||
descriptionid="webRTC-shareDevices-notification-description">
|
||||
<popupnotificationcontent id="webRTC-selectCamera" orient="vertical">
|
||||
<label id="webRTC-selectCamera-label"
|
||||
|
@ -167,3 +167,26 @@
|
|||
</vbox>
|
||||
</popupnotificationfooter>
|
||||
</popupnotification>
|
||||
|
||||
<popupnotification id="identity-credential-notification" hidden="true">
|
||||
<popupnotificationcontent id="identity-credential-provider" orient="vertical">
|
||||
<html:div id="identity-credential-provider-selector-container">
|
||||
</html:div>
|
||||
<description class="popup-notification-description" id="credential-provider-explanation" data-l10n-id="credential-description-provider-explanation"/>
|
||||
<html:template id="template-credential-provider-list-item">
|
||||
<toolbarbutton class="credential-provider-list-item subviewbutton-nav subviewbutton" align="center" wrap="true">
|
||||
<label flex="1" class="credential-provider-list-item-label"></label>
|
||||
</toolbarbutton>
|
||||
</html:template>
|
||||
</popupnotificationcontent>
|
||||
<popupnotificationcontent id="identity-credential-account" orient="vertical" hidden="true">
|
||||
<html:div id="identity-credential-account-selector-container">
|
||||
</html:div>
|
||||
<description class="popup-notification-description" id="credential-account-explanation"/>
|
||||
<html:template id="template-credential-account-list-item">
|
||||
<toolbarbutton class="credential-account-list-item subviewbutton-nav subviewbutton" align="center" wrap="true">
|
||||
<label flex="1" class="credential-account-list-item-label"></label>
|
||||
</toolbarbutton>
|
||||
</html:template>
|
||||
</popupnotificationcontent>
|
||||
</popupnotification>
|
||||
|
|
|
@ -20,11 +20,11 @@ async function testFirstPartyDomain(pageInfo) {
|
|||
info("preview.src=" + preview.src);
|
||||
|
||||
// For <img>, we will query imgIRequest.imagePrincipal later, so we wait
|
||||
// for loadend event. For <audio> and <video>, so far we only can get
|
||||
// for load event. For <audio> and <video>, so far we only can get
|
||||
// the triggeringprincipal attribute on the node, so we simply wait for
|
||||
// loadstart.
|
||||
if (i == 0) {
|
||||
await BrowserTestUtils.waitForEvent(preview, "loadend");
|
||||
await BrowserTestUtils.waitForEvent(preview, "load");
|
||||
} else {
|
||||
await BrowserTestUtils.waitForEvent(preview, "loadstart");
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ add_task(async function() {
|
|||
await BrowserTestUtils.waitForEvent(pageInfo, "page-info-init");
|
||||
|
||||
let pageInfoImg = pageInfo.document.getElementById("thepreviewimage");
|
||||
await BrowserTestUtils.waitForEvent(pageInfoImg, "loadend");
|
||||
await BrowserTestUtils.waitForEvent(pageInfoImg, "load");
|
||||
Assert.equal(
|
||||
pageInfoImg.src,
|
||||
imageInfo.src,
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<panelmultiview id="protections-popup-multiView"
|
||||
mainViewId="protections-popup-mainView">
|
||||
<panelview id="protections-popup-mainView"
|
||||
class="PanelUI-subView"
|
||||
role="document">
|
||||
<vbox id="protections-popup-mainView-panel-header-section">
|
||||
<hbox id="protections-popup-mainView-panel-header"
|
||||
|
@ -31,6 +32,7 @@
|
|||
<description id="protections-popup-toast-panel-tp-on-desc" data-l10n-id="protections-panel-etp-on-header"></description>
|
||||
<description id="protections-popup-toast-panel-tp-off-desc" data-l10n-id="protections-panel-etp-off-header"></description>
|
||||
</hbox>
|
||||
<toolbarseparator></toolbarseparator>
|
||||
|
||||
<html:div id="messaging-system-message-container" disabled="true">
|
||||
<!-- Messaging System Messages will render in this container -->
|
||||
|
@ -38,103 +40,107 @@
|
|||
</vbox>
|
||||
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<hbox id="protections-popup-tp-switch-section" class="protections-popup-section">
|
||||
<vbox class="protections-popup-tp-switch-label-box" flex="1" align="start">
|
||||
<label class="protections-popup-tp-switch-on-header"
|
||||
role="heading"
|
||||
aria-level="2" data-l10n-id="protections-panel-etp-on-header"></label>
|
||||
<label class="protections-popup-tp-switch-off-header"
|
||||
role="heading"
|
||||
aria-level="2" data-l10n-id="protections-panel-etp-off-header"></label>
|
||||
<label id="protections-popup-tp-switch-breakage-link"
|
||||
class="text-link"
|
||||
onclick="gProtectionsHandler.showSiteNotWorkingView(); gProtectionsHandler.recordClick('sitenotworking_link');" data-l10n-id="protections-panel-site-not-working"></label>
|
||||
<label id="protections-popup-tp-switch-breakage-fixed-link"
|
||||
class="text-link"
|
||||
onclick="gProtectionsHandler.showSendReportView(); gProtectionsHandler.recordClick('sitenotworking_link', 'sitefixed');"
|
||||
data-l10n-id="protections-panel-sitefixedsendreport-label"></label>
|
||||
</vbox>
|
||||
<vbox class="protections-popup-tp-switch-box">
|
||||
<toolbarbutton id="protections-popup-tp-switch"
|
||||
class="protections-popup-tp-switch"
|
||||
enabled="false"
|
||||
oncommand="gProtectionsHandler.onTPSwitchCommand();" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
<vbox id="protections-popup-main-body" class="panel-subview-body">
|
||||
<hbox id="protections-popup-tp-switch-section" class="protections-popup-section">
|
||||
<vbox class="protections-popup-tp-switch-label-box" flex="1" align="start">
|
||||
<label class="protections-popup-tp-switch-on-header"
|
||||
role="heading"
|
||||
aria-level="2" data-l10n-id="protections-panel-etp-on-header"></label>
|
||||
<label class="protections-popup-tp-switch-off-header"
|
||||
role="heading"
|
||||
aria-level="2" data-l10n-id="protections-panel-etp-off-header"></label>
|
||||
<label id="protections-popup-tp-switch-breakage-link"
|
||||
class="text-link"
|
||||
onclick="gProtectionsHandler.showSiteNotWorkingView(); gProtectionsHandler.recordClick('sitenotworking_link');" data-l10n-id="protections-panel-site-not-working"></label>
|
||||
<label id="protections-popup-tp-switch-breakage-fixed-link"
|
||||
class="text-link"
|
||||
onclick="gProtectionsHandler.showSendReportView(); gProtectionsHandler.recordClick('sitenotworking_link', 'sitefixed');"
|
||||
data-l10n-id="protections-panel-sitefixedsendreport-label"></label>
|
||||
</vbox>
|
||||
<vbox class="protections-popup-tp-switch-box">
|
||||
<toolbarbutton id="protections-popup-tp-switch"
|
||||
class="protections-popup-tp-switch"
|
||||
enabled="false"
|
||||
oncommand="gProtectionsHandler.onTPSwitchCommand();" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<!-- Tracking Protection Section -->
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<vbox id="tracking-protection-container" class="protections-popup-section">
|
||||
<description id="protections-popup-no-trackers-found-description" data-l10n-id="protections-panel-no-trackers-found"></description>
|
||||
<tooltip id="protections-popup-not-blocking-why-etp-on-tooltip" data-l10n-id="protections-panel-not-blocking-why-etp-on-tooltip"></tooltip>
|
||||
<tooltip id="protections-popup-not-blocking-why-etp-off-tooltip" data-l10n-id="protections-panel-not-blocking-why-etp-off-tooltip"></tooltip>
|
||||
<vbox id="protections-popup-content" flex="1">
|
||||
<vbox id="protections-popup-category-list">
|
||||
<toolbarbutton id="protections-popup-category-trackers"
|
||||
oncommand="gProtectionsHandler.showTrackersSubview(event); gProtectionsHandler.recordClick('trackers');"
|
||||
class="protections-popup-category subviewbutton-nav" align="center">
|
||||
<image class="protections-popup-category-icon trackers-icon"/>
|
||||
<label flex="1" class="protections-popup-category-label" data-l10n-id="protections-panel-content-blocking-tracking-protection"></label>
|
||||
</toolbarbutton>
|
||||
<toolbarbutton id="protections-popup-category-socialblock"
|
||||
oncommand="gProtectionsHandler.showSocialblockerSubview(event); gProtectionsHandler.recordClick('social');"
|
||||
class="protections-popup-category subviewbutton-nav" align="center">
|
||||
<image class="protections-popup-category-icon socialblock-icon"/>
|
||||
<label flex="1"
|
||||
class="protections-popup-category-label" data-l10n-id="protections-panel-content-blocking-socialblock"></label>
|
||||
</toolbarbutton>
|
||||
<toolbarbutton id="protections-popup-category-cookies"
|
||||
oncommand="gProtectionsHandler.showCookiesSubview(event); gProtectionsHandler.recordClick('cookies');"
|
||||
class="protections-popup-category subviewbutton-nav" align="center">
|
||||
<image class="protections-popup-category-icon thirdpartycookies-icon"/>
|
||||
<label flex="1" id="protections-popup-cookies-category-label"
|
||||
class="protections-popup-category-label"/>
|
||||
</toolbarbutton>
|
||||
<toolbarbutton id="protections-popup-category-cryptominers"
|
||||
oncommand="gProtectionsHandler.showCryptominersSubview(event); gProtectionsHandler.recordClick('cryptominers');"
|
||||
class="protections-popup-category subviewbutton-nav" align="center">
|
||||
<image class="protections-popup-category-icon cryptominers-icon"/>
|
||||
<label flex="1" class="protections-popup-category-label" data-l10n-id="protections-panel-content-blocking-cryptominers-label"></label>
|
||||
</toolbarbutton>
|
||||
<toolbarbutton id="protections-popup-category-fingerprinters"
|
||||
oncommand="gProtectionsHandler.showFingerprintersSubview(event); gProtectionsHandler.recordClick('fingerprinters');"
|
||||
class="protections-popup-category subviewbutton-nav" align="center">
|
||||
<image class="protections-popup-category-icon fingerprinters-icon"/>
|
||||
<label flex="1" class="protections-popup-category-label" data-l10n-id="protections-panel-content-blocking-fingerprinters-label"></label>
|
||||
</toolbarbutton>
|
||||
<description id="protections-popup-blocking-section-header"
|
||||
role="heading"
|
||||
aria-level="2" data-l10n-id="protections-panel-blocking-label"></description>
|
||||
<hbox id="protections-popup-not-blocking-section-header" flex="1">
|
||||
<description id="protections-popup-not-blocking-section-description" flex="1" role="heading" aria-level="2" data-l10n-id="protections-panel-not-blocking-label"></description>
|
||||
<label id="protections-popup-not-blocking-section-why"
|
||||
onmouseover="document.getElementById(event.target.tooltip).openPopup(event.target);"
|
||||
onfocus="document.getElementById(event.target.tooltip).openPopup(event.target);"
|
||||
onmouseout="document.getElementById(event.target.tooltip).hidePopup()"
|
||||
onblur="document.getElementById(event.target.tooltip).hidePopup()" data-l10n-id="protections-panel-not-blocking-why-label"></label>
|
||||
</hbox>
|
||||
<description id="protections-popup-not-found-section-header"
|
||||
role="heading"
|
||||
aria-level="2" data-l10n-id="protections-panel-not-found-label"></description>
|
||||
<!-- Tracking Protection Section -->
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<vbox id="tracking-protection-container" class="protections-popup-section">
|
||||
<description id="protections-popup-no-trackers-found-description" data-l10n-id="protections-panel-no-trackers-found"></description>
|
||||
<tooltip id="protections-popup-not-blocking-why-etp-on-tooltip" data-l10n-id="protections-panel-not-blocking-why-etp-on-tooltip"></tooltip>
|
||||
<tooltip id="protections-popup-not-blocking-why-etp-off-tooltip" data-l10n-id="protections-panel-not-blocking-why-etp-off-tooltip"></tooltip>
|
||||
<vbox id="protections-popup-content" flex="1">
|
||||
<vbox id="protections-popup-category-list">
|
||||
<toolbarbutton id="protections-popup-category-trackers"
|
||||
oncommand="gProtectionsHandler.showTrackersSubview(event); gProtectionsHandler.recordClick('trackers');"
|
||||
class="protections-popup-category subviewbutton subviewbutton-iconic" align="center">
|
||||
<image class="toolbarbutton-icon protections-popup-category-icon trackers-icon"/>
|
||||
<label flex="1" class="toolbarbutton-text protections-popup-category-label" data-l10n-id="protections-panel-content-blocking-tracking-protection"></label>
|
||||
</toolbarbutton>
|
||||
<toolbarbutton id="protections-popup-category-socialblock"
|
||||
oncommand="gProtectionsHandler.showSocialblockerSubview(event); gProtectionsHandler.recordClick('social');"
|
||||
class="protections-popup-category subviewbutton subviewbutton-iconic" align="center">
|
||||
<image class="toolbarbutton-icon protections-popup-category-icon socialblock-icon"/>
|
||||
<label flex="1"
|
||||
class="toolbarbutton-text protections-popup-category-label" data-l10n-id="protections-panel-content-blocking-socialblock"></label>
|
||||
</toolbarbutton>
|
||||
<toolbarbutton id="protections-popup-category-cookies"
|
||||
oncommand="gProtectionsHandler.showCookiesSubview(event); gProtectionsHandler.recordClick('cookies');"
|
||||
class="protections-popup-category subviewbutton subviewbutton-iconic" align="center">
|
||||
<image class="toolbarbutton-icon protections-popup-category-icon thirdpartycookies-icon"/>
|
||||
<label flex="1" id="protections-popup-cookies-category-label"
|
||||
class="toolbarbutton-text protections-popup-category-label"/>
|
||||
</toolbarbutton>
|
||||
<toolbarbutton id="protections-popup-category-cryptominers"
|
||||
oncommand="gProtectionsHandler.showCryptominersSubview(event); gProtectionsHandler.recordClick('cryptominers');"
|
||||
class="protections-popup-category subviewbutton subviewbutton-iconic" align="center">
|
||||
<image class="toolbarbutton-icon protections-popup-category-icon cryptominers-icon"/>
|
||||
<label flex="1" class="toolbarbutton-text protections-popup-category-label" data-l10n-id="protections-panel-content-blocking-cryptominers-label"></label>
|
||||
</toolbarbutton>
|
||||
<toolbarbutton id="protections-popup-category-fingerprinters"
|
||||
oncommand="gProtectionsHandler.showFingerprintersSubview(event); gProtectionsHandler.recordClick('fingerprinters');"
|
||||
class="protections-popup-category subviewbutton subviewbutton-iconic" align="center">
|
||||
<image class="toolbarbutton-icon protections-popup-category-icon fingerprinters-icon"/>
|
||||
<label flex="1" class="toolbarbutton-text protections-popup-category-label" data-l10n-id="protections-panel-content-blocking-fingerprinters-label"></label>
|
||||
</toolbarbutton>
|
||||
<description id="protections-popup-blocking-section-header"
|
||||
class="protections-popup-section-header"
|
||||
role="heading"
|
||||
aria-level="2" data-l10n-id="protections-panel-blocking-label"></description>
|
||||
<hbox id="protections-popup-not-blocking-section-header" class="protections-popup-section-header" flex="1">
|
||||
<description id="protections-popup-not-blocking-section-description" flex="1" role="heading" aria-level="2" data-l10n-id="protections-panel-not-blocking-label"></description>
|
||||
<label id="protections-popup-not-blocking-section-why"
|
||||
onmouseover="document.getElementById(event.target.tooltip).openPopup(event.target);"
|
||||
onfocus="document.getElementById(event.target.tooltip).openPopup(event.target);"
|
||||
onmouseout="document.getElementById(event.target.tooltip).hidePopup()"
|
||||
onblur="document.getElementById(event.target.tooltip).hidePopup()" data-l10n-id="protections-panel-not-blocking-why-label"></label>
|
||||
</hbox>
|
||||
<description id="protections-popup-not-found-section-header"
|
||||
class="protections-popup-section-header"
|
||||
role="heading"
|
||||
aria-level="2" data-l10n-id="protections-panel-not-found-label"></description>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<vbox id="protections-popup-footer" class="protections-popup-section">
|
||||
<vbox id="protections-popup-footer" class="panel-subview-footer-button">
|
||||
<toolbarbutton id="protections-popup-settings-button"
|
||||
class="protections-popup-footer-button"
|
||||
class="subviewbutton protections-popup-footer-button"
|
||||
oncommand="gProtectionsHandler.openPreferences(); gProtectionsHandler.recordClick('settings');">
|
||||
<image class="protections-popup-footer-icon protections-popup-settings-icon"/>
|
||||
<label class="protections-popup-footer-button-label" flex="1" data-l10n-id="protections-panel-settings-label"></label>
|
||||
<label id="protections-popup-footer-protection-type-label"></label>
|
||||
<label class="toolbarbutton-text protections-popup-footer-button-label" flex="1" data-l10n-id="protections-panel-settings-label"></label>
|
||||
<label id="protections-popup-footer-protection-type-label" class="toolbarbutton-text"></label>
|
||||
</toolbarbutton>
|
||||
<stack id="protections-popup-show-report-stack">
|
||||
<toolbarbutton id="protections-popup-show-report-button"
|
||||
class="protections-popup-footer-button"
|
||||
class="subviewbutton protections-popup-footer-button"
|
||||
oncommand="gProtectionsHandler.openProtections(true); gProtectionsHandler.recordClick('full_report');">
|
||||
<image class="protections-popup-footer-icon protections-popup-show-report-icon"/>
|
||||
<label class="protections-popup-footer-button-label" flex="1" data-l10n-id="protections-panel-protectionsdashboard-label"></label>
|
||||
<label class="toolbarbutton-text protections-popup-footer-button-label" flex="1" data-l10n-id="protections-panel-protectionsdashboard-label"></label>
|
||||
</toolbarbutton>
|
||||
<hbox id="protections-popup-trackers-blocked-counter-box"
|
||||
align="center">
|
||||
|
@ -142,22 +148,24 @@
|
|||
onclick="gProtectionsHandler.openProtections(true);"/>
|
||||
</hbox>
|
||||
</stack>
|
||||
</vbox>
|
||||
|
||||
<toolbarseparator id="protections-popup-milestones-separator"/>
|
||||
<hbox id="protections-popup-milestones" class="protections-popup-section">
|
||||
<toolbarbutton id="protections-popup-milestones-content"
|
||||
flex="1"
|
||||
oncommand="gProtectionsHandler.openProtections(true); gProtectionsHandler.recordClick('milestone_message');">
|
||||
<description id="protections-popup-milestones-text" flex="1"
|
||||
role="heading" aria-level="2"/>
|
||||
<image id="protections-popup-milestones-illustration"/>
|
||||
</toolbarbutton>
|
||||
</hbox>
|
||||
<toolbarseparator id="protections-popup-milestones-separator"/>
|
||||
<hbox id="protections-popup-milestones" class="protections-popup-section">
|
||||
<toolbarbutton id="protections-popup-milestones-content"
|
||||
class="subviewbutton"
|
||||
flex="1"
|
||||
oncommand="gProtectionsHandler.openProtections(true); gProtectionsHandler.recordClick('milestone_message');">
|
||||
<description id="protections-popup-milestones-text" flex="1"
|
||||
role="heading" aria-level="2"/>
|
||||
<image id="protections-popup-milestones-illustration"/>
|
||||
</toolbarbutton>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</panelview>
|
||||
|
||||
<!-- Site Not Working? SubView -->
|
||||
<panelview id="protections-popup-siteNotWorkingView"
|
||||
class="PanelUI-subView"
|
||||
role="document"
|
||||
data-l10n-id="protections-panel-site-not-working-view">
|
||||
<hbox id="protections-popup-siteNotWorkingView-header">
|
||||
|
@ -176,7 +184,8 @@
|
|||
oncommand="gProtectionsHandler.onTPSwitchCommand();" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
<vbox id="protections-popup-siteNotWorkingView-body" align="start">
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<vbox id="protections-popup-siteNotWorkingView-body" class="panel-subview-body" align="start">
|
||||
<label role="heading" aria-level="2" data-l10n-id="protections-panel-site-not-working-view-header"></label>
|
||||
<label>
|
||||
<html:ul id="protections-popup-siteNotWorkingView-body-issue-list">
|
||||
|
@ -195,6 +204,7 @@
|
|||
|
||||
<!-- Trackers SubView -->
|
||||
<panelview id="protections-popup-trackersView"
|
||||
class="PanelUI-subView"
|
||||
role="document">
|
||||
<vbox id="protections-popup-trackersView-description" class="protections-popup-description">
|
||||
<description data-l10n-id="protections-panel-tracking-content"></description>
|
||||
|
@ -212,7 +222,7 @@
|
|||
</hbox>
|
||||
</vbox>
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<vbox id="protections-popup-trackersView-list" class="protections-popup-list">
|
||||
<vbox id="protections-popup-trackersView-list" class="panel-subview-body protections-popup-list">
|
||||
</vbox>
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<toolbarbutton id="protections-popup-trackersView-settings-button"
|
||||
|
@ -223,6 +233,7 @@
|
|||
|
||||
<!-- Social Block SubView -->
|
||||
<panelview id="protections-popup-socialblockView"
|
||||
class="PanelUI-subView"
|
||||
role="document">
|
||||
<vbox id="protections-popup-socialblockView-heading" class="protections-popup-description">
|
||||
<description data-l10n-id="protections-panel-social-media-trackers"></description>
|
||||
|
@ -240,7 +251,7 @@
|
|||
</hbox>
|
||||
</vbox>
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<vbox id="protections-popup-socialblockView-list" class="protections-popup-list">
|
||||
<vbox id="protections-popup-socialblockView-list" class="panel-subview-body protections-popup-list">
|
||||
</vbox>
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<toolbarbutton id="protections-popup-socialblockView-settings-button"
|
||||
|
@ -251,12 +262,13 @@
|
|||
|
||||
<!-- Cookies SubView -->
|
||||
<panelview id="protections-popup-cookiesView"
|
||||
class="PanelUI-subView"
|
||||
role="document">
|
||||
<vbox id="protections-popup-cookiesView-heading" class="protections-popup-description">
|
||||
<description data-l10n-id="protections-panel-cross-site-tracking-cookies"></description>
|
||||
</vbox>
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<vbox id="protections-popup-cookiesView-list" class="protections-popup-list">
|
||||
<vbox id="protections-popup-cookiesView-list" class="panel-subview-body protections-popup-list">
|
||||
</vbox>
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<toolbarbutton id="protections-popup-cookiesView-settings-button"
|
||||
|
@ -267,6 +279,7 @@
|
|||
|
||||
<!-- Fingerprinters SubView -->
|
||||
<panelview id="protections-popup-fingerprintersView"
|
||||
class="PanelUI-subView"
|
||||
role="document">
|
||||
<vbox id="protections-popup-fingerprinters-heading" class="protections-popup-description">
|
||||
<description data-l10n-id="protections-panel-fingerprinters"></description>
|
||||
|
@ -284,7 +297,7 @@
|
|||
</hbox>
|
||||
</vbox>
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<vbox id="protections-popup-fingerprintersView-list" class="protections-popup-list">
|
||||
<vbox id="protections-popup-fingerprintersView-list" class="panel-subview-body protections-popup-list">
|
||||
</vbox>
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<toolbarbutton id="protections-popup-fingerprintersView-settings-button"
|
||||
|
@ -295,6 +308,7 @@
|
|||
|
||||
<!-- Cryptominers SubView -->
|
||||
<panelview id="protections-popup-cryptominersView"
|
||||
class="PanelUI-subView"
|
||||
role="document">
|
||||
<vbox id="protections-popup-cryptominers-heading" class="protections-popup-description">
|
||||
<description data-l10n-id="protections-panel-cryptominers"></description>
|
||||
|
@ -312,7 +326,7 @@
|
|||
</hbox>
|
||||
</vbox>
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<vbox id="protections-popup-cryptominersView-list" class="protections-popup-list">
|
||||
<vbox id="protections-popup-cryptominersView-list" class="panel-subview-body protections-popup-list">
|
||||
</vbox>
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<toolbarbutton id="protections-popup-cryptominersView-settings-button"
|
||||
|
@ -323,6 +337,7 @@
|
|||
|
||||
<!-- Send Report SubView -->
|
||||
<panelview id="protections-popup-sendReportView"
|
||||
class="PanelUI-subView"
|
||||
data-l10n-id="protections-panel-content-blocking-breakage-report-view">
|
||||
<vbox id="protections-popup-sendReportView-heading">
|
||||
<description data-l10n-id="protections-panel-content-blocking-breakage-report-view-description">
|
||||
|
@ -330,6 +345,7 @@
|
|||
is="text-link" data-l10n-name="learn-more"></label>
|
||||
</description>
|
||||
</vbox>
|
||||
<toolbarseparator></toolbarseparator>
|
||||
<vbox id="protections-popup-sendReportView-body" class="panel-view-body-unscrollable">
|
||||
<vbox class="protections-popup-sendReportView-collection-section">
|
||||
<label control="protections-popup-sendReportView-collection-url" data-l10n-id="protections-panel-content-blocking-breakage-report-view-collection-url"></label>
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# 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/.
|
||||
|
||||
## Credential panel
|
||||
## $host (String): the hostname of the site that is being displayed.
|
||||
|
||||
credential-header-providers = Sign in to { $host }.
|
||||
credential-header-accounts = Pick a { $host } account.
|
||||
# Identity providers are websites you use to log into another website, for example: Google when you Log in with Google.
|
||||
credential-description-provider-explanation = These are the identity providers that would like to help you log in.
|
||||
credential-description-account-explanation = Picking an account here shares that identity with { $host }.
|
||||
urlbar-identity-credential-anchor =
|
||||
.tooltiptext = Open federated login panel
|
||||
credential-cancel-label = Cancel
|
||||
credential-cancel-accesskey = C
|
|
@ -33,7 +33,7 @@ add_task(async function test_local_addon_update() {
|
|||
let xpi1 = AddonTestUtils.createTempWebExtensionFile({
|
||||
manifest: {
|
||||
version: "1.0",
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: { id },
|
||||
},
|
||||
},
|
||||
|
@ -60,7 +60,7 @@ add_task(async function test_local_addon_update() {
|
|||
let xpi2 = AddonTestUtils.createTempWebExtensionFile({
|
||||
manifest: {
|
||||
version: "2.0",
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: { id },
|
||||
},
|
||||
},
|
||||
|
@ -99,7 +99,7 @@ add_task(async function test_newurl_addon_update() {
|
|||
let xpi1 = AddonTestUtils.createTempWebExtensionFile({
|
||||
manifest: {
|
||||
version: "1.0",
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: { id },
|
||||
},
|
||||
},
|
||||
|
@ -109,7 +109,7 @@ add_task(async function test_newurl_addon_update() {
|
|||
let xpi2 = AddonTestUtils.createTempWebExtensionFile({
|
||||
manifest: {
|
||||
version: "2.0",
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: { id },
|
||||
},
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@ add_task(async function setup() {
|
|||
|
||||
let webExtensionFile = AddonTestUtils.createTempWebExtensionFile({
|
||||
manifest: {
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: {
|
||||
id: addonID,
|
||||
},
|
||||
|
|
|
@ -26,7 +26,7 @@ add_task(async function setup() {
|
|||
|
||||
let webExtensionFile = AddonTestUtils.createTempWebExtensionFile({
|
||||
manifest: {
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: {
|
||||
id: addonID,
|
||||
},
|
||||
|
@ -229,7 +229,7 @@ add_task(async function test_extensionsettings_string() {
|
|||
add_task(async function test_theme() {
|
||||
let themeFile = AddonTestUtils.createTempWebExtensionFile({
|
||||
manifest: {
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: {
|
||||
id: themeID,
|
||||
},
|
||||
|
|
|
@ -126,8 +126,7 @@ function _createContainer() {
|
|||
container.id = CONTAINER_ID;
|
||||
container.setAttribute("aria-describedby", `#${CONTAINER_ID} .welcome-text`);
|
||||
container.tabIndex = 0;
|
||||
parent.setAttribute("aria-owns", `${CONTAINER_ID}`);
|
||||
document.body.appendChild(container);
|
||||
document.body.prepend(container);
|
||||
return container;
|
||||
}
|
||||
|
||||
|
@ -495,8 +494,6 @@ async function showFeatureCallout(messageId) {
|
|||
window.addEventListener("focus", focusHandler, {
|
||||
capture: true, // get the event before retargeting
|
||||
});
|
||||
// Alert screen readers to the presence of the callout
|
||||
container.setAttribute("role", "alert");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -410,7 +410,7 @@ export const TabsSetupFlowManager = new (class {
|
|||
this.logger.debug("onSignedInChange, no recentTabs, calling syncTabs");
|
||||
// If the syncTabs call rejects or resolves false we need to clear the waiting
|
||||
// flag and update UI
|
||||
lazy.SyncedTabs.syncTabs()
|
||||
this.syncTabs()
|
||||
.catch(ex => {
|
||||
this.logger.debug("onSignedInChange, syncTabs rejected:", ex);
|
||||
this.stopWaitingForTabs();
|
||||
|
@ -562,7 +562,7 @@ export const TabsSetupFlowManager = new (class {
|
|||
async syncOnPageReload() {
|
||||
if (lazy.UIState.isReady() && this.fxaSignedIn) {
|
||||
this.startWaitingForTabs();
|
||||
await lazy.SyncedTabs.syncTabs(true);
|
||||
await this.syncTabs(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -571,7 +571,7 @@ export const TabsSetupFlowManager = new (class {
|
|||
this.startWaitingForTabs();
|
||||
Services.tm.dispatchToMainThread(() => {
|
||||
this.logger.debug("tryToClearError: triggering new tab sync");
|
||||
lazy.Weave.Service.sync({ why: "tabs", engines: ["tabs"] });
|
||||
this.startFullTabsSync();
|
||||
});
|
||||
} else {
|
||||
this.logger.debug(
|
||||
|
@ -581,4 +581,12 @@ export const TabsSetupFlowManager = new (class {
|
|||
);
|
||||
}
|
||||
}
|
||||
// For easy overriding in tests
|
||||
syncTabs(force = false) {
|
||||
return lazy.SyncedTabs.syncTabs(force);
|
||||
}
|
||||
|
||||
startFullTabsSync() {
|
||||
lazy.Weave.Service.sync({ why: "tabs", engines: ["tabs"] });
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -640,6 +640,7 @@ details[open] > .page-section-header > .twisty {
|
|||
padding: 8px;
|
||||
cursor: pointer;
|
||||
align-items: center;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@media (prefers-contrast) {
|
||||
|
|
|
@ -67,10 +67,6 @@ add_task(async function feature_callout_is_accessible() {
|
|||
() => document.activeElement.id === calloutId,
|
||||
"Feature Callout is focused on page load"
|
||||
);
|
||||
await BrowserTestUtils.waitForCondition(
|
||||
() => document.querySelector(`${calloutSelector}[role="alert"]`),
|
||||
"The callout container has role of alert"
|
||||
);
|
||||
await BrowserTestUtils.waitForCondition(
|
||||
() =>
|
||||
document.querySelector(
|
||||
|
@ -97,10 +93,6 @@ add_task(async function feature_callout_is_accessible() {
|
|||
() => document.activeElement.id === calloutId,
|
||||
"Feature Callout is focused after advancing screens"
|
||||
);
|
||||
await BrowserTestUtils.waitForCondition(
|
||||
() => document.querySelector(`${calloutSelector}[role="alert"]`),
|
||||
"The callout container has role of alert after advancing screens"
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
|
|
@ -36,7 +36,6 @@ async function tearDown(sandbox) {
|
|||
}
|
||||
|
||||
add_setup(async function() {
|
||||
await promiseSyncReady();
|
||||
// gSync.init() is called in a requestIdleCallback. Force its initialization.
|
||||
gSync.init();
|
||||
|
||||
|
|
|
@ -36,6 +36,11 @@ add_task(async function test_primary_password_locked() {
|
|||
const sandbox = setupMocks();
|
||||
|
||||
await withFirefoxView({}, async browser => {
|
||||
sandbox
|
||||
.stub(TabsSetupFlowManager, "syncTabs")
|
||||
.returns(Promise.resolve(null));
|
||||
sandbox.stub(TabsSetupFlowManager, "startFullTabsSync").returns(undefined);
|
||||
|
||||
const { document } = browser.contentWindow;
|
||||
Services.obs.notifyObservers(null, UIState.ON_UPDATE);
|
||||
|
||||
|
@ -97,6 +102,9 @@ add_task(async function test_primary_password_locked() {
|
|||
|
||||
info("notifying of the primary-password unlock");
|
||||
const clearErrorSpy = sandbox.spy(TabsSetupFlowManager, "tryToClearError");
|
||||
// we stubbed out sync, so pretend it ran.
|
||||
info("notifying of sync:finish");
|
||||
Services.obs.notifyObservers(null, "weave:service:sync:finish");
|
||||
|
||||
const setupContainer = document.querySelector(".sync-setup-container");
|
||||
// wait until the setup container gets hidden before checking if the tabs container is visible
|
||||
|
@ -138,5 +146,5 @@ add_task(async function test_primary_password_locked() {
|
|||
"Synced tabs isn't loading any more"
|
||||
);
|
||||
});
|
||||
tearDown();
|
||||
await tearDown(sandbox);
|
||||
});
|
||||
|
|
|
@ -48,14 +48,6 @@ function setupMocks({ fxaDevices = null, state, syncEnabled = true }) {
|
|||
}),
|
||||
};
|
||||
});
|
||||
sandbox
|
||||
.stub(Weave.Service.clientsEngine, "getClientByFxaDeviceId")
|
||||
.callsFake(fxaDeviceId => {
|
||||
let target = gMockFxaDevices.find(c => c.id == fxaDeviceId);
|
||||
return target ? target.clientRecord : null;
|
||||
});
|
||||
sandbox.stub(Weave.Service.clientsEngine, "getClientType").returns("desktop");
|
||||
|
||||
return sandbox;
|
||||
}
|
||||
|
||||
|
@ -95,7 +87,6 @@ add_setup(async function() {
|
|||
TabsSetupFlowManager.resetInternalState();
|
||||
});
|
||||
|
||||
await promiseSyncReady();
|
||||
// gSync.init() is called in a requestIdleCallback. Force its initialization.
|
||||
gSync.init();
|
||||
|
||||
|
|
|
@ -83,7 +83,6 @@ add_setup(async function() {
|
|||
TabsSetupFlowManager.resetInternalState();
|
||||
});
|
||||
|
||||
await promiseSyncReady();
|
||||
// gSync.init() is called in a requestIdleCallback. Force its initialization.
|
||||
gSync.init();
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ add_setup(async function() {
|
|||
TabsSetupFlowManager.resetInternalState();
|
||||
});
|
||||
|
||||
await promiseSyncReady();
|
||||
// gSync.init() is called in a requestIdleCallback. Force its initialization.
|
||||
gSync.init();
|
||||
});
|
||||
|
|
|
@ -60,12 +60,6 @@ const syncedTabsData1 = [
|
|||
},
|
||||
];
|
||||
|
||||
function promiseSyncReady() {
|
||||
let service = Cc["@mozilla.org/weave/service;1"].getService(Ci.nsISupports)
|
||||
.wrappedJSObject;
|
||||
return service.whenLoaded();
|
||||
}
|
||||
|
||||
async function clearAllParentTelemetryEvents() {
|
||||
// Clear everything.
|
||||
await TestUtils.waitForCondition(() => {
|
||||
|
@ -238,13 +232,6 @@ function setupSyncFxAMocks({ fxaDevices = null, state, syncEnabled = true }) {
|
|||
syncEnabled,
|
||||
};
|
||||
});
|
||||
sandbox
|
||||
.stub(Weave.Service.clientsEngine, "getClientByFxaDeviceId")
|
||||
.callsFake(fxaDeviceId => {
|
||||
let target = gMockFxaDevices.find(c => c.id == fxaDeviceId);
|
||||
return target ? target.clientRecord : null;
|
||||
});
|
||||
sandbox.stub(Weave.Service.clientsEngine, "getClientType").returns("desktop");
|
||||
|
||||
return sandbox;
|
||||
}
|
||||
|
|
|
@ -863,7 +863,7 @@ class ProtonScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCom
|
|||
const currentStep = this.props.order + 1;
|
||||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("main", {
|
||||
className: `screen ${this.props.id || ""} ${screenClassName} ${textColorClass}`,
|
||||
role: "dialog",
|
||||
role: "alertdialog",
|
||||
pos: content.position || "center",
|
||||
tabIndex: "-1",
|
||||
"aria-labelledby": "mainContentHeader",
|
||||
|
|
|
@ -301,7 +301,7 @@ export class ProtonScreen extends React.PureComponent {
|
|||
<main
|
||||
className={`screen ${this.props.id ||
|
||||
""} ${screenClassName} ${textColorClass}`}
|
||||
role="dialog"
|
||||
role="alertdialog"
|
||||
pos={content.position || "center"}
|
||||
tabIndex="-1"
|
||||
aria-labelledby="mainContentHeader"
|
||||
|
|
|
@ -94,7 +94,7 @@ async function testWindowSizePositive(width, height) {
|
|||
let reader = new FileReader();
|
||||
reader.onloadend = function() {
|
||||
let screenshot = new Image();
|
||||
screenshot.onloadend = function() {
|
||||
screenshot.onload = function() {
|
||||
is(
|
||||
screenshot.width,
|
||||
width,
|
||||
|
@ -131,7 +131,7 @@ async function testGreen(url, path) {
|
|||
let reader = new FileReader();
|
||||
reader.onloadend = function() {
|
||||
let screenshot = new Image();
|
||||
screenshot.onloadend = function() {
|
||||
screenshot.onload = function() {
|
||||
resolve(screenshot);
|
||||
};
|
||||
screenshot.src = reader.result;
|
||||
|
|
|
@ -73,8 +73,8 @@ add_task(async function setup() {
|
|||
|
||||
add_task(async function test_minimal() {
|
||||
// The minimal client and tabs info we can get away with.
|
||||
configureEngine({
|
||||
guid_desktop: {
|
||||
configureEngine([
|
||||
{
|
||||
id: "desktop",
|
||||
tabs: [
|
||||
{
|
||||
|
@ -82,7 +82,7 @@ add_task(async function test_minimal() {
|
|||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
]);
|
||||
|
||||
let query = "ex";
|
||||
let context = createContext(query, { isPrivate: false });
|
||||
|
@ -103,8 +103,8 @@ add_task(async function test_minimal() {
|
|||
|
||||
add_task(async function test_maximal() {
|
||||
// Every field that could possibly exist on a remote record.
|
||||
configureEngine({
|
||||
guid_mobile: {
|
||||
configureEngine([
|
||||
{
|
||||
id: "mobile",
|
||||
tabs: [
|
||||
{
|
||||
|
@ -114,7 +114,7 @@ add_task(async function test_maximal() {
|
|||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
]);
|
||||
|
||||
let query = "ex";
|
||||
let context = createContext(query, { isPrivate: false });
|
||||
|
@ -137,8 +137,8 @@ add_task(async function test_maximal() {
|
|||
|
||||
add_task(async function test_noShowIcons() {
|
||||
Services.prefs.setBoolPref("services.sync.syncedTabs.showRemoteIcons", false);
|
||||
configureEngine({
|
||||
guid_mobile: {
|
||||
configureEngine([
|
||||
{
|
||||
id: "mobile",
|
||||
tabs: [
|
||||
{
|
||||
|
@ -148,7 +148,7 @@ add_task(async function test_noShowIcons() {
|
|||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
]);
|
||||
|
||||
let query = "ex";
|
||||
let context = createContext(query, { isPrivate: false });
|
||||
|
@ -173,8 +173,8 @@ add_task(async function test_noShowIcons() {
|
|||
|
||||
add_task(async function test_dontMatchSyncedTabs() {
|
||||
Services.prefs.setBoolPref("services.sync.syncedTabs.showRemoteTabs", false);
|
||||
configureEngine({
|
||||
guid_mobile: {
|
||||
configureEngine([
|
||||
{
|
||||
id: "mobile",
|
||||
tabs: [
|
||||
{
|
||||
|
@ -184,7 +184,7 @@ add_task(async function test_dontMatchSyncedTabs() {
|
|||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
]);
|
||||
|
||||
let context = createContext("ex", { isPrivate: false });
|
||||
await check_results({
|
||||
|
@ -202,8 +202,8 @@ add_task(async function test_dontMatchSyncedTabs() {
|
|||
|
||||
add_task(async function test_tabsDisabledInUrlbar() {
|
||||
Services.prefs.setBoolPref("browser.urlbar.suggest.remotetab", false);
|
||||
configureEngine({
|
||||
guid_mobile: {
|
||||
configureEngine([
|
||||
{
|
||||
id: "mobile",
|
||||
tabs: [
|
||||
{
|
||||
|
@ -213,7 +213,7 @@ add_task(async function test_tabsDisabledInUrlbar() {
|
|||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
]);
|
||||
|
||||
let context = createContext("ex", { isPrivate: false });
|
||||
await check_results({
|
||||
|
@ -231,8 +231,8 @@ add_task(async function test_tabsDisabledInUrlbar() {
|
|||
|
||||
add_task(async function test_matches_title() {
|
||||
// URL doesn't match search expression, should still match the title.
|
||||
configureEngine({
|
||||
guid_mobile: {
|
||||
configureEngine([
|
||||
{
|
||||
id: "mobile",
|
||||
tabs: [
|
||||
{
|
||||
|
@ -241,7 +241,7 @@ add_task(async function test_matches_title() {
|
|||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
]);
|
||||
|
||||
let query = "ex";
|
||||
let context = createContext(query, { isPrivate: false });
|
||||
|
@ -266,8 +266,8 @@ add_task(async function test_localtab_matches_override() {
|
|||
// tab" should appear as duplicate detection removed the remote one.
|
||||
|
||||
// First set up Sync to have the page as a remote tab.
|
||||
configureEngine({
|
||||
guid_mobile: {
|
||||
configureEngine([
|
||||
{
|
||||
id: "mobile",
|
||||
tabs: [
|
||||
{
|
||||
|
@ -276,7 +276,7 @@ add_task(async function test_localtab_matches_override() {
|
|||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
]);
|
||||
|
||||
// Set up Places to think the tab is open locally.
|
||||
let uri = Services.io.newURI("http://foo.com/");
|
||||
|
@ -308,8 +308,8 @@ add_task(async function test_remotetab_matches_override() {
|
|||
// remote tab match.
|
||||
let url = "http://foo.remote.com/";
|
||||
// First set up Sync to have the page as a remote tab.
|
||||
configureEngine({
|
||||
guid_mobile: {
|
||||
configureEngine([
|
||||
{
|
||||
id: "mobile",
|
||||
tabs: [
|
||||
{
|
||||
|
@ -318,7 +318,7 @@ add_task(async function test_remotetab_matches_override() {
|
|||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
]);
|
||||
|
||||
// Set up Places to think the tab is in history.
|
||||
await PlacesTestUtils.addVisits(url);
|
||||
|
@ -354,12 +354,7 @@ add_task(async function test_mixed_result_types() {
|
|||
lastUsed: Math.floor(Date.now() / 1000) - i * 86400, // i days ago.
|
||||
}));
|
||||
// First set up Sync to have the page as a remote tab.
|
||||
configureEngine({
|
||||
guid_mobile: {
|
||||
id: "mobile",
|
||||
tabs,
|
||||
},
|
||||
});
|
||||
configureEngine([{ id: "mobile", tabs }]);
|
||||
|
||||
// Register the page as an open tab.
|
||||
let openTabUrl = url + "openpage/";
|
||||
|
@ -441,12 +436,12 @@ add_task(async function test_many_remotetab_results() {
|
|||
}));
|
||||
|
||||
// First set up Sync to have the page as a remote tab.
|
||||
configureEngine({
|
||||
guid_mobile: {
|
||||
configureEngine([
|
||||
{
|
||||
id: "mobile",
|
||||
tabs,
|
||||
},
|
||||
});
|
||||
]);
|
||||
|
||||
let query = "rem";
|
||||
let context = createContext(query, { isPrivate: false });
|
||||
|
@ -533,16 +528,16 @@ add_task(async function multiple_clients() {
|
|||
lastUsed: Date.now() / 1000,
|
||||
});
|
||||
|
||||
configureEngine({
|
||||
guid_mobile: {
|
||||
configureEngine([
|
||||
{
|
||||
id: "mobile",
|
||||
tabs: mobileTabs,
|
||||
},
|
||||
guid_desktop: {
|
||||
{
|
||||
id: "desktop",
|
||||
tabs: desktopTabs,
|
||||
},
|
||||
});
|
||||
]);
|
||||
|
||||
// We expect that we will show the recent tab from mobileTabs, then all the
|
||||
// tabs from desktopTabs, then the remaining tabs from mobileTabs.
|
||||
|
@ -598,12 +593,12 @@ add_task(async function test_restrictionCharacter() {
|
|||
title: "A title",
|
||||
lastUsed: Math.floor(Date.now() / 1000) - i,
|
||||
}));
|
||||
configureEngine({
|
||||
guid_mobile: {
|
||||
configureEngine([
|
||||
{
|
||||
id: "mobile",
|
||||
tabs,
|
||||
},
|
||||
});
|
||||
]);
|
||||
|
||||
// Also add an open page.
|
||||
let openTabUrl = url + "openpage/";
|
||||
|
@ -670,12 +665,12 @@ add_task(async function test_duplicate_remote_tabs() {
|
|||
title: "A title",
|
||||
lastUsed: Math.floor(Date.now() / 1000),
|
||||
}));
|
||||
configureEngine({
|
||||
guid_mobile: {
|
||||
configureEngine([
|
||||
{
|
||||
id: "mobile",
|
||||
tabs,
|
||||
},
|
||||
});
|
||||
]);
|
||||
|
||||
// We expect the duplicate tabs to be deduped.
|
||||
let query = UrlbarTokenizer.RESTRICT.OPENPAGE;
|
||||
|
|
|
@ -96,17 +96,6 @@ const AVAILABLE_INJECTIONS = [
|
|||
allFrames: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "bug1551672",
|
||||
platform: "android",
|
||||
domain: "Sites using PDK 5 video",
|
||||
bug: "1551672",
|
||||
data: {
|
||||
urls: ["https://*/*/tpPdk.js", "https://*/*/pdk/js/*/*.js"],
|
||||
types: ["script"],
|
||||
},
|
||||
customFunc: "pdk5fix",
|
||||
},
|
||||
{
|
||||
id: "bug1583366",
|
||||
platform: "desktop",
|
||||
|
@ -188,20 +177,6 @@ const AVAILABLE_INJECTIONS = [
|
|||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "bug1610358",
|
||||
platform: "android",
|
||||
domain: "pcloud.com",
|
||||
bug: "1610358",
|
||||
contentScripts: {
|
||||
matches: ["https://www.pcloud.com/*"],
|
||||
js: [
|
||||
{
|
||||
file: "injections/js/bug1610358-pcloud.com-appVersion-change.js",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "bug1610344",
|
||||
platform: "all",
|
||||
|
@ -604,7 +579,8 @@ const AVAILABLE_INJECTIONS = [
|
|||
"*://*.pixiv.net/*", // Bug 1774006
|
||||
"*://*.webex.com/*", // Bug 1788934
|
||||
"*://business.help.royalmail.com/app/webforms/*", // Bug 1786404
|
||||
"*://www.northcountrypublicradio.org/contact/subscribe.html*", // Bug 1778382
|
||||
"*://www.northcountrypublicradio.org/contact/subscribe.html*", // Bug 1778382,
|
||||
"*://www.schoolnutritionandfitness.com/*", // Bug 1793761
|
||||
],
|
||||
js: [
|
||||
{
|
||||
|
@ -687,20 +663,6 @@ const AVAILABLE_INJECTIONS = [
|
|||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "bug1784546",
|
||||
platform: "android",
|
||||
domain: "seznam.cz",
|
||||
bug: "1784546",
|
||||
contentScripts: {
|
||||
matches: ["*://*.seznam.cz/*"],
|
||||
css: [
|
||||
{
|
||||
file: "injections/css/bug1784546-seznam.cz-popup-height.css",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "bug1784351",
|
||||
platform: "desktop",
|
||||
|
|
|
@ -712,32 +712,12 @@ const AVAILABLE_UA_OVERRIDES = [
|
|||
config: {
|
||||
matches: [
|
||||
"*://*.commerzbank.de/*", // Bug 1767630
|
||||
"*://*.edf.com/*", // Bug 1764786
|
||||
"*://*.ibmserviceengage.com/*", // #105438
|
||||
"*://*.wordpress.org/*", // Bug 1743431
|
||||
"*://as.eservice.asus.com/*", // #104113
|
||||
"*://cdn-vzn.yottaa.net/*", // Bug 1764795
|
||||
"*://dsae.co.za/*", // Bug 1765925
|
||||
"*://fpt.dfp.microsoft.com/*", // #104237
|
||||
"*://moje.pzu.pl/*", // #99772
|
||||
"*://mon.allianzbanque.fr/*", // #101074
|
||||
"*://online.citi.com/*", // #101268
|
||||
"*://simperium.com/*", // #98934
|
||||
"*://survey.sogosurvey.com/*", // Bug 1765925
|
||||
"*://ubank.com.au/*", // #104099
|
||||
"*://wifi.sncf/*", // #100194
|
||||
"*://www.discoveryplus.in/*", // #100389
|
||||
"*://www.eurosportplayer.com/*", // #91087
|
||||
"*://www.gismeteo.ru/*", // #101326
|
||||
"*://www.hannaandersson.com/*", // #95003
|
||||
"*://www.imb.com.au/*", // Bug 1762209
|
||||
"*://www.learningants.com/*", // #104080
|
||||
"*://www.liveobserverpark.com/*", // #105244
|
||||
"*://www.manchestereveningnews.co.uk/*", // #100923
|
||||
"*://www.metrobyt-mobile.com/*", // #105106
|
||||
"*://www.screwfix.com/*", // #96959
|
||||
"*://www.services.gov.on.ca/*", // #100926
|
||||
"*://www.smsv.com.ar/*", // #90666
|
||||
],
|
||||
uaTransformer: originalUA => {
|
||||
return UAHelpers.capVersionTo99(originalUA);
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
/**
|
||||
* www.seznam.cz - Cookies consent popup options are not visible
|
||||
* Bug #1784546 - https://bugzilla.mozilla.org/show_bug.cgi?id=1784546
|
||||
* WebCompat issue #108565 - https://webcompat.com/issues/108565
|
||||
*/
|
||||
|
||||
.szn-cmp-dialog-container {
|
||||
transform: translateX(0);
|
||||
margin-top: -56px !important;
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
/**
|
||||
* Bug 1610358 - Add "mobile" to navigator.appVersion
|
||||
* WebCompat issue #40353 - https://webcompat.com/issues/40353
|
||||
*
|
||||
* the site expecting navigator.appVersion to contain "mobile",
|
||||
* otherwise it's serving a tablet version for Firefox mobile
|
||||
*/
|
||||
|
||||
/* globals exportFunction */
|
||||
|
||||
console.info(
|
||||
"The user agent has been overridden for compatibility reasons. See https://webcompat.com/issues/40353 for details."
|
||||
);
|
||||
|
||||
const APP_VERSION = navigator.appVersion + " mobile";
|
||||
|
||||
Object.defineProperty(window.navigator.wrappedJSObject, "appVersion", {
|
||||
get: exportFunction(function() {
|
||||
return APP_VERSION;
|
||||
}, window),
|
||||
|
||||
set: exportFunction(function() {}, window),
|
||||
});
|
|
@ -72,25 +72,6 @@ const CUSTOM_FUNCTIONS = {
|
|||
browser.webRequest.onHeadersReceived.removeListener(listener);
|
||||
delete injection.data.listener;
|
||||
},
|
||||
pdk5fix: injection => {
|
||||
const { urls, types } = injection.data;
|
||||
const listener = (injection.data.listener = ({ requestId }) => {
|
||||
replaceStringInRequest(
|
||||
requestId,
|
||||
"VideoContextChromeAndroid",
|
||||
"VideoContextAndroid"
|
||||
);
|
||||
return {};
|
||||
});
|
||||
browser.webRequest.onBeforeRequest.addListener(listener, { urls, types }, [
|
||||
"blocking",
|
||||
]);
|
||||
},
|
||||
pdk5fixDisable: injection => {
|
||||
const { listener } = injection.data;
|
||||
browser.webRequest.onBeforeRequest.removeListener(listener);
|
||||
delete injection.data.listener;
|
||||
},
|
||||
runScriptBeforeRequest: injection => {
|
||||
const { bug, message, request, script, types } = injection;
|
||||
const warning = `${message} See https://bugzilla.mozilla.org/show_bug.cgi?id=${bug} for details.`;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"manifest_version": 2,
|
||||
"name": "Web Compatibility Interventions",
|
||||
"description": "Urgent post-release fixes for web compatibility.",
|
||||
"version": "106.1.0",
|
||||
"version": "107.0.0",
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"id": "webcompat@mozilla.org",
|
||||
|
|
|
@ -68,7 +68,6 @@ FINAL_TARGET_FILES.features["webcompat@mozilla.org"]["injections"]["css"] += [
|
|||
"injections/css/bug1784195-nutmeg.morrisons.com-overflow.css",
|
||||
"injections/css/bug1784199-entrata-platform-unsupported.css",
|
||||
"injections/css/bug1784351-movistar.com.ar-overflow-overlay-fix.css",
|
||||
"injections/css/bug1784546-seznam.cz-popup-height.css",
|
||||
"injections/css/bug1788685-microsoftedgetips.microsoft.com-gallery-fix.css",
|
||||
"injections/css/bug1789164-zdnet.com-cropped-section.css",
|
||||
]
|
||||
|
@ -80,7 +79,6 @@ FINAL_TARGET_FILES.features["webcompat@mozilla.org"]["injections"]["js"] += [
|
|||
"injections/js/bug1472075-bankofamerica.com-ua-change.js",
|
||||
"injections/js/bug1579159-m.tailieu.vn-pdfjs-worker-disable.js",
|
||||
"injections/js/bug1605611-maps.google.com-directions-time.js",
|
||||
"injections/js/bug1610358-pcloud.com-appVersion-change.js",
|
||||
"injections/js/bug1631811-datastudio.google.com-indexedDB.js",
|
||||
"injections/js/bug1722955-frontgate.com-ua-override.js",
|
||||
"injections/js/bug1724764-amextravel.com-window-print.js",
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
preview/firefoxSuggest.ftl (../components/urlbar/content/firefoxSuggest.ftl)
|
||||
preview/originControls.ftl (../components/extensions/originControls.ftl)
|
||||
preview/unifiedExtensions.ftl (../components/extensions/unifiedExtensions.ftl)
|
||||
preview/identityCredentialNotification.ftl (../components/credentialmanager/identityCredentialNotification.ftl)
|
||||
browser (%browser/**/*.ftl)
|
||||
|
||||
@AB_CD@.jar:
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "b974b5431f12e0d721c93044325b033b35473575"
|
||||
"revision": "bd9bef09be1881669c8c1e36fbdf8eca04ec07de"
|
||||
},
|
||||
"bg": {
|
||||
"pin": false,
|
||||
|
@ -447,7 +447,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "dbfddc7e06848c04f0efc5d68244b95c21d97972"
|
||||
"revision": "8b2a174e4e8fb869c196a60f8f2aaff64bc488f6"
|
||||
},
|
||||
"eo": {
|
||||
"pin": false,
|
||||
|
@ -537,7 +537,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "e925e2258fb66611ab7f8bbe9646396642276674"
|
||||
"revision": "776fd41a8ea9fada85ab39552e3eef01c6ad3b9e"
|
||||
},
|
||||
"et": {
|
||||
"pin": false,
|
||||
|
@ -627,7 +627,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "3d1b7d4b82a9e988002a2ec9c72156cf0b8512b7"
|
||||
"revision": "826abb0c37deea73e4599b563d68e5c55551036c"
|
||||
},
|
||||
"fr": {
|
||||
"pin": false,
|
||||
|
@ -663,7 +663,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "b33e33cff140c388bf3ff177760545f55359a2c7"
|
||||
"revision": "e2d12d548ea7537c3b9b3673476a125555e0bbdb"
|
||||
},
|
||||
"ga-IE": {
|
||||
"pin": false,
|
||||
|
@ -771,7 +771,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "e110a452cfba28df5e8374f0f1708380d250da4d"
|
||||
"revision": "90ce925ed27f1c4ab6d8c62e455550aac41d4226"
|
||||
},
|
||||
"hi-IN": {
|
||||
"pin": false,
|
||||
|
@ -933,7 +933,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "962445cecf6a3c85a921500a7c7790164d17a175"
|
||||
"revision": "cfa28f18d06ed1d43acd6d7a1bb8219090e89e02"
|
||||
},
|
||||
"it": {
|
||||
"pin": false,
|
||||
|
@ -951,7 +951,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "d4701f985b62e4ca427b9dd7830522edc01062db"
|
||||
"revision": "c8ba1714bd6abd6f5fc5929fb9eea008baa7d896"
|
||||
},
|
||||
"ja": {
|
||||
"pin": false,
|
||||
|
@ -1281,7 +1281,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "53073e38ffce9f2b850d0badb8a27fc4b04d574c"
|
||||
"revision": "e87ecac60d14340cf2aa86e98eb88cd589fe9c96"
|
||||
},
|
||||
"ne-NP": {
|
||||
"pin": false,
|
||||
|
@ -1317,7 +1317,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "37bc766c7d64bcb5096bf163476814956801a048"
|
||||
"revision": "0e98929c813e75e9a9fc9ce195c6e2c8c21505ab"
|
||||
},
|
||||
"nn-NO": {
|
||||
"pin": false,
|
||||
|
@ -1803,7 +1803,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "a05faa48ae1827b3b71c723e4d6a9e3d743df7fb"
|
||||
"revision": "4511bb04720ab2e335f99877e77bd42be3c13729"
|
||||
},
|
||||
"trs": {
|
||||
"pin": false,
|
||||
|
@ -1839,7 +1839,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "d31759b0b2f70f690ef043e9c156fb0294d54824"
|
||||
"revision": "302dadee0f1ba3c4a1b05d28506a0229d11b2635"
|
||||
},
|
||||
"ur": {
|
||||
"pin": false,
|
||||
|
@ -1893,7 +1893,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "db35ac37762bf47113f6642c992fcf36d7c08320"
|
||||
"revision": "2c1b9ec74bbf2aefdde703a77ae4798cbdb55a25"
|
||||
},
|
||||
"wo": {
|
||||
"pin": false,
|
||||
|
@ -1947,7 +1947,7 @@
|
|||
"win64-aarch64-devedition",
|
||||
"win64-devedition"
|
||||
],
|
||||
"revision": "9eca89ce4d63a0ce36fcbbaf17b972af10182990"
|
||||
"revision": "48f6d263e00b02fa297ce0ca8d5c08d10f41c36e"
|
||||
},
|
||||
"zh-TW": {
|
||||
"pin": false,
|
||||
|
|
|
@ -388,7 +388,7 @@ export const BuiltInThemeConfig = new Map([
|
|||
[
|
||||
"activist-bold-colorway@mozilla.org",
|
||||
{
|
||||
version: "1.1.1",
|
||||
version: "1.1.2",
|
||||
path: "resource://builtin-themes/colorways/2022activist/bold/",
|
||||
collection: "independent-voices",
|
||||
l10nId: {
|
||||
|
@ -430,7 +430,7 @@ export const BuiltInThemeConfig = new Map([
|
|||
[
|
||||
"dreamer-bold-colorway@mozilla.org",
|
||||
{
|
||||
version: "1.1",
|
||||
version: "1.1.1",
|
||||
path: "resource://builtin-themes/colorways/2022dreamer/bold/",
|
||||
collection: "independent-voices",
|
||||
l10nId: {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
},
|
||||
"name": "Activist – Bold",
|
||||
"author": "Mozilla",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"icons": {
|
||||
"32": "icon.svg"
|
||||
},
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
},
|
||||
"name": "Dreamer – Bold",
|
||||
"author": "Mozilla",
|
||||
"version": "1.1",
|
||||
"version": "1.1.1",
|
||||
"icons": {
|
||||
"32": "icon.svg"
|
||||
},
|
||||
|
|
|
@ -268,15 +268,6 @@ menuitem.bookmark-item {
|
|||
margin-inline-end: 0 !important;
|
||||
}
|
||||
|
||||
.cui-widget-panelview[id^=PanelUI-webext-] {
|
||||
border-radius: var(--arrowpanel-border-radius);
|
||||
}
|
||||
|
||||
.webextension-popup-browser,
|
||||
.webextension-popup-stack {
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Titlebar drawing:
|
||||
*
|
||||
|
|
|
@ -463,15 +463,6 @@ moz-input-box > menupopup .context-menu-add-engine > .menu-iconic-left {
|
|||
margin-top: -14px;
|
||||
}
|
||||
|
||||
.cui-widget-panelview[id^=PanelUI-webext-] {
|
||||
border-radius: var(--arrowpanel-border-radius);
|
||||
}
|
||||
|
||||
.webextension-popup-browser,
|
||||
.webextension-popup-stack {
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
#historySwipeAnimationPreviousArrow {
|
||||
background: url("chrome://browser/skin/history-swipe-arrow.svg")
|
||||
center left / 64px 128px no-repeat transparent;
|
||||
|
|
|
@ -4,16 +4,6 @@
|
|||
|
||||
@import url("chrome://browser/skin/addons/unified-extensions-item.css");
|
||||
|
||||
#unified-extensions-view,
|
||||
#unified-extensions-view > .panel-subview-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#unified-extensions-view > .panel-subview-body {
|
||||
max-height: 70vh;
|
||||
}
|
||||
|
||||
.unified-extensions-panel-header {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
@import url("chrome://browser/skin/identity-block/identity-block.css");
|
||||
@import url("chrome://browser/skin/notification-icons.css");
|
||||
@import url("chrome://browser/skin/addon-notification.css");
|
||||
@import url("chrome://browser/skin/identity-credential-notification.css");
|
||||
@import url("chrome://browser/skin/urlbarView.css");
|
||||
@import url("chrome://browser/skin/translation/infobar.css");
|
||||
@import url("chrome://browser/skin/autocomplete.css");
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
/* Set default fill for icons in the identity popup.
|
||||
Individual icons can override this. */
|
||||
fill: currentColor;
|
||||
--horizontal-padding: 1.78em;
|
||||
--horizontal-padding: calc(var(--arrowpanel-menuitem-padding-inline) * 2);
|
||||
--vertical-section-padding: 0.9em;
|
||||
--height-offset: 0px;
|
||||
font: menu;
|
||||
|
@ -89,7 +89,9 @@
|
|||
}
|
||||
|
||||
#protections-popup[toast] #protections-popup-mainView > :not(#protections-popup-mainView-panel-header-section),
|
||||
#protections-popup[toast] #protections-popup-main-header-label {
|
||||
#protections-popup[toast] #protections-popup-mainView-panel-header-section > :not(#protections-popup-mainView-panel-header),
|
||||
#protections-popup[toast] #protections-popup-mainView-panel-header > :is(.panel-info-button, #protections-popup-main-header-label) {
|
||||
/* Hide all elements in the panel except for the toast descriptions */
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -148,41 +150,16 @@
|
|||
padding-inline: 1.25em;
|
||||
}
|
||||
|
||||
#protections-popup-content {
|
||||
background-repeat: no-repeat;
|
||||
background-position: 1em 1em;
|
||||
background-size: 24px auto;
|
||||
-moz-context-properties: fill;
|
||||
padding: 0.5em 0 1em;
|
||||
padding-inline: calc(2em + 24px) 1em;
|
||||
}
|
||||
|
||||
#protections-popup-content:-moz-locale-dir(rtl) {
|
||||
background-position: calc(100% - 1em) 1em;
|
||||
}
|
||||
|
||||
/* CONTENT */
|
||||
|
||||
.protections-popup-footer-button,
|
||||
.protections-popup-category,
|
||||
.protections-popup-empty-label,
|
||||
.tracking-protection-button,
|
||||
.protections-popup-cookiesView-list-header,
|
||||
.protections-popup-list-item > label,
|
||||
#protections-popup-mainView-panel-header > label,
|
||||
#protections-popup-mainView-panel-header > description,
|
||||
#protections-popup-trackersView > .panel-header,
|
||||
#protections-popup-sendReportView > .panel-header,
|
||||
.protections-popup-category-label,
|
||||
.protections-popup-category-state-label,
|
||||
#protections-popup-content > description,
|
||||
.protections-popup-footer-button-label,
|
||||
#protections-popup-footer-protection-type-label,
|
||||
#protections-popup-trackers-blocked-counter-description,
|
||||
#protections-popup-sendReportView-heading > description {
|
||||
:where(#protections-popup) :is(description, label) {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#protections-popup:not([infoMessageShowing]) #protections-popup-mainView-panel-header-section + toolbarseparator {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#permission-popup-mainView-panel-header,
|
||||
#identity-popup-mainView-panel-header,
|
||||
#protections-popup-mainView-panel-header {
|
||||
|
@ -233,18 +210,6 @@
|
|||
margin-top: 4px;
|
||||
}
|
||||
|
||||
#protections-popup[toast] #protections-popup-info-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#protections-popup-info-button {
|
||||
margin-inline-end: 10px;
|
||||
}
|
||||
|
||||
#protections-popup-info-button > image {
|
||||
fill-opacity: 1;
|
||||
}
|
||||
|
||||
#permission-popup-permissions-content > description,
|
||||
#protections-popup-content > description {
|
||||
color: var(--panel-description-color);
|
||||
|
@ -404,7 +369,8 @@ description#identity-popup-content-verifier,
|
|||
/* CONTENT BLOCKING / TRACKING PROTECTION */
|
||||
|
||||
#protections-popup-sendReportView-heading,
|
||||
#protections-popup-sendReportView-body {
|
||||
#protections-popup-sendReportView-body,
|
||||
#protections-popup-siteNotWorkingView-body {
|
||||
padding: var(--vertical-section-padding) var(--horizontal-padding);
|
||||
}
|
||||
|
||||
|
@ -412,10 +378,6 @@ description#identity-popup-content-verifier,
|
|||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
#protections-popup-sendReportView-body {
|
||||
border-top: 1px solid var(--panel-separator-color);
|
||||
}
|
||||
|
||||
#protections-popup-sendReportView-collection-url {
|
||||
appearance: none;
|
||||
border: none;
|
||||
|
@ -426,8 +388,8 @@ description#identity-popup-content-verifier,
|
|||
height: 120px;
|
||||
}
|
||||
|
||||
#protections-popup-sendReportView label {
|
||||
margin-inline-start: 0;
|
||||
.protections-popup-sendReportView-collection-section label {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
#protections-popup-sendReportView-report-error {
|
||||
|
@ -435,24 +397,11 @@ description#identity-popup-content-verifier,
|
|||
color: #d74345;
|
||||
}
|
||||
|
||||
.protections-popup-footer-button,
|
||||
.protections-popup-category {
|
||||
/* Overwrite toolbarbutton styles */
|
||||
appearance: none;
|
||||
border-radius: 2px;
|
||||
padding: 0 var(--horizontal-padding);
|
||||
}
|
||||
|
||||
.protections-popup-category:hover,
|
||||
.protections-popup-footer-button:hover,
|
||||
#protections-popup-not-blocking-section-why:hover,
|
||||
#protections-popup-show-report-stack:hover > .protections-popup-footer-button {
|
||||
background-color: var(--panel-item-hover-bgcolor);
|
||||
}
|
||||
|
||||
.protections-popup-category:hover:active,
|
||||
.protections-popup-footer-button:hover:active,
|
||||
#protections-popup-not-blocking-section-why:hover:active,
|
||||
#protections-popup-show-report-stack:hover:active > .protections-popup-footer-button {
|
||||
background-color: var(--panel-item-active-bgcolor);
|
||||
}
|
||||
|
@ -471,7 +420,6 @@ description#identity-popup-content-verifier,
|
|||
}
|
||||
|
||||
.protections-popup-empty-label {
|
||||
margin-inline-start: 0;
|
||||
color: var(--panel-description-color);
|
||||
}
|
||||
|
||||
|
@ -497,9 +445,7 @@ description#identity-popup-content-verifier,
|
|||
}
|
||||
|
||||
.protections-popup-list {
|
||||
padding: 5px 24px;
|
||||
-moz-box-flex: 1;
|
||||
overflow: auto;
|
||||
padding: 5px 16px !important; /* override panelUI-shared.css */
|
||||
}
|
||||
|
||||
.protections-popup-list-item {
|
||||
|
@ -529,17 +475,12 @@ description#identity-popup-content-verifier,
|
|||
color: var(--panel-description-color);
|
||||
}
|
||||
|
||||
#protections-popup-content {
|
||||
padding: 0;
|
||||
margin: 0 0 var(--vertical-section-padding);
|
||||
.protections-popup-section-header {
|
||||
color: var(--panel-description-color);
|
||||
}
|
||||
|
||||
#protections-popup-blocking-section-header,
|
||||
#protections-popup-not-blocking-section-header,
|
||||
#protections-popup-not-found-section-header {
|
||||
margin: 0;
|
||||
padding: var(--vertical-section-padding) var(--horizontal-padding);
|
||||
color: var(--panel-description-color);
|
||||
:root[uidensity="compact"] .protections-popup-section-header {
|
||||
margin-block: 4px;
|
||||
}
|
||||
|
||||
#tracking-protection-container > tooltip {
|
||||
|
@ -554,40 +495,16 @@ description#identity-popup-content-verifier,
|
|||
* are assigned rows 8-12, with the headers taking rows 1 and 7.
|
||||
*/
|
||||
|
||||
#protections-popup-category-list {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#protections-popup-no-trackers-found-description:not([hidden]) ~ #protections-popup-content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#protections-popup-not-blocking-section-description {
|
||||
flex: -moz-available;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#protections-popup-not-blocking-section-why {
|
||||
margin: 0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
#protections-popup-not-blocking-section-why:hover {
|
||||
outline: 4px solid var(--panel-item-hover-bgcolor);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#protections-popup-not-blocking-section-why:hover:active {
|
||||
outline-color: var(--panel-item-active-bgcolor);
|
||||
}
|
||||
|
||||
.protections-popup-category.notFound {
|
||||
color: var(--panel-description-color);
|
||||
fill: var(--panel-description-color);
|
||||
}
|
||||
|
||||
.protections-popup-category.notFound:hover {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.trackers-icon {
|
||||
|
@ -612,8 +529,6 @@ description#identity-popup-content-verifier,
|
|||
|
||||
/* PERMISSIONS */
|
||||
|
||||
.protections-popup-footer-button,
|
||||
.protections-popup-category,
|
||||
.permission-popup-permission-item {
|
||||
min-height: 24px;
|
||||
}
|
||||
|
@ -651,16 +566,11 @@ description#identity-popup-content-verifier,
|
|||
margin-inline-start: calc(16px + 8px);
|
||||
}
|
||||
|
||||
.protections-popup-category-icon,
|
||||
.permission-popup-permission-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.protections-popup-category-label {
|
||||
margin-inline-start: 1em;
|
||||
}
|
||||
|
||||
.permission-popup-permission-label,
|
||||
.permission-popup-permission-header-label {
|
||||
margin-inline-start: 8px;
|
||||
|
@ -672,16 +582,11 @@ description#identity-popup-content-verifier,
|
|||
margin-inline-start: calc(16px + 3px + 10px);
|
||||
}
|
||||
|
||||
.protections-popup-category-state-label,
|
||||
.permission-popup-permission-state-label {
|
||||
margin-inline-end: 5px;
|
||||
text-align: end;
|
||||
}
|
||||
|
||||
#protections-popup[hasException] .protections-popup-category-state-label {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.permission-popup-permission-remove-button {
|
||||
appearance: none;
|
||||
margin: 0;
|
||||
|
@ -731,34 +636,10 @@ description#identity-popup-content-verifier,
|
|||
display: revert;
|
||||
}
|
||||
|
||||
#protections-popup-siteNotWorkingView-header,
|
||||
#protections-popup-tp-switch-section {
|
||||
padding: var(--vertical-section-padding) var(--horizontal-padding);
|
||||
}
|
||||
|
||||
#protections-popup-siteNotWorkingView-body > label,
|
||||
.protections-popup-tp-switch-label-box > label {
|
||||
margin-inline: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#protections-popup-siteNotWorkingView-header {
|
||||
border-bottom: 1px solid var(--panel-separator-color);
|
||||
}
|
||||
|
||||
#protections-popup-siteNotWorkingView-body {
|
||||
padding: var(--vertical-section-padding) var(--horizontal-padding);
|
||||
}
|
||||
|
||||
#protections-popup-siteNotWorkingView-body,
|
||||
.protections-popup-tp-switch-label-box,
|
||||
.protections-popup-tp-switch-box {
|
||||
min-height: 40px;
|
||||
-moz-box-pack: center;
|
||||
/* This is needed in order to make 'position' working for the badge alongside
|
||||
the TP switch toggle.*/
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* This is needed in order to show a correct height if the 'Site not working?'
|
||||
|
@ -843,16 +724,13 @@ description#identity-popup-content-verifier,
|
|||
opacity: 1;
|
||||
}
|
||||
|
||||
#protections-popup-trackers-blocked-counter-description {
|
||||
color: var(--panel-description-color);
|
||||
}
|
||||
|
||||
#protections-popup-trackers-blocked-counter-description,
|
||||
#protections-popup-footer-protection-type-label {
|
||||
color: var(--panel-description-color);
|
||||
}
|
||||
|
||||
.protections-popup-description > description {
|
||||
margin: 10px 24px;
|
||||
margin: 10px 16px;
|
||||
}
|
||||
|
||||
#protections-popup:not([milestone]) #protections-popup-milestones,
|
||||
|
@ -860,33 +738,27 @@ description#identity-popup-content-verifier,
|
|||
display: none;
|
||||
}
|
||||
|
||||
#protections-popup-milestones {
|
||||
margin: 0 calc(var(--horizontal-padding) * 0.5) var(--vertical-section-padding);
|
||||
/* Override .protections-popup-section */
|
||||
border-top: none;
|
||||
background-color: var(--arrowpanel-dimmed);
|
||||
border-radius: var(--arrowpanel-menuitem-padding);
|
||||
}
|
||||
|
||||
#protections-popup-milestones-content {
|
||||
appearance: none;
|
||||
padding: var(--vertical-section-padding) calc(var(--horizontal-padding) * 0.5);
|
||||
margin: 0;
|
||||
border-radius: var(--arrowpanel-menuitem-padding);
|
||||
background-color: var(--panel-banner-item-background-color);
|
||||
}
|
||||
|
||||
#protections-popup-milestones-content:hover,
|
||||
#protections-popup-milestones-content:-moz-focusring {
|
||||
background-color: var(--arrowpanel-dimmed);
|
||||
/* The padding-block for menuitems is set to 0 in compact mode which, with the
|
||||
* shield icon being bigger than a usual menuitem, makes the item look crowded
|
||||
* even for compact mode. */
|
||||
:root[uidensity="compact"] #protections-popup-milestones-content {
|
||||
padding-block: 4px;
|
||||
}
|
||||
|
||||
#protections-popup-milestones-content:hover {
|
||||
background-color: var(--panel-banner-item-hover-bgcolor);
|
||||
}
|
||||
|
||||
#protections-popup-milestones-content:hover:active {
|
||||
background-color: var(--arrowpanel-dimmed-further);
|
||||
background-color: var(--panel-banner-item-active-bgcolor);
|
||||
}
|
||||
|
||||
#protections-popup-milestones-text {
|
||||
font-weight: 600;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#protections-popup-milestones-illustration {
|
||||
|
@ -954,30 +826,13 @@ description#identity-popup-content-verifier,
|
|||
padding-inline: 12px 6px;
|
||||
}
|
||||
|
||||
.protections-popup-footer-button,
|
||||
.protections-popup-category {
|
||||
min-height: 32px;
|
||||
border-radius: var(--arrowpanel-menuitem-border-radius);
|
||||
}
|
||||
|
||||
#protections-popup-footer {
|
||||
padding: var(--panel-subview-body-padding);
|
||||
}
|
||||
|
||||
#protections-popup-blocking-section-header,
|
||||
#protections-popup-not-blocking-section-header,
|
||||
#protections-popup-not-found-section-header,
|
||||
.protections-popup-section-header,
|
||||
#protections-popup-tp-switch-section,
|
||||
.protections-popup-category,
|
||||
.protections-popup-footer-button {
|
||||
#protections-popup-siteNotWorkingView-header {
|
||||
padding: var(--arrowpanel-menuitem-padding);
|
||||
margin: var(--arrowpanel-menuitem-margin);
|
||||
}
|
||||
|
||||
#protections-popup-footer-protection-type-label {
|
||||
margin-inline-end: 0;
|
||||
}
|
||||
|
||||
.identity-popup-expander:focus-visible,
|
||||
.permission-popup-permission-remove-button:focus-visible {
|
||||
outline: var(--focus-outline);
|
||||
|
@ -990,12 +845,6 @@ description#identity-popup-content-verifier,
|
|||
}
|
||||
}
|
||||
|
||||
.protections-popup-category:focus-visible,
|
||||
.protections-popup-footer-button:focus-visible {
|
||||
outline: var(--focus-outline);
|
||||
background: none;
|
||||
}
|
||||
|
||||
.protections-popup-tp-switch:focus-visible {
|
||||
outline: var(--focus-outline);
|
||||
outline-offset: var(--focus-outline-offset);
|
||||
|
@ -1012,14 +861,6 @@ description#identity-popup-content-verifier,
|
|||
color: var(--panel-description-color);
|
||||
}
|
||||
|
||||
.protections-popup-description > description {
|
||||
margin: 10px 16px;
|
||||
}
|
||||
|
||||
.protections-popup-list {
|
||||
padding: 5px 16px;
|
||||
}
|
||||
|
||||
/** Shim-allow warning and indicator icons **/
|
||||
|
||||
.protections-popup-shim-allow-hint {
|
||||
|
@ -1028,7 +869,7 @@ description#identity-popup-content-verifier,
|
|||
}
|
||||
|
||||
.protections-popup-shim-allow-hint-icon,
|
||||
.protections-popup-list-host-shim-allow-indicator{
|
||||
.protections-popup-list-host-shim-allow-indicator {
|
||||
-moz-context-properties: fill;
|
||||
background-image: url("chrome://global/skin/icons/info-filled.svg");
|
||||
background-repeat: no-repeat;
|
||||
|
|
|
@ -1078,6 +1078,7 @@ panelview .toolbarbutton-1,
|
|||
|
||||
#protections-popup-mainView .subviewbutton-nav:not(.notFound)::after,
|
||||
#identity-popup-mainView .subviewbutton-nav::after,
|
||||
#identity-credential-notification .subviewbutton-nav::after,
|
||||
.widget-overflow-list .subviewbutton-nav::after,
|
||||
.PanelUI-subView .subviewbutton-nav::after {
|
||||
-moz-context-properties: fill, fill-opacity;
|
||||
|
@ -1089,6 +1090,7 @@ panelview .toolbarbutton-1,
|
|||
|
||||
#protections-popup-mainView .subviewbutton-nav:not(.notFound):-moz-locale-dir(rtl)::after,
|
||||
#identity-popup-mainView .subviewbutton-nav:-moz-locale-dir(rtl)::after,
|
||||
#identity-credential-notification .subviewbutton-nav:-moz-locale-dir(rtl)::after,
|
||||
.widget-overflow-list .subviewbutton-nav:-moz-locale-dir(rtl)::after,
|
||||
.PanelUI-subView .subviewbutton-nav:-moz-locale-dir(rtl)::after {
|
||||
content: url(chrome://global/skin/icons/arrow-left.svg);
|
||||
|
@ -1278,7 +1280,6 @@ panelview .toolbarbutton-1 {
|
|||
#widget-overflow-mainView > .panel-subview-body > toolbarseparator,
|
||||
.PanelUI-subView toolbarseparator,
|
||||
#permission-popup-mainView > toolbarseparator,
|
||||
#protections-popup-multiView toolbarseparator,
|
||||
#identity-popup-mainView toolbarseparator,
|
||||
#identity-popup-securityView > toolbarseparator,
|
||||
#editBookmarkPanel toolbarseparator,
|
||||
|
@ -1715,8 +1716,6 @@ radiogroup:focus-visible > .subviewradio[focused="true"] > .radio-label-box {
|
|||
height: 260px;
|
||||
overflow: hidden;
|
||||
transition: margin-bottom .25s;
|
||||
border-top: 1px solid var(--panel-separator-color);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#protections-popup #messaging-system-message-container[disabled] {
|
||||
|
@ -1745,11 +1744,7 @@ radiogroup:focus-visible > .subviewradio[focused="true"] > .radio-label-box {
|
|||
}
|
||||
|
||||
#protections-popup-message:-moz-locale-dir(rtl) {
|
||||
background-position: top left;
|
||||
}
|
||||
|
||||
#protections-popup-message > .whatsNew-message-body > .text-link {
|
||||
text-decoration: underline;
|
||||
background-position-x: left;
|
||||
}
|
||||
|
||||
#protections-popup-message .protections-popup-content {
|
||||
|
@ -1891,11 +1886,6 @@ panelview:not([mainview]) #PanelUI-whatsNew-title {
|
|||
font-weight: 600;
|
||||
}
|
||||
|
||||
#protections-popup-message .text-link:hover {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#PanelUI-whatsNew .text-link:hover {
|
||||
color: #0a84ff;
|
||||
text-decoration: underline;
|
||||
|
@ -2127,3 +2117,18 @@ description#PanelUI-profiler-locked {
|
|||
/* Make sure this description is wider than the header's */
|
||||
max-width: 310px;
|
||||
}
|
||||
|
||||
/* Web-extension pop-ups */
|
||||
|
||||
.cui-widget-panelview[id^=PanelUI-webext-] {
|
||||
border-radius: var(--arrowpanel-border-radius);
|
||||
}
|
||||
|
||||
.webextension-popup-browser,
|
||||
.webextension-popup-stack {
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
.webextension-popup-stack {
|
||||
position: relative;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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/. */
|
||||
|
||||
#identity-credential-notification .subviewbutton {
|
||||
width: 100%;
|
||||
margin-inline: 0;
|
||||
}
|
||||
|
||||
#credential-provider-explanation,
|
||||
#credential-account-explanation {
|
||||
margin-top: 1em;
|
||||
}
|
|
@ -17,6 +17,7 @@
|
|||
skin/classic/browser/blockedSite.css (../shared/blockedSite.css)
|
||||
skin/classic/browser/browser-shared.css (../shared/browser-shared.css)
|
||||
skin/classic/browser/ctrlTab.css (../shared/ctrlTab.css)
|
||||
skin/classic/browser/identity-credential-notification.css (../shared/identity-credential-notification.css)
|
||||
skin/classic/browser/light-dark-overrides.css (../shared/light-dark-overrides.css)
|
||||
skin/classic/browser/menupanel.css (../shared/menupanel.css)
|
||||
skin/classic/browser/notification-icons.css (../shared/notification-icons.css)
|
||||
|
|
|
@ -198,6 +198,10 @@
|
|||
list-style-image: url(chrome://browser/skin/fingerprint.svg);
|
||||
}
|
||||
|
||||
#identity-credential-notification-icon {
|
||||
list-style-image: url(chrome://browser/skin/fingerprint.svg);
|
||||
}
|
||||
|
||||
#permission-popup-menulist {
|
||||
margin-inline-end: 0;
|
||||
}
|
||||
|
|
|
@ -578,15 +578,6 @@ menupopup[touchmode] menuitem {
|
|||
}
|
||||
}
|
||||
|
||||
.cui-widget-panelview[id^=PanelUI-webext-] {
|
||||
border-radius: var(--arrowpanel-border-radius);
|
||||
}
|
||||
|
||||
.webextension-popup-browser,
|
||||
.webextension-popup-stack {
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
#historySwipeAnimationPreviousArrow {
|
||||
background: url("chrome://browser/skin/history-swipe-arrow.svg")
|
||||
center left / 192px 192px no-repeat transparent;
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"patches": [
|
||||
"find_symbolizer_linux_clang_15.patch",
|
||||
"android-mangling-error_clang_12.patch",
|
||||
"unpoison-thread-stacks_clang_10.patch",
|
||||
"downgrade-mangling-error_clang_12.patch",
|
||||
"bug47258-extract-symbols-mbcs.patch",
|
||||
"fuzzing_ccov_build_clang_12.patch",
|
||||
"win64-no-symlink_clang_16.patch",
|
||||
"revert-llvmorg-15-init-13446-g7524fe962e47.patch",
|
||||
"revert-llvmorg-14-init-14141-gd6d3000a2f6d.patch",
|
||||
"revert-llvmorg-14-init-11890-gf86deb18cab6.patch",
|
||||
"win64-ret-null-on-commitment-limit_clang_14.patch",
|
||||
"llvmorg-16-init-7778-g232e0a011e8c.patch",
|
||||
"llvmorg-16-init-8264-gc34caa9120a4.patch",
|
||||
"profdata-compat.patch"
|
||||
]
|
||||
}
|
|
@ -13,6 +13,7 @@
|
|||
"revert-llvmorg-14-init-14141-gd6d3000a2f6d.patch",
|
||||
"revert-llvmorg-14-init-11890-gf86deb18cab6_clang_16.patch",
|
||||
"win64-ret-null-on-commitment-limit_clang_14.patch",
|
||||
"compiler-rt-rss-limit-heap-profile.patch"
|
||||
"compiler-rt-rss-limit-heap-profile.patch",
|
||||
"profdata-compat.patch"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -0,0 +1,256 @@
|
|||
From e9b4278ca7a492d3710aeae324250189379e6d30 Mon Sep 17 00:00:00 2001
|
||||
From: serge-sans-paille <sguelton@redhat.com>
|
||||
Date: Thu, 13 Oct 2022 10:26:41 +0200
|
||||
Subject: [PATCH] [lto] Do not try to internalize symbols with escaped name
|
||||
|
||||
Because of LLVM mangling escape sequence (through '\01' prefix), it is possible
|
||||
for a single symbols two have two different IR representations.
|
||||
|
||||
For instance, consider @symbol and @"\01_symbol". On OSX, because of the system
|
||||
mangling rules, these two IR names point are converted in the same final symbol
|
||||
upon linkage.
|
||||
|
||||
LTO doesn't model this behavior, which may result in symbols being incorrectly
|
||||
internalized (if all reference use the escaping sequence while the definition
|
||||
doesn't).
|
||||
|
||||
The proper approach is probably to use the mangled name to compute GUID to
|
||||
avoid the dual representation, but we can also avoid discarding symbols that are
|
||||
bound to two different IR names. This is an approximation, but it's less
|
||||
intrusive on the codebase.
|
||||
|
||||
Fix #57864
|
||||
|
||||
Differential Revision: https://reviews.llvm.org/D135710
|
||||
---
|
||||
llvm/lib/LTO/LTO.cpp | 16 +++++++
|
||||
.../LTO/X86/hidden-escaped-symbols-alt.ll | 41 ++++++++++++++++++
|
||||
llvm/test/LTO/X86/hidden-escaped-symbols.ll | 41 ++++++++++++++++++
|
||||
.../ThinLTO/X86/hidden-escaped-symbols-alt.ll | 42 +++++++++++++++++++
|
||||
.../ThinLTO/X86/hidden-escaped-symbols.ll | 42 +++++++++++++++++++
|
||||
5 files changed, 182 insertions(+)
|
||||
create mode 100644 llvm/test/LTO/X86/hidden-escaped-symbols-alt.ll
|
||||
create mode 100644 llvm/test/LTO/X86/hidden-escaped-symbols.ll
|
||||
create mode 100644 llvm/test/ThinLTO/X86/hidden-escaped-symbols-alt.ll
|
||||
create mode 100644 llvm/test/ThinLTO/X86/hidden-escaped-symbols.ll
|
||||
|
||||
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
|
||||
index 0f78c4ebd5ca..93aed72b3d15 100644
|
||||
--- a/llvm/lib/LTO/LTO.cpp
|
||||
+++ b/llvm/lib/LTO/LTO.cpp
|
||||
@@ -565,6 +565,22 @@ void LTO::addModuleToGlobalRes(ArrayRef<InputFile::Symbol> Syms,
|
||||
GlobalRes.IRName = std::string(Sym.getIRName());
|
||||
}
|
||||
|
||||
+ // In rare occasion, the symbol used to initialize GlobalRes has a different
|
||||
+ // IRName from the inspected Symbol. This can happen on macOS + iOS, when a
|
||||
+ // symbol is referenced through its mangled name, say @"\01_symbol" while
|
||||
+ // the IRName is @symbol (the prefix underscore comes from MachO mangling).
|
||||
+ // In that case, we have the same actual Symbol that can get two different
|
||||
+ // GUID, leading to some invalid internalization. Workaround this by marking
|
||||
+ // the GlobalRes external.
|
||||
+
|
||||
+ // FIXME: instead of this check, it would be desirable to compute GUIDs
|
||||
+ // based on mangled name, but this requires an access to the Target Triple
|
||||
+ // and would be relatively invasive on the codebase.
|
||||
+ if (GlobalRes.IRName != Sym.getIRName()) {
|
||||
+ GlobalRes.Partition = GlobalResolution::External;
|
||||
+ GlobalRes.VisibleOutsideSummary = true;
|
||||
+ }
|
||||
+
|
||||
// Set the partition to external if we know it is re-defined by the linker
|
||||
// with -defsym or -wrap options, used elsewhere, e.g. it is visible to a
|
||||
// regular object, is referenced from llvm.compiler.used/llvm.used, or was
|
||||
diff --git a/llvm/test/LTO/X86/hidden-escaped-symbols-alt.ll b/llvm/test/LTO/X86/hidden-escaped-symbols-alt.ll
|
||||
new file mode 100644
|
||||
index 000000000000..ca8e7d8eb2b2
|
||||
--- /dev/null
|
||||
+++ b/llvm/test/LTO/X86/hidden-escaped-symbols-alt.ll
|
||||
@@ -0,0 +1,41 @@
|
||||
+; Check interaction between LTO and LLVM mangling escape char, see #57864.
|
||||
+
|
||||
+; RUN: split-file %s %t
|
||||
+; RUN: opt %t/hide-me.ll -o %t/hide-me.bc
|
||||
+; RUN: opt %t/ref.ll -o %t/ref.bc
|
||||
+; RUN: llvm-lto2 run \
|
||||
+; RUN: -r %t/hide-me.bc,_hide_me,p \
|
||||
+; RUN: -r %t/ref.bc,_main,plx \
|
||||
+; RUN: -r %t/ref.bc,_hide_me,l \
|
||||
+; RUN: --select-save-temps=precodegen \
|
||||
+; RUN: -o %t/out \
|
||||
+; RUN: %t/hide-me.bc %t/ref.bc
|
||||
+; RUN: llvm-dis %t/out.0.5.precodegen.bc -o - | FileCheck %s
|
||||
+
|
||||
+
|
||||
+;--- hide-me.ll
|
||||
+target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
+target triple = "x86_64-apple-macosx10.7.0"
|
||||
+
|
||||
+@"\01_hide_me" = hidden local_unnamed_addr global i8 8, align 1
|
||||
+
|
||||
+;--- ref.ll
|
||||
+target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
+target triple = "x86_64-apple-macosx10.7.0"
|
||||
+
|
||||
+@hide_me = external local_unnamed_addr global i8
|
||||
+
|
||||
+define i8 @main() {
|
||||
+ %1 = load i8, ptr @hide_me, align 1
|
||||
+ ret i8 %1
|
||||
+}
|
||||
+
|
||||
+
|
||||
+; CHECK: @"\01_hide_me" = hidden local_unnamed_addr global i8 8, align 1
|
||||
+; CHECK: @hide_me = external dso_local local_unnamed_addr global i8
|
||||
+
|
||||
+; CHECK: define dso_local i8 @main() local_unnamed_addr #0 {
|
||||
+; CHECK: %1 = load i8, ptr @hide_me, align 1
|
||||
+; CHECK: ret i8 %1
|
||||
+; CHECK: }
|
||||
+
|
||||
diff --git a/llvm/test/LTO/X86/hidden-escaped-symbols.ll b/llvm/test/LTO/X86/hidden-escaped-symbols.ll
|
||||
new file mode 100644
|
||||
index 000000000000..aec617e25d3d
|
||||
--- /dev/null
|
||||
+++ b/llvm/test/LTO/X86/hidden-escaped-symbols.ll
|
||||
@@ -0,0 +1,41 @@
|
||||
+; Check interaction between LTO and LLVM mangling escape char, see #57864.
|
||||
+
|
||||
+; RUN: split-file %s %t
|
||||
+; RUN: opt %t/hide-me.ll -o %t/hide-me.bc
|
||||
+; RUN: opt %t/ref.ll -o %t/ref.bc
|
||||
+; RUN: llvm-lto2 run \
|
||||
+; RUN: -r %t/hide-me.bc,_hide_me,p \
|
||||
+; RUN: -r %t/ref.bc,_main,plx \
|
||||
+; RUN: -r %t/ref.bc,_hide_me,l \
|
||||
+; RUN: --select-save-temps=precodegen \
|
||||
+; RUN: -o %t/out \
|
||||
+; RUN: %t/hide-me.bc %t/ref.bc
|
||||
+; RUN: llvm-dis %t/out.0.5.precodegen.bc -o - | FileCheck %s
|
||||
+
|
||||
+
|
||||
+;--- hide-me.ll
|
||||
+target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
+target triple = "x86_64-apple-macosx10.7.0"
|
||||
+
|
||||
+@hide_me = hidden local_unnamed_addr global i8 8, align 1
|
||||
+
|
||||
+;--- ref.ll
|
||||
+target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
+target triple = "x86_64-apple-macosx10.7.0"
|
||||
+
|
||||
+@"\01_hide_me" = external local_unnamed_addr global i8
|
||||
+
|
||||
+define i8 @main() {
|
||||
+ %1 = load i8, ptr @"\01_hide_me", align 1
|
||||
+ ret i8 %1
|
||||
+}
|
||||
+
|
||||
+
|
||||
+; CHECK: @hide_me = hidden local_unnamed_addr global i8 8, align 1
|
||||
+; CHECK: @"\01_hide_me" = external dso_local local_unnamed_addr global i8
|
||||
+
|
||||
+; CHECK: define dso_local i8 @main() local_unnamed_addr #0 {
|
||||
+; CHECK: %1 = load i8, ptr @"\01_hide_me", align 1
|
||||
+; CHECK: ret i8 %1
|
||||
+; CHECK: }
|
||||
+
|
||||
diff --git a/llvm/test/ThinLTO/X86/hidden-escaped-symbols-alt.ll b/llvm/test/ThinLTO/X86/hidden-escaped-symbols-alt.ll
|
||||
new file mode 100644
|
||||
index 000000000000..dadd1d434256
|
||||
--- /dev/null
|
||||
+++ b/llvm/test/ThinLTO/X86/hidden-escaped-symbols-alt.ll
|
||||
@@ -0,0 +1,42 @@
|
||||
+; Check interaction between LTO and LLVM mangling escape char, see #57864.
|
||||
+
|
||||
+; RUN: split-file %s %t
|
||||
+; RUN: opt -module-summary %t/hide-me.ll -o %t/hide-me.bc
|
||||
+; RUN: opt -module-summary %t/ref.ll -o %t/ref.bc
|
||||
+; RUN: llvm-lto2 run \
|
||||
+; RUN: -r %t/hide-me.bc,_hide_me,p \
|
||||
+; RUN: -r %t/ref.bc,_main,plx \
|
||||
+; RUN: -r %t/ref.bc,_hide_me,l \
|
||||
+; RUN: --select-save-temps=precodegen \
|
||||
+; RUN: -o %t/out \
|
||||
+; RUN: %t/hide-me.bc %t/ref.bc
|
||||
+; RUN: llvm-dis %t/out.1.5.precodegen.bc -o - | FileCheck --check-prefix=CHECK-HIDE %s
|
||||
+; RUN: llvm-dis %t/out.2.5.precodegen.bc -o - | FileCheck --check-prefix=CHECK-REF %s
|
||||
+
|
||||
+
|
||||
+;--- hide-me.ll
|
||||
+target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
+target triple = "x86_64-apple-macosx10.7.0"
|
||||
+
|
||||
+@"\01_hide_me" = hidden local_unnamed_addr global i8 8, align 1
|
||||
+
|
||||
+;--- ref.ll
|
||||
+target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
+target triple = "x86_64-apple-macosx10.7.0"
|
||||
+
|
||||
+@hide_me = external local_unnamed_addr global i8
|
||||
+
|
||||
+define i8 @main() {
|
||||
+ %1 = load i8, ptr @hide_me, align 1
|
||||
+ ret i8 %1
|
||||
+}
|
||||
+
|
||||
+
|
||||
+; CHECK-HIDE: @"\01_hide_me" = hidden local_unnamed_addr global i8 8, align 1
|
||||
+
|
||||
+; CHECK-REF: @hide_me = external local_unnamed_addr global i8
|
||||
+; CHECK-REF: define dso_local i8 @main() local_unnamed_addr #0 {
|
||||
+; CHECK-REF: %1 = load i8, ptr @hide_me, align 1
|
||||
+; CHECK-REF: ret i8 %1
|
||||
+; CHECK-REF: }
|
||||
+
|
||||
diff --git a/llvm/test/ThinLTO/X86/hidden-escaped-symbols.ll b/llvm/test/ThinLTO/X86/hidden-escaped-symbols.ll
|
||||
new file mode 100644
|
||||
index 000000000000..8d0e22f0fd22
|
||||
--- /dev/null
|
||||
+++ b/llvm/test/ThinLTO/X86/hidden-escaped-symbols.ll
|
||||
@@ -0,0 +1,42 @@
|
||||
+; Check interaction between LTO and LLVM mangling escape char, see #57864.
|
||||
+
|
||||
+; RUN: split-file %s %t
|
||||
+; RUN: opt -module-summary %t/hide-me.ll -o %t/hide-me.bc
|
||||
+; RUN: opt -module-summary %t/ref.ll -o %t/ref.bc
|
||||
+; RUN: llvm-lto2 run \
|
||||
+; RUN: -r %t/hide-me.bc,_hide_me,p \
|
||||
+; RUN: -r %t/ref.bc,_main,plx \
|
||||
+; RUN: -r %t/ref.bc,_hide_me,l \
|
||||
+; RUN: --select-save-temps=precodegen \
|
||||
+; RUN: -o %t/out \
|
||||
+; RUN: %t/hide-me.bc %t/ref.bc
|
||||
+; RUN: llvm-dis %t/out.1.5.precodegen.bc -o - | FileCheck --check-prefix=CHECK-HIDE %s
|
||||
+; RUN: llvm-dis %t/out.2.5.precodegen.bc -o - | FileCheck --check-prefix=CHECK-REF %s
|
||||
+
|
||||
+
|
||||
+;--- hide-me.ll
|
||||
+target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
+target triple = "x86_64-apple-macosx10.7.0"
|
||||
+
|
||||
+@hide_me = hidden local_unnamed_addr global i8 8, align 1
|
||||
+
|
||||
+;--- ref.ll
|
||||
+target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
+target triple = "x86_64-apple-macosx10.7.0"
|
||||
+
|
||||
+@"\01_hide_me" = external local_unnamed_addr global i8
|
||||
+
|
||||
+define i8 @main() {
|
||||
+ %1 = load i8, ptr @"\01_hide_me", align 1
|
||||
+ ret i8 %1
|
||||
+}
|
||||
+
|
||||
+
|
||||
+; CHECK-HIDE: @hide_me = hidden local_unnamed_addr global i8 8, align 1
|
||||
+
|
||||
+; CHECK-REF: @"\01_hide_me" = external local_unnamed_addr global i8
|
||||
+; CHECK-REF: define dso_local i8 @main() local_unnamed_addr #0 {
|
||||
+; CHECK-REF: %1 = load i8, ptr @"\01_hide_me", align 1
|
||||
+; CHECK-REF: ret i8 %1
|
||||
+; CHECK-REF: }
|
||||
+
|
||||
--
|
||||
2.38.1.1.g6d9df9d320
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
From 30742817d2eb1fc4f4c8b3b719aba20b3eeb936e Mon Sep 17 00:00:00 2001
|
||||
From: Mike Hommey <mh@glandium.org>
|
||||
Date: Wed, 12 Oct 2022 08:43:04 +0900
|
||||
Subject: [PATCH] [InstCombine] Bail out of casting calls when a conversion
|
||||
from/to byval is involved.
|
||||
|
||||
Fixes #58307
|
||||
|
||||
Differential Revision: https://reviews.llvm.org/D135738
|
||||
---
|
||||
.../InstCombine/InstCombineCalls.cpp | 4 +++
|
||||
llvm/test/Transforms/InstCombine/byval.ll | 3 +-
|
||||
.../test/Transforms/InstCombine/cast-byval.ll | 31 +++++++++++++++++++
|
||||
3 files changed, 36 insertions(+), 2 deletions(-)
|
||||
create mode 100644 llvm/test/Transforms/InstCombine/cast-byval.ll
|
||||
|
||||
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
|
||||
index bc01d2ef7fe2..52596b30494f 100644
|
||||
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
|
||||
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
|
||||
@@ -3289,6 +3289,10 @@ bool InstCombinerImpl::transformConstExprCastCall(CallBase &Call) {
|
||||
if (CallerPAL.hasParamAttr(i, Attribute::SwiftError))
|
||||
return false;
|
||||
|
||||
+ if (CallerPAL.hasParamAttr(i, Attribute::ByVal) !=
|
||||
+ Callee->getAttributes().hasParamAttr(i, Attribute::ByVal))
|
||||
+ return false; // Cannot transform to or from byval.
|
||||
+
|
||||
// If the parameter is passed as a byval argument, then we have to have a
|
||||
// sized type and the sized type has to have the same size as the old type.
|
||||
if (ParamTy != ActTy && CallerPAL.hasParamAttr(i, Attribute::ByVal)) {
|
||||
diff --git a/llvm/test/Transforms/InstCombine/byval.ll b/llvm/test/Transforms/InstCombine/byval.ll
|
||||
index e62bbe21c806..45750869524b 100644
|
||||
--- a/llvm/test/Transforms/InstCombine/byval.ll
|
||||
+++ b/llvm/test/Transforms/InstCombine/byval.ll
|
||||
@@ -7,8 +7,7 @@ declare void @add_byval_callee_2(double* byval(double))
|
||||
|
||||
define void @add_byval(i64* %in) {
|
||||
; CHECK-LABEL: @add_byval(
|
||||
-; CHECK-NEXT: [[TMP1:%.*]] = bitcast i64* [[IN:%.*]] to double*
|
||||
-; CHECK-NEXT: call void @add_byval_callee(double* byval(double) [[TMP1]])
|
||||
+; CHECK-NEXT: call void bitcast (void (double*)* @add_byval_callee to void (i64*)*)(i64* byval(i64) [[IN:%.*]])
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
%tmp = bitcast void (double*)* @add_byval_callee to void (i64*)*
|
||||
diff --git a/llvm/test/Transforms/InstCombine/cast-byval.ll b/llvm/test/Transforms/InstCombine/cast-byval.ll
|
||||
new file mode 100644
|
||||
index 000000000000..b3e3055837c2
|
||||
--- /dev/null
|
||||
+++ b/llvm/test/Transforms/InstCombine/cast-byval.ll
|
||||
@@ -0,0 +1,31 @@
|
||||
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
+; Check that function calls involving conversion from/to byval aren't transformed.
|
||||
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
|
||||
+
|
||||
+%Foo = type { i64 }
|
||||
+define i64 @foo (ptr byval(%Foo) %foo) {
|
||||
+; CHECK-LABEL: @foo(
|
||||
+; CHECK-NEXT: [[TMP1:%.*]] = load i64, ptr [[FOO:%.*]], align 4
|
||||
+; CHECK-NEXT: ret i64 [[TMP1]]
|
||||
+;
|
||||
+ %1 = load i64, ptr %foo, align 4
|
||||
+ ret i64 %1
|
||||
+}
|
||||
+
|
||||
+define i64 @bar(i64 %0) {
|
||||
+; CHECK-LABEL: @bar(
|
||||
+; CHECK-NEXT: [[TMP2:%.*]] = tail call i64 @foo(i64 [[TMP0:%.*]])
|
||||
+; CHECK-NEXT: ret i64 [[TMP2]]
|
||||
+;
|
||||
+ %2 = tail call i64 @foo(i64 %0)
|
||||
+ ret i64 %2
|
||||
+}
|
||||
+
|
||||
+define i64 @qux(ptr byval(%Foo) %qux) {
|
||||
+; CHECK-LABEL: @qux(
|
||||
+; CHECK-NEXT: [[TMP1:%.*]] = tail call i64 @bar(ptr nonnull byval([[FOO:%.*]]) [[QUX:%.*]])
|
||||
+; CHECK-NEXT: ret i64 [[TMP1]]
|
||||
+;
|
||||
+ %1 = tail call i64 @bar(ptr byval(%Foo) %qux)
|
||||
+ ret i64 %1
|
||||
+}
|
||||
--
|
||||
2.38.1.1.g6d9df9d320
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
https://reviews.llvm.org/D118653 added an optional section to the prof
|
||||
format, such that the output of the `llvm-profdata merge` is not readable
|
||||
by an older LLVM, such as the one in rustc. Technically speaking,
|
||||
the compatibility can be preserved, which we do here.
|
||||
|
||||
Alternatively, we could revert that change, but other changes have piled
|
||||
up, making a revert more difficult.
|
||||
|
||||
diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp
|
||||
index cd4e8900c963..e553d765bad0 100644
|
||||
--- a/llvm/lib/ProfileData/InstrProfWriter.cpp
|
||||
+++ b/llvm/lib/ProfileData/InstrProfWriter.cpp
|
||||
@@ -346,7 +346,9 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
|
||||
// Write the header.
|
||||
IndexedInstrProf::Header Header;
|
||||
Header.Magic = IndexedInstrProf::Magic;
|
||||
- Header.Version = IndexedInstrProf::ProfVersion::CurrentVersion;
|
||||
+ Header.Version = static_cast<bool>(ProfileKind & InstrProfKind::MemProf)
|
||||
+ ? IndexedInstrProf::ProfVersion::CurrentVersion
|
||||
+ : IndexedInstrProf::ProfVersion::Version7;
|
||||
if (static_cast<bool>(ProfileKind & InstrProfKind::IRInstrumentation))
|
||||
Header.Version |= VARIANT_MASK_IR_PROF;
|
||||
if (static_cast<bool>(ProfileKind & InstrProfKind::ContextSensitive))
|
||||
@@ -382,7 +384,8 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
|
||||
uint64_t MemProfSectionOffset = OS.tell();
|
||||
// Reserve space for the MemProf table field to be patched later if this
|
||||
// profile contains memory profile information.
|
||||
- OS.write(0);
|
||||
+ if (static_cast<bool>(ProfileKind & InstrProfKind::MemProf))
|
||||
+ OS.write(0);
|
||||
|
||||
// Reserve space to write profile summary data.
|
||||
uint32_t NumEntries = ProfileSummaryBuilder::DefaultCutoffs.size();
|
||||
@@ -482,8 +485,6 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
|
||||
PatchItem PatchItems[] = {
|
||||
// Patch the Header.HashOffset field.
|
||||
{HashTableStartFieldOffset, &HashTableStart, 1},
|
||||
- // Patch the Header.MemProfOffset (=0 for profiles without MemProf data).
|
||||
- {MemProfSectionOffset, &MemProfSectionStart, 1},
|
||||
// Patch the summary data.
|
||||
{SummaryOffset, reinterpret_cast<uint64_t *>(TheSummary.get()),
|
||||
(int)(SummarySize / sizeof(uint64_t))},
|
||||
@@ -492,6 +493,14 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
|
||||
|
||||
OS.patch(PatchItems, sizeof(PatchItems) / sizeof(*PatchItems));
|
||||
|
||||
+ if (static_cast<bool>(ProfileKind & InstrProfKind::MemProf)) {
|
||||
+ PatchItem PatchItems[] = {
|
||||
+ // Patch the Header.MemProfOffset (=0 for profiles without MemProf
|
||||
+ // data).
|
||||
+ {MemProfSectionOffset, &MemProfSectionStart, 1},
|
||||
+ };
|
||||
+ OS.patch(PatchItems, sizeof(PatchItems) / sizeof(*PatchItems));
|
||||
+ }
|
||||
for (const auto &I : FunctionData)
|
||||
for (const auto &F : I.getValue())
|
||||
if (Error E = validateRecord(F.second))
|
|
@ -3,3 +3,8 @@ if test `uname -s` = Linux; then
|
|||
fi
|
||||
|
||||
export MACOS_SDK_DIR=$MOZ_FETCHES_DIR/MacOSX11.3.sdk
|
||||
|
||||
if [ -n "$TASKCLUSTER_PGO_PROFILE_USE" -a -z "$USE_ARTIFACT" ]; then
|
||||
# Work around https://github.com/llvm/llvm-project/issues/57734
|
||||
export LDFLAGS=-Wl,-mllvm,--opaque-pointers
|
||||
fi
|
||||
|
|
|
@ -1673,10 +1673,17 @@ set_config("LINKER_KIND", select_linker.KIND)
|
|||
target_multiarch_dir,
|
||||
android_platform,
|
||||
c_compiler,
|
||||
developer_options,
|
||||
)
|
||||
@imports("os")
|
||||
def linker_ldflags(
|
||||
linker, target, sysroot, multiarch_dir, android_platform, c_compiler
|
||||
linker,
|
||||
target,
|
||||
sysroot,
|
||||
multiarch_dir,
|
||||
android_platform,
|
||||
c_compiler,
|
||||
developer_options,
|
||||
):
|
||||
flags = list((linker and linker.LINKER_FLAG) or [])
|
||||
# rpath-link is irrelevant to wasm, see for more info https://github.com/emscripten-core/emscripten/issues/11076.
|
||||
|
@ -1701,6 +1708,13 @@ def linker_ldflags(
|
|||
flags.append("-Wl,--rpath-link={}/usr/lib".format(android_platform))
|
||||
flags.append("--sysroot")
|
||||
flags.append(android_platform)
|
||||
if (
|
||||
developer_options
|
||||
and linker
|
||||
and linker.KIND == "lld"
|
||||
and target.kernel != "WINNT"
|
||||
):
|
||||
flags.append("-Wl,-O0")
|
||||
return flags
|
||||
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ function createTemporaryXPI(xpiData) {
|
|||
const manifest = Object.assign(
|
||||
{},
|
||||
{
|
||||
applications: { gecko: { id } },
|
||||
browser_specific_settings: { gecko: { id } },
|
||||
manifest_version: 2,
|
||||
name,
|
||||
version: "1.0",
|
||||
|
|
|
@ -31,7 +31,7 @@ add_task(async function() {
|
|||
useAddonManager: "temporary",
|
||||
manifest: {
|
||||
devtools_page: "extension.html",
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: { id: EXTENSION },
|
||||
},
|
||||
},
|
||||
|
|
|
@ -150,7 +150,7 @@ add_task(async function() {
|
|||
useAddonManager: "temporary",
|
||||
manifest: {
|
||||
devtools_page: "extension.html",
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: { id: EXTENSION },
|
||||
},
|
||||
},
|
||||
|
|
|
@ -67,7 +67,7 @@ add_task(async function testNoAdbExtension() {
|
|||
const extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
version: (extension_version++).toString(),
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: { id: "not-adb@mozilla.org" },
|
||||
},
|
||||
},
|
||||
|
@ -85,7 +85,7 @@ add_task(async function testNoAdbJSON() {
|
|||
const extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
version: (extension_version++).toString(),
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
// The extension id here and in later test cases should match the
|
||||
// corresponding prefrece value.
|
||||
gecko: { id: "adb@mozilla.org" },
|
||||
|
@ -105,7 +105,7 @@ add_task(async function testNoTargetBinaries() {
|
|||
const extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
version: (extension_version++).toString(),
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: { id: "adb@mozilla.org" },
|
||||
},
|
||||
},
|
||||
|
@ -126,7 +126,7 @@ add_task(async function testExtract() {
|
|||
const extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
version: (extension_version++).toString(),
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: { id: "adb@mozilla.org" },
|
||||
},
|
||||
},
|
||||
|
@ -157,7 +157,7 @@ add_task(
|
|||
const extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
version: (extension_version++).toString(),
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: { id: "adb@mozilla.org" },
|
||||
},
|
||||
},
|
||||
|
@ -205,7 +205,7 @@ add_task(
|
|||
const extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
version: (extension_version++).toString(),
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: { id: "adb@mozilla.org" },
|
||||
},
|
||||
},
|
||||
|
|
|
@ -846,7 +846,7 @@ add_task(async function test_panel_live_reload_for_extension_without_bg_page() {
|
|||
const EXTENSION_ID = "test_local_storage_live_reload@xpcshell.mozilla.org";
|
||||
let manifest = {
|
||||
version: "1.0",
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: {
|
||||
id: EXTENSION_ID,
|
||||
},
|
||||
|
@ -930,7 +930,7 @@ add_task(
|
|||
const EXTENSION_ID = "test_local_storage_live_reload@xpcshell.mozilla.org";
|
||||
let manifest = {
|
||||
version: "1.0",
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: {
|
||||
id: EXTENSION_ID,
|
||||
},
|
||||
|
@ -1009,7 +1009,7 @@ add_task(
|
|||
const EXTENSION_ID =
|
||||
"test_panel_data_only_updates_for_storage_local_changes@xpcshell.mozilla.org";
|
||||
const manifest = {
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: {
|
||||
id: EXTENSION_ID,
|
||||
},
|
||||
|
|
|
@ -67,7 +67,7 @@ add_task(async function test_panel_live_reload() {
|
|||
const EXTENSION_ID = "test_panel_live_reload@xpcshell.mozilla.org";
|
||||
let manifest = {
|
||||
version: "1.0",
|
||||
applications: {
|
||||
browser_specific_settings: {
|
||||
gecko: {
|
||||
id: EXTENSION_ID,
|
||||
},
|
||||
|
|
|
@ -1048,17 +1048,23 @@ JavaScript engine (SpiderMonkey)
|
|||
| `Jan de Mooij (jandem) <https://people.mozilla.org/s?query=jandem>`__
|
||||
* - Peer(s)
|
||||
-
|
||||
| `Yoshi Cheng-Hao Huang (allstars.chh) <https://people.mozilla.org/s?query=allstars.chh>`__
|
||||
| `André Bargull (anba) <https://people.mozilla.org/s?query=anba>`__
|
||||
| `Tooru Fujisawa (arai) <https://people.mozilla.org/s?query=arai>`__
|
||||
| `Bobby Holley (bholley) <https://people.mozilla.org/s?query=bholley>`__
|
||||
| `Bryan Thrall (bthrall) <https://people.mozilla.org/s?query=bthrall>`__
|
||||
| `Dan Minor (dminor) <https://people.mozilla.org/s?query=dminor>`__
|
||||
| `Tom Schuster (evilpie) <https://people.mozilla.org/s?query=evilpie>`__
|
||||
| `Iain Ireland (iain) <https://people.mozilla.org/s?query=iain>`__
|
||||
| `Jon Coppeard (jonco) <https://people.mozilla.org/s?query=jonco>`__
|
||||
| `Julian Seward (jseward) <https://people.mozilla.org/s?query=jseward>`__
|
||||
| `Matthew Gaudet (mgaudet) <https://people.mozilla.org/s?query=mgaudet>`__
|
||||
| `Nicolas B (nbp) <https://people.mozilla.org/s?query=nbp>`__
|
||||
| `Ryan Hunt (rhunt) <https://people.mozilla.org/s?query=rhunt>`__
|
||||
| `Steve Fink (sfink) <https://people.mozilla.org/s?query=sfink>`__
|
||||
| `Ted Campbell (tcampbell) <https://people.mozilla.org/s?query=tcampbell>`__
|
||||
| `Yulia Startsev (yulia) <https://people.mozilla.org/s?query=yulia>`__
|
||||
| `Yury Delendik (yury) <https://people.mozilla.org/s?query=yury>`__
|
||||
* - Owner(s) Emeritus
|
||||
- Brendan Eich, Dave Mandelin, Luke Wagner, Jason Orendorff
|
||||
* - Peer(s) Emeritus
|
||||
|
@ -2726,6 +2732,7 @@ Extension management back-end.
|
|||
| `Luca Greco (rpl) <https://people.mozilla.org/s?query=rpl>`__
|
||||
| `Tomislav Jovanovic (zombie) <https://people.mozilla.org/s?query=zombie>`__
|
||||
| `Rob Wu (robwu) <https://people.mozilla.org/s?query=robwu>`__
|
||||
| `William Durand (willdurand) <https://people.mozilla.org/s?query=willdurand>`__
|
||||
* - Owner(s) Emeritus
|
||||
- Robert Strong, Andrew Swan, Kris Maglione
|
||||
* - Includes
|
||||
|
@ -2818,6 +2825,7 @@ The style rules used in the desktop UI.
|
|||
-
|
||||
| `Itiel (itiel_yn8) <https://people.mozilla.org/s?query=itiel_yn8>`__
|
||||
| `Sam Foster (sfoster) <https://people.mozilla.org/s?query=sfoster>`__
|
||||
| `Amy Churchwell (amy) <https://people.mozilla.org/s?query=amy>`__
|
||||
* - Peer(s) Emeritus
|
||||
- Tim Nguyen
|
||||
* - Includes
|
||||
|
@ -2864,7 +2872,8 @@ The downloads UI and service.
|
|||
* - Peer(s)
|
||||
-
|
||||
| `Gijs <https://people.mozilla.org/s?query=Gijs>`__
|
||||
| `Micah (mtigley) <https://people.mozilla.org/s?query=mtigley>`__
|
||||
* - Peer(s) Emeritus
|
||||
- Micah Tigley
|
||||
* - Includes
|
||||
-
|
||||
| `browser/components/downloads/\*\*/\* <https://searchfox.org/mozilla-central/search?q=&path=browser/components/downloads/\*\*/\*>`__
|
||||
|
@ -2882,7 +2891,7 @@ System policies for controlling Firefox.
|
|||
|
||||
* - Owner(s)
|
||||
-
|
||||
| `Please use mozilla (mkaply) <https://people.mozilla.org/s?query=mkaply>`__
|
||||
| `Mike Kaply (mkaply) <https://people.mozilla.org/s?query=mkaply>`__
|
||||
* - Peer(s)
|
||||
-
|
||||
| `Dão Gottwald (dao) <https://people.mozilla.org/s?query=dao>`__
|
||||
|
@ -2957,11 +2966,10 @@ The system for delivering in-product messaging.
|
|||
|
||||
* - Owner(s)
|
||||
-
|
||||
| `Andrei Oprea (aoprea) <https://people.mozilla.org/s?query=aoprea>`__
|
||||
| `Punam Dahiya (pdahiya) <https://people.mozilla.org/s?query=pdahiya>`__
|
||||
* - Peer(s)
|
||||
-
|
||||
| `Nan Jiang (nanj) <https://people.mozilla.org/s?query=nanj>`__
|
||||
| `Punam Dahiya (pdahiya) <https://people.mozilla.org/s?query=pdahiya>`__
|
||||
| `Ed Lee (Mardak) <https://people.mozilla.org/s?query=Mardak>`__
|
||||
| `Kate Hudson (k88hudson) <https://people.mozilla.org/s?query=k88hudson>`__
|
||||
* - Includes
|
||||
|
@ -3095,6 +3103,31 @@ Managing, saving and filling logins.
|
|||
- Toolkit::Password Manager, Toolkit::Password Manager: Site, Compatibility, Firefox::about:logins
|
||||
|
||||
|
||||
Picture-in-Picture
|
||||
==================
|
||||
A component that allows video elements to be pulled out into an always-on-top window.
|
||||
|
||||
|
||||
.. list-table::
|
||||
:stub-columns: 1
|
||||
:widths: 30 70
|
||||
|
||||
* - Owner(s)
|
||||
-
|
||||
| `Molly Howell (mhowell) <https://people.mozilla.org/s?query=mhowell>`__
|
||||
| `Mike Conley (mconley) <https://people.mozilla.org/s?query=mconley>`__
|
||||
* - Peer(s)
|
||||
-
|
||||
| `Niklas Baumgardner (niklas) <https://people.mozilla.org/s?query=niklas>`__
|
||||
| `kpatenio (kpatenio) <https://people.mozilla.org/s?query=kpatenio>`__
|
||||
* - Owner(s) Emeritus
|
||||
- Micah Tigley
|
||||
* - Includes
|
||||
-
|
||||
| `toolkit/components/pictureinpicture <https://searchfox.org/mozilla-central/search?q=&path=toolkit/components/pictureinpicture>`__
|
||||
| `browser/extensions/pictureinpicture <https://searchfox.org/mozilla-central/search?q=&path=browser/extensions/pictureinpicture>`__
|
||||
|
||||
|
||||
Preferences
|
||||
===========
|
||||
The front-end preferences system.
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
let self = this;
|
||||
|
||||
let { setTimeout } = ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
let { setTimeout } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/Timer.sys.mjs"
|
||||
);
|
||||
|
||||
const CC = Components.Constructor;
|
||||
const BinaryInputStream = CC(
|
||||
|
|
|
@ -5456,8 +5456,6 @@ nsresult NS_NewDOMDocument(
|
|||
nsIURI* aDocumentURI, nsIURI* aBaseURI, nsIPrincipal* aPrincipal,
|
||||
bool aLoadedAsData, nsIGlobalObject* aEventObject, DocumentFlavor aFlavor);
|
||||
|
||||
nsresult NS_NewPluginDocument(mozilla::dom::Document** aInstancePtrResult);
|
||||
|
||||
inline mozilla::dom::Document* nsINode::GetOwnerDocument() const {
|
||||
mozilla::dom::Document* ownerDoc = OwnerDoc();
|
||||
|
||||
|
|
|
@ -3190,6 +3190,11 @@ void Selection::NotifySelectionListeners() {
|
|||
}
|
||||
|
||||
RefPtr<nsFrameSelection> frameSelection = mFrameSelection;
|
||||
|
||||
// This flag will be set to true if a selection by double click is detected.
|
||||
// As soon as the selection is modified, it needs to be set to false.
|
||||
frameSelection->SetIsDoubleClickSelection(false);
|
||||
|
||||
if (frameSelection->IsBatching()) {
|
||||
frameSelection->SetChangesDuringBatchingFlag();
|
||||
return;
|
||||
|
|
|
@ -252,15 +252,8 @@ void nsImageLoadingContent::OnLoadComplete(imgIRequest* aRequest,
|
|||
// Fire the appropriate DOM event.
|
||||
if (NS_SUCCEEDED(aStatus)) {
|
||||
FireEvent(u"load"_ns);
|
||||
|
||||
// Do not fire loadend event for multipart/x-mixed-replace image streams.
|
||||
bool isMultipart;
|
||||
if (NS_FAILED(aRequest->GetMultipart(&isMultipart)) || !isMultipart) {
|
||||
FireEvent(u"loadend"_ns);
|
||||
}
|
||||
} else {
|
||||
FireEvent(u"error"_ns);
|
||||
FireEvent(u"loadend"_ns);
|
||||
}
|
||||
|
||||
SVGObserverUtils::InvalidateDirectRenderingObservers(
|
||||
|
@ -987,7 +980,6 @@ nsImageLoadingContent::LoadImageWithChannel(nsIChannel* aChannel,
|
|||
if (!mCurrentRequest) aChannel->GetURI(getter_AddRefs(mCurrentURI));
|
||||
|
||||
FireEvent(u"error"_ns);
|
||||
FireEvent(u"loadend"_ns);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -1063,14 +1055,10 @@ nsresult nsImageLoadingContent::LoadImage(nsIURI* aNewURI, bool aForce,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
// Fire loadstart event if required
|
||||
FireEvent(u"loadstart"_ns);
|
||||
|
||||
if (!mLoadingEnabled) {
|
||||
// XXX Why fire an error here? seems like the callers to SetLoadingEnabled
|
||||
// don't want/need it.
|
||||
FireEvent(u"error"_ns);
|
||||
FireEvent(u"loadend"_ns);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1100,7 +1088,6 @@ nsresult nsImageLoadingContent::LoadImage(nsIURI* aNewURI, bool aForce,
|
|||
ClearPendingRequest(NS_BINDING_ABORTED, Some(OnNonvisible::DiscardImages));
|
||||
|
||||
FireEvent(u"error"_ns);
|
||||
FireEvent(u"loadend"_ns);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1207,7 +1194,6 @@ nsresult nsImageLoadingContent::LoadImage(nsIURI* aNewURI, bool aForce,
|
|||
}
|
||||
|
||||
FireEvent(u"error"_ns);
|
||||
FireEvent(u"loadend"_ns);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -356,8 +356,7 @@ class nsImageLoadingContent : public nsIImageLoadingContent {
|
|||
/**
|
||||
* Method to fire an event once we know what's going on with the image load.
|
||||
*
|
||||
* @param aEventType "loadstart", "loadend", "load", or "error" depending on
|
||||
* how things went
|
||||
* @param aEventType "load", or "error" depending on how things went
|
||||
* @param aIsCancelable true if event is cancelable.
|
||||
*/
|
||||
nsresult FireEvent(const nsAString& aEventType, bool aIsCancelable = false);
|
||||
|
|
|
@ -1784,6 +1784,12 @@ bool DrawTargetWebgl::SharedContext::DrawRectAccel(
|
|||
}
|
||||
}
|
||||
|
||||
// We need to be able to transform from local space into texture space.
|
||||
Matrix invMatrix = surfacePattern.mMatrix;
|
||||
if (!invMatrix.Invert()) {
|
||||
break;
|
||||
}
|
||||
|
||||
RefPtr<WebGLTextureJS> tex;
|
||||
IntRect bounds;
|
||||
IntSize backingSize;
|
||||
|
@ -1988,7 +1994,7 @@ bool DrawTargetWebgl::SharedContext::DrawRectAccel(
|
|||
// the backing texture subrect.
|
||||
Size backingSizeF(backingSize);
|
||||
Matrix uvMatrix(aRect.width, 0.0f, 0.0f, aRect.height, aRect.x, aRect.y);
|
||||
uvMatrix *= surfacePattern.mMatrix.Inverse();
|
||||
uvMatrix *= invMatrix;
|
||||
uvMatrix *= Matrix(1.0f / backingSizeF.width, 0.0f, 0.0f,
|
||||
1.0f / backingSizeF.height,
|
||||
float(bounds.x - offset.x) / backingSizeF.width,
|
||||
|
@ -2307,6 +2313,14 @@ bool DrawTargetWebgl::SharedContext::DrawPathAccel(
|
|||
if (intBounds.IsEmpty()) {
|
||||
return true;
|
||||
}
|
||||
// If a stroke path covers too much screen area, it is likely that most is
|
||||
// empty space in the interior. This usually imposes too high a cost versus
|
||||
// just rasterizing without acceleration.
|
||||
if (aStrokeOptions &&
|
||||
intBounds.width * intBounds.height >
|
||||
(mViewportSize.width / 2) * (mViewportSize.height / 2)) {
|
||||
return false;
|
||||
}
|
||||
// If the pattern is a solid color, then this will be used along with a path
|
||||
// mask to render the path, as opposed to baking the pattern into the cached
|
||||
// path texture.
|
||||
|
|
|
@ -81,7 +81,6 @@ WEBIDL_FILES = [
|
|||
"SessionStoreUtils.webidl",
|
||||
"StructuredCloneHolder.webidl",
|
||||
"TelemetryStopwatch.webidl",
|
||||
"UniFFI.webidl",
|
||||
"UserInteraction.webidl",
|
||||
"WebExtensionContentScript.webidl",
|
||||
"WebExtensionPolicy.webidl",
|
||||
|
@ -92,6 +91,11 @@ WEBIDL_FILES = [
|
|||
"XULTreeElement.webidl",
|
||||
]
|
||||
|
||||
if CONFIG["MOZ_BUILD_APP"] != "mobile/android":
|
||||
WEBIDL_FILES += [
|
||||
"UniFFI.webidl",
|
||||
]
|
||||
|
||||
if CONFIG["MOZ_PLACES"]:
|
||||
WEBIDL_FILES += [
|
||||
"PlacesEvent.webidl",
|
||||
|
|
|
@ -11,9 +11,11 @@
|
|||
#include "mozilla/dom/IdentityNetworkHelpers.h"
|
||||
#include "mozilla/dom/Request.h"
|
||||
#include "mozilla/dom/WindowGlobalChild.h"
|
||||
#include "mozilla/Components.h"
|
||||
#include "mozilla/ExpandedPrincipal.h"
|
||||
#include "mozilla/NullPrincipal.h"
|
||||
#include "nsEffectiveTLDService.h"
|
||||
#include "nsIIdentityCredentialPromptService.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
@ -136,31 +138,48 @@ IdentityCredential::DiscoverFromExternalSource(
|
|||
// static
|
||||
RefPtr<IdentityCredential::GetIPCIdentityCredentialPromise>
|
||||
IdentityCredential::DiscoverFromExternalSourceInMainProcess(
|
||||
nsIPrincipal* aPrincipal,
|
||||
nsIPrincipal* aPrincipal, CanonicalBrowsingContext* aBrowsingContext,
|
||||
const IdentityCredentialRequestOptions& aOptions) {
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
MOZ_ASSERT(aPrincipal);
|
||||
MOZ_ASSERT(aBrowsingContext);
|
||||
|
||||
// Make sure we have exactly one provider.
|
||||
// Make sure we have providers.
|
||||
if (!aOptions.mProviders.WasPassed() ||
|
||||
aOptions.mProviders.Value().Length() != 1) {
|
||||
aOptions.mProviders.Value().Length() < 1) {
|
||||
return IdentityCredential::GetIPCIdentityCredentialPromise::CreateAndReject(
|
||||
NS_ERROR_DOM_NOT_ALLOWED_ERR, __func__);
|
||||
}
|
||||
|
||||
// Get that provider
|
||||
IdentityProvider provider(aOptions.mProviders.Value()[0]);
|
||||
nsCOMPtr<nsIPrincipal> principal(aPrincipal);
|
||||
RefPtr<CanonicalBrowsingContext> browsingContext(aBrowsingContext);
|
||||
|
||||
return IdentityCredential::CreateCredential(aPrincipal, provider);
|
||||
// Have the user choose a provider.
|
||||
return PromptUserToSelectProvider(aBrowsingContext,
|
||||
aOptions.mProviders.Value())
|
||||
->Then(
|
||||
GetCurrentSerialEventTarget(), __func__,
|
||||
[principal, browsingContext](const IdentityProvider& provider) {
|
||||
return IdentityCredential::CreateCredential(
|
||||
principal, browsingContext, provider);
|
||||
},
|
||||
[](nsresult error) {
|
||||
return IdentityCredential::GetIPCIdentityCredentialPromise::
|
||||
CreateAndReject(error, __func__);
|
||||
});
|
||||
}
|
||||
|
||||
// static
|
||||
RefPtr<IdentityCredential::GetIPCIdentityCredentialPromise>
|
||||
IdentityCredential::CreateCredential(nsIPrincipal* aPrincipal,
|
||||
BrowsingContext* aBrowsingContext,
|
||||
const IdentityProvider& aProvider) {
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
MOZ_ASSERT(aPrincipal);
|
||||
MOZ_ASSERT(aBrowsingContext);
|
||||
|
||||
nsCOMPtr<nsIPrincipal> argumentPrincipal = aPrincipal;
|
||||
RefPtr<BrowsingContext> browsingContext(aBrowsingContext);
|
||||
|
||||
return IdentityCredential::CheckRootManifest(aPrincipal, aProvider)
|
||||
->Then(
|
||||
|
@ -190,21 +209,34 @@ IdentityCredential::CreateCredential(nsIPrincipal* aPrincipal,
|
|||
})
|
||||
->Then(
|
||||
GetCurrentSerialEventTarget(), __func__,
|
||||
[argumentPrincipal, aProvider](
|
||||
[argumentPrincipal, browsingContext, aProvider](
|
||||
const Tuple<IdentityInternalManifest, IdentityAccountList>&
|
||||
promiseResult) {
|
||||
IdentityInternalManifest currentManifest;
|
||||
IdentityAccountList accountList;
|
||||
Tie(currentManifest, accountList) = promiseResult;
|
||||
// Bug 1782088: We currently just use the first account
|
||||
if (!accountList.mAccounts.WasPassed() ||
|
||||
accountList.mAccounts.Value().Length() == 0) {
|
||||
return IdentityCredential::GetTokenPromise::CreateAndReject(
|
||||
return IdentityCredential::GetAccountPromise::CreateAndReject(
|
||||
NS_ERROR_FAILURE, __func__);
|
||||
}
|
||||
return IdentityCredential::FetchToken(
|
||||
argumentPrincipal, aProvider, currentManifest,
|
||||
accountList.mAccounts.Value()[0]);
|
||||
return PromptUserToSelectAccount(browsingContext, accountList,
|
||||
currentManifest);
|
||||
},
|
||||
[](nsresult error) {
|
||||
return IdentityCredential::GetAccountPromise::CreateAndReject(
|
||||
error, __func__);
|
||||
})
|
||||
->Then(
|
||||
GetCurrentSerialEventTarget(), __func__,
|
||||
[argumentPrincipal,
|
||||
aProvider](const Tuple<IdentityInternalManifest, IdentityAccount>&
|
||||
promiseResult) {
|
||||
IdentityInternalManifest currentManifest;
|
||||
IdentityAccount account;
|
||||
Tie(currentManifest, account) = promiseResult;
|
||||
return IdentityCredential::FetchToken(argumentPrincipal, aProvider,
|
||||
currentManifest, account);
|
||||
},
|
||||
[](nsresult error) {
|
||||
return IdentityCredential::GetTokenPromise::CreateAndReject(
|
||||
|
@ -224,7 +256,8 @@ IdentityCredential::CreateCredential(nsIPrincipal* aPrincipal,
|
|||
return IdentityCredential::GetIPCIdentityCredentialPromise::
|
||||
CreateAndResolve(credential, __func__);
|
||||
},
|
||||
[](nsresult error) {
|
||||
[browsingContext](nsresult error) {
|
||||
CloseUserInterface(browsingContext);
|
||||
return IdentityCredential::GetIPCIdentityCredentialPromise::
|
||||
CreateAndReject(error, __func__);
|
||||
});
|
||||
|
@ -371,8 +404,8 @@ IdentityCredential::FetchAccountList(
|
|||
// Build the principal to use for this connection
|
||||
// This is an expanded principal! It has the cookies of the IDP because it
|
||||
// subsumes the constituent principals. It also has no serializable origin,
|
||||
// so it won't send an Origin header even though this is a CORS mode request.
|
||||
// It accomplishes this without being a SystemPrincipal too.
|
||||
// so it won't send an Origin header even though this is a CORS mode
|
||||
// request. It accomplishes this without being a SystemPrincipal too.
|
||||
nsCOMPtr<nsIURI> idpURI;
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(idpURI), configLocation);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
|
@ -517,4 +550,128 @@ RefPtr<IdentityCredential::GetTokenPromise> IdentityCredential::FetchToken(
|
|||
});
|
||||
}
|
||||
|
||||
// static
|
||||
RefPtr<IdentityCredential::GetIdentityProviderPromise>
|
||||
IdentityCredential::PromptUserToSelectProvider(
|
||||
BrowsingContext* aBrowsingContext,
|
||||
const Sequence<IdentityProvider>& aProviders) {
|
||||
MOZ_ASSERT(aBrowsingContext);
|
||||
RefPtr<IdentityCredential::GetIdentityProviderPromise::Private>
|
||||
resultPromise =
|
||||
new IdentityCredential::GetIdentityProviderPromise::Private(__func__);
|
||||
|
||||
if (NS_WARN_IF(!aBrowsingContext)) {
|
||||
resultPromise->Reject(NS_ERROR_FAILURE, __func__);
|
||||
return resultPromise;
|
||||
}
|
||||
|
||||
nsresult error;
|
||||
nsCOMPtr<nsIIdentityCredentialPromptService> icPromptService =
|
||||
mozilla::components::IdentityCredentialPromptService::Service(&error);
|
||||
if (NS_WARN_IF(!icPromptService)) {
|
||||
resultPromise->Reject(error, __func__);
|
||||
return resultPromise;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIXPConnectWrappedJS> wrapped = do_QueryInterface(icPromptService);
|
||||
AutoJSAPI jsapi;
|
||||
if (NS_WARN_IF(!jsapi.Init(wrapped->GetJSObjectGlobal()))) {
|
||||
resultPromise->Reject(NS_ERROR_FAILURE, __func__);
|
||||
return resultPromise;
|
||||
}
|
||||
|
||||
JS::Rooted<JS::Value> providersJS(jsapi.cx());
|
||||
bool success = ToJSValue(jsapi.cx(), aProviders, &providersJS);
|
||||
if (NS_WARN_IF(!success)) {
|
||||
resultPromise->Reject(NS_ERROR_FAILURE, __func__);
|
||||
return resultPromise;
|
||||
}
|
||||
|
||||
RefPtr<Promise> showPromptPromise;
|
||||
icPromptService->ShowProviderPrompt(aBrowsingContext, providersJS,
|
||||
getter_AddRefs(showPromptPromise));
|
||||
|
||||
RefPtr<DomPromiseListener> listener = new DomPromiseListener(
|
||||
[resultPromise](JSContext* aCx, JS::Handle<JS::Value> aValue) {
|
||||
IdentityProvider result;
|
||||
bool success = result.Init(aCx, aValue);
|
||||
if (!success) {
|
||||
resultPromise->Reject(NS_ERROR_FAILURE, __func__);
|
||||
return;
|
||||
}
|
||||
resultPromise->Resolve(result, __func__);
|
||||
},
|
||||
[resultPromise](nsresult aRv) { resultPromise->Reject(aRv, __func__); });
|
||||
showPromptPromise->AppendNativeHandler(listener);
|
||||
|
||||
return resultPromise;
|
||||
}
|
||||
|
||||
// static
|
||||
RefPtr<IdentityCredential::GetAccountPromise>
|
||||
IdentityCredential::PromptUserToSelectAccount(
|
||||
BrowsingContext* aBrowsingContext, const IdentityAccountList& aAccounts,
|
||||
const IdentityInternalManifest& aManifest) {
|
||||
MOZ_ASSERT(aBrowsingContext);
|
||||
RefPtr<IdentityCredential::GetAccountPromise::Private> resultPromise =
|
||||
new IdentityCredential::GetAccountPromise::Private(__func__);
|
||||
|
||||
if (NS_WARN_IF(!aBrowsingContext)) {
|
||||
resultPromise->Reject(NS_ERROR_FAILURE, __func__);
|
||||
return resultPromise;
|
||||
}
|
||||
|
||||
nsresult error;
|
||||
nsCOMPtr<nsIIdentityCredentialPromptService> icPromptService =
|
||||
mozilla::components::IdentityCredentialPromptService::Service(&error);
|
||||
if (NS_WARN_IF(!icPromptService)) {
|
||||
resultPromise->Reject(error, __func__);
|
||||
return resultPromise;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIXPConnectWrappedJS> wrapped = do_QueryInterface(icPromptService);
|
||||
AutoJSAPI jsapi;
|
||||
if (NS_WARN_IF(!jsapi.Init(wrapped->GetJSObjectGlobal()))) {
|
||||
resultPromise->Reject(NS_ERROR_FAILURE, __func__);
|
||||
return resultPromise;
|
||||
}
|
||||
|
||||
JS::Rooted<JS::Value> accountsJS(jsapi.cx());
|
||||
bool success = ToJSValue(jsapi.cx(), aAccounts, &accountsJS);
|
||||
if (NS_WARN_IF(!success)) {
|
||||
resultPromise->Reject(NS_ERROR_FAILURE, __func__);
|
||||
return resultPromise;
|
||||
}
|
||||
|
||||
RefPtr<Promise> showPromptPromise;
|
||||
icPromptService->ShowAccountListPrompt(aBrowsingContext, accountsJS,
|
||||
getter_AddRefs(showPromptPromise));
|
||||
|
||||
RefPtr<DomPromiseListener> listener = new DomPromiseListener(
|
||||
[resultPromise, aManifest](JSContext* aCx, JS::Handle<JS::Value> aValue) {
|
||||
IdentityAccount result;
|
||||
bool success = result.Init(aCx, aValue);
|
||||
if (!success) {
|
||||
resultPromise->Reject(NS_ERROR_FAILURE, __func__);
|
||||
return;
|
||||
}
|
||||
resultPromise->Resolve(MakeTuple(aManifest, result), __func__);
|
||||
},
|
||||
[resultPromise](nsresult aRv) { resultPromise->Reject(aRv, __func__); });
|
||||
showPromptPromise->AppendNativeHandler(listener);
|
||||
|
||||
return resultPromise;
|
||||
}
|
||||
|
||||
// static
|
||||
void IdentityCredential::CloseUserInterface(BrowsingContext* aBrowsingContext) {
|
||||
nsresult error;
|
||||
nsCOMPtr<nsIIdentityCredentialPromptService> icPromptService =
|
||||
mozilla::components::IdentityCredentialPromptService::Service(&error);
|
||||
if (NS_WARN_IF(!icPromptService)) {
|
||||
return;
|
||||
}
|
||||
icPromptService->Close(aBrowsingContext);
|
||||
}
|
||||
|
||||
} // namespace mozilla::dom
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#ifndef mozilla_dom_IdentityCredential_h
|
||||
#define mozilla_dom_IdentityCredential_h
|
||||
|
||||
#include "mozilla/dom/CanonicalBrowsingContext.h"
|
||||
#include "mozilla/dom/Credential.h"
|
||||
#include "mozilla/dom/IPCIdentityCredential.h"
|
||||
#include "mozilla/MozPromise.h"
|
||||
|
@ -20,6 +21,8 @@ class IdentityCredential final : public Credential {
|
|||
GetIdentityCredentialPromise;
|
||||
typedef MozPromise<IPCIdentityCredential, nsresult, true>
|
||||
GetIPCIdentityCredentialPromise;
|
||||
typedef MozPromise<IdentityProvider, nsresult, true>
|
||||
GetIdentityProviderPromise;
|
||||
typedef MozPromise<bool, nsresult, true> ValidationPromise;
|
||||
typedef MozPromise<IdentityInternalManifest, nsresult, true>
|
||||
GetManifestPromise;
|
||||
|
@ -28,6 +31,9 @@ class IdentityCredential final : public Credential {
|
|||
GetAccountListPromise;
|
||||
typedef MozPromise<Tuple<IdentityToken, IdentityAccount>, nsresult, true>
|
||||
GetTokenPromise;
|
||||
typedef MozPromise<Tuple<IdentityInternalManifest, IdentityAccount>, nsresult,
|
||||
true>
|
||||
GetAccountPromise;
|
||||
|
||||
explicit IdentityCredential(nsPIDOMWindowInner* aParent);
|
||||
|
||||
|
@ -51,7 +57,7 @@ class IdentityCredential final : public Credential {
|
|||
|
||||
static RefPtr<GetIPCIdentityCredentialPromise>
|
||||
DiscoverFromExternalSourceInMainProcess(
|
||||
nsIPrincipal* aPrincipal,
|
||||
nsIPrincipal* aPrincipal, CanonicalBrowsingContext* aBrowsingContext,
|
||||
const IdentityCredentialRequestOptions& aOptions);
|
||||
|
||||
// Create an IPC credential that can be passed back to the content process.
|
||||
|
@ -69,7 +75,8 @@ class IdentityCredential final : public Credential {
|
|||
// Will send network requests to the IDP. The details of which are in the
|
||||
// other static methods here.
|
||||
static RefPtr<GetIPCIdentityCredentialPromise> CreateCredential(
|
||||
nsIPrincipal* aPrincipal, const IdentityProvider& aProvider);
|
||||
nsIPrincipal* aPrincipal, BrowsingContext* aBrowsingContext,
|
||||
const IdentityProvider& aProvider);
|
||||
|
||||
// Performs a Fetch for the root manifest of the provided identity provider
|
||||
// and validates it as correct. The returned promise resolves with a bool
|
||||
|
@ -147,6 +154,16 @@ class IdentityCredential final : public Credential {
|
|||
const IdentityInternalManifest& aManifest,
|
||||
const IdentityAccount& aAccount);
|
||||
|
||||
static RefPtr<GetIdentityProviderPromise> PromptUserToSelectProvider(
|
||||
BrowsingContext* aBrowsingContext,
|
||||
const Sequence<IdentityProvider>& aProviders);
|
||||
|
||||
static RefPtr<GetAccountPromise> PromptUserToSelectAccount(
|
||||
BrowsingContext* aBrowsingContext, const IdentityAccountList& aAccounts,
|
||||
const IdentityInternalManifest& aManifest);
|
||||
|
||||
static void CloseUserInterface(BrowsingContext* aBrowsingContext);
|
||||
|
||||
private:
|
||||
nsAutoString mToken;
|
||||
};
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
prefs =
|
||||
dom.security.credentialmanagement.identity.enabled=true
|
||||
dom.security.credentialmanagement.identity.wait_for_timeout=false
|
||||
dom.security.credentialmanagement.identity.select_first_in_ui_lists=true
|
||||
privacy.antitracking.enableWebcompat=false # disables opener heuristic
|
||||
scheme = https
|
||||
skip-if = xorigin
|
||||
|
@ -20,6 +21,8 @@ support-files =
|
|||
server_no_accounts_idtoken.sjs
|
||||
server_two_accounts_accounts.sjs
|
||||
server_two_accounts_idtoken.sjs
|
||||
server_two_providers_accounts.sjs
|
||||
server_two_providers_idtoken.sjs
|
||||
server_accounts_error_accounts.sjs
|
||||
server_accounts_error_idtoken.sjs
|
||||
server_idtoken_error_accounts.sjs
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
function handleRequest(request, response) {
|
||||
if (
|
||||
!request.hasHeader("Cookie") ||
|
||||
request.getHeader("Cookie") != "credential=authcookieval"
|
||||
) {
|
||||
response.setStatusLine(request.httpVersion, 400, "Bad Request");
|
||||
return;
|
||||
}
|
||||
if (request.hasHeader("Origin") && request.getHeader("Origin") != "null") {
|
||||
response.setStatusLine(request.httpVersion, 400, "Bad Request");
|
||||
return;
|
||||
}
|
||||
if (request.hasHeader("Referer")) {
|
||||
response.setStatusLine(request.httpVersion, 400, "Bad Request");
|
||||
return;
|
||||
}
|
||||
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
response.setHeader("Access-Control-Allow-Credentials", "true");
|
||||
response.setHeader("Content-Type", "application/json");
|
||||
let content = {
|
||||
accounts: [
|
||||
{
|
||||
id: "1234",
|
||||
given_name: "John",
|
||||
name: "John Doe",
|
||||
email: "john_doe@idp.example",
|
||||
picture: "https://idp.example/profile/123",
|
||||
approved_clients: ["123", "456", "789"],
|
||||
},
|
||||
{
|
||||
id: "5678",
|
||||
given_name: "Johnny",
|
||||
name: "Johnny",
|
||||
email: "johnny@idp.example",
|
||||
picture: "https://idp.example/profile/456",
|
||||
approved_clients: ["abc", "def", "ghi"],
|
||||
},
|
||||
],
|
||||
};
|
||||
let body = JSON.stringify(content);
|
||||
response.setStatusLine(request.httpVersion, 200, "OK");
|
||||
response.write(body);
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
const BinaryInputStream = Components.Constructor(
|
||||
"@mozilla.org/binaryinputstream;1",
|
||||
"nsIBinaryInputStream",
|
||||
"setInputStream"
|
||||
);
|
||||
|
||||
function readStream(inputStream) {
|
||||
let available = 0;
|
||||
let result = [];
|
||||
while ((available = inputStream.available()) > 0) {
|
||||
result.push(inputStream.readBytes(available));
|
||||
}
|
||||
return result.join("");
|
||||
}
|
||||
|
||||
function handleRequest(request, response) {
|
||||
if (request.method != "POST") {
|
||||
response.setStatusLine(request.httpVersion, 405, "Method Not Allowed");
|
||||
return;
|
||||
}
|
||||
if (
|
||||
!request.hasHeader("Cookie") ||
|
||||
request.getHeader("Cookie") != "credential=authcookieval"
|
||||
) {
|
||||
response.setStatusLine(request.httpVersion, 400, "Bad Request");
|
||||
return;
|
||||
}
|
||||
if (
|
||||
!request.hasHeader("Referer") ||
|
||||
request.getHeader("Referer") != "https://example.com/"
|
||||
) {
|
||||
response.setStatusLine(request.httpVersion, 400, "Bad Request");
|
||||
return;
|
||||
}
|
||||
if (
|
||||
!request.hasHeader("Origin") ||
|
||||
request.getHeader("Origin") != "https://example.com"
|
||||
) {
|
||||
response.setStatusLine(request.httpVersion, 400, "Bad Request");
|
||||
return;
|
||||
}
|
||||
|
||||
response.setHeader("Access-Control-Allow-Origin", "https://example.com");
|
||||
response.setHeader("Access-Control-Allow-Credentials", "true");
|
||||
response.setHeader("Content-Type", "application/json");
|
||||
let requestContent = readStream(
|
||||
new BinaryInputStream(request.bodyInputStream)
|
||||
);
|
||||
let responseContent = {
|
||||
token: requestContent,
|
||||
};
|
||||
let body = JSON.stringify(responseContent);
|
||||
response.setStatusLine(request.httpVersion, 200, "OK");
|
||||
response.write(body);
|
||||
}
|
|
@ -27,13 +27,18 @@
|
|||
});
|
||||
}
|
||||
).then((cred) => {
|
||||
// This is not the long-term planned behavior, but is the current
|
||||
// state of the spec.
|
||||
// See https://fedidcg.github.io/FedCM/#dom-identitycredential-discoverfromexternalsource-slot
|
||||
// as of Sept 2022.
|
||||
ok(false, "incorrectly got a credential");
|
||||
ok(true, "successfully got a credential");
|
||||
is(cred.token,
|
||||
"account_id=1234&client_id=mochitest&nonce=nonce&disclosure_text_shown=false",
|
||||
"Correct token on the credential.");
|
||||
is(cred.id,
|
||||
"1234",
|
||||
"Correct id on the credential");
|
||||
is(cred.type,
|
||||
"identity",
|
||||
"Correct type on the credential");
|
||||
}).catch((err) => {
|
||||
ok(true, "correctly got an error");
|
||||
ok(false, "must not have an error");
|
||||
}).finally(() => {
|
||||
SimpleTest.finish();
|
||||
})
|
||||
|
|
|
@ -217,6 +217,13 @@ already_AddRefed<RemoteLazyInputStream> RemoteLazyInputStream::WrapStream(
|
|||
|
||||
RefPtr<RemoteLazyInputStreamChild> actor =
|
||||
BindChildActor(id, std::move(childEp));
|
||||
|
||||
if (!actor) {
|
||||
MOZ_LOG(gRemoteLazyStreamLog, LogLevel::Warning,
|
||||
("Wrapping stream failed as we are probably late in shutdown!"));
|
||||
return do_AddRef(new RemoteLazyInputStream());
|
||||
}
|
||||
|
||||
return do_AddRef(new RemoteLazyInputStream(actor));
|
||||
}
|
||||
|
||||
|
@ -1389,6 +1396,12 @@ already_AddRefed<RemoteLazyInputStream> RemoteLazyInputStream::IPCRead(
|
|||
RefPtr<RemoteLazyInputStreamChild> actor =
|
||||
BindChildActor(id, std::move(endpoint));
|
||||
|
||||
if (!actor) {
|
||||
MOZ_LOG(gRemoteLazyStreamLog, LogLevel::Warning,
|
||||
("Deserialize failed as we are probably late in shutdown!"));
|
||||
return do_AddRef(new RemoteLazyInputStream());
|
||||
}
|
||||
|
||||
return do_AddRef(new RemoteLazyInputStream(actor, start, length));
|
||||
}
|
||||
|
||||
|
|
|
@ -2665,6 +2665,8 @@ mozilla::ipc::IPCResult ContentChild::RecvRemoteType(
|
|||
SetProcessName("WebExtensions"_ns, nullptr, &aProfile);
|
||||
} else if (aRemoteType == PRIVILEGEDABOUT_REMOTE_TYPE) {
|
||||
SetProcessName("Privileged Content"_ns, nullptr, &aProfile);
|
||||
} else if (aRemoteType == PRIVILEGEDMOZILLA_REMOTE_TYPE) {
|
||||
SetProcessName("Privileged Mozilla"_ns, nullptr, &aProfile);
|
||||
} else if (remoteTypePrefix == WITH_COOP_COEP_REMOTE_TYPE) {
|
||||
#ifdef NIGHTLY_BUILD
|
||||
SetProcessName("WebCOOP+COEP Content"_ns, nullptr, &aProfile);
|
||||
|
@ -2692,7 +2694,8 @@ mozilla::ipc::IPCResult ContentChild::RecvRemoteType(
|
|||
(remoteTypePrefix == FISSION_WEB_REMOTE_TYPE ||
|
||||
remoteTypePrefix == SERVICEWORKER_REMOTE_TYPE ||
|
||||
remoteTypePrefix == WITH_COOP_COEP_REMOTE_TYPE ||
|
||||
aRemoteType == PRIVILEGEDABOUT_REMOTE_TYPE)) {
|
||||
aRemoteType == PRIVILEGEDABOUT_REMOTE_TYPE ||
|
||||
aRemoteType == PRIVILEGEDMOZILLA_REMOTE_TYPE)) {
|
||||
JS::DisableSpectreMitigationsAfterInit();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "mozilla/PreallocatedProcessManager.h"
|
||||
|
||||
#include "mozilla/AppShutdown.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/ProfilerMarkers.h"
|
||||
|
@ -58,6 +59,7 @@ class PreallocatedProcessManagerImpl final : public nsIObserver {
|
|||
|
||||
void Init();
|
||||
|
||||
bool CanTake();
|
||||
bool CanAllocate();
|
||||
void AllocateAfterDelay(bool aStartup = false);
|
||||
void AllocateOnIdle();
|
||||
|
@ -69,9 +71,11 @@ class PreallocatedProcessManagerImpl final : public nsIObserver {
|
|||
void CloseProcesses();
|
||||
|
||||
bool IsEmpty() const { return mPreallocatedProcesses.IsEmpty(); }
|
||||
static bool IsShutdown() {
|
||||
return AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownConfirmed);
|
||||
}
|
||||
|
||||
bool mEnabled;
|
||||
static bool sShutdown;
|
||||
uint32_t mNumberPreallocs;
|
||||
AutoTArray<RefPtr<ContentParent>, 3> mPreallocatedProcesses;
|
||||
// Even if we have multiple PreallocatedProcessManagerImpls, we'll have
|
||||
|
@ -82,7 +86,6 @@ class PreallocatedProcessManagerImpl final : public nsIObserver {
|
|||
|
||||
/* static */
|
||||
uint32_t PreallocatedProcessManagerImpl::sNumBlockers = 0;
|
||||
bool PreallocatedProcessManagerImpl::sShutdown = false;
|
||||
|
||||
const char* const PreallocatedProcessManagerImpl::kObserverTopics[] = {
|
||||
"memory-pressure",
|
||||
|
@ -154,11 +157,6 @@ PreallocatedProcessManagerImpl::Observe(nsISupports* aSubject,
|
|||
for (auto topic : kObserverTopics) {
|
||||
os->RemoveObserver(this, topic);
|
||||
}
|
||||
// Let's prevent any new preallocated processes from starting. ContentParent
|
||||
// will handle the shutdown of the existing process and the
|
||||
// mPreallocatedProcesses reference will be cleared by the ClearOnShutdown
|
||||
// of the manager singleton.
|
||||
sShutdown = true;
|
||||
} else if (!strcmp("memory-pressure", aTopic)) {
|
||||
CloseProcesses();
|
||||
} else {
|
||||
|
@ -196,7 +194,7 @@ void PreallocatedProcessManagerImpl::RereadPrefs() {
|
|||
|
||||
already_AddRefed<ContentParent> PreallocatedProcessManagerImpl::Take(
|
||||
const nsACString& aRemoteType) {
|
||||
if (!mEnabled || sShutdown) {
|
||||
if (!CanTake()) {
|
||||
return nullptr;
|
||||
}
|
||||
RefPtr<ContentParent> process;
|
||||
|
@ -272,9 +270,13 @@ void PreallocatedProcessManagerImpl::RemoveBlocker(ContentParent* aParent) {
|
|||
}
|
||||
}
|
||||
|
||||
bool PreallocatedProcessManagerImpl::CanTake() {
|
||||
return mEnabled && !IsShutdown();
|
||||
}
|
||||
|
||||
bool PreallocatedProcessManagerImpl::CanAllocate() {
|
||||
return mEnabled && sNumBlockers == 0 &&
|
||||
mPreallocatedProcesses.Length() < mNumberPreallocs && !sShutdown &&
|
||||
mPreallocatedProcesses.Length() < mNumberPreallocs && !IsShutdown() &&
|
||||
(FissionAutostart() ||
|
||||
!ContentParent::IsMaxProcessCountReached(DEFAULT_REMOTE_TYPE));
|
||||
}
|
||||
|
@ -310,7 +312,7 @@ void PreallocatedProcessManagerImpl::AllocateNow() {
|
|||
MOZ_LOG(ContentParent::GetLog(), LogLevel::Debug,
|
||||
("Trying to start process now"));
|
||||
if (!CanAllocate()) {
|
||||
if (mEnabled && !sShutdown && IsEmpty() && sNumBlockers > 0) {
|
||||
if (mEnabled && !IsShutdown() && IsEmpty() && sNumBlockers > 0) {
|
||||
// If it's too early to allocate a process let's retry later.
|
||||
AllocateAfterDelay();
|
||||
}
|
||||
|
@ -343,7 +345,7 @@ void PreallocatedProcessManagerImpl::AllocateNow() {
|
|||
if (mPreallocatedProcesses.Length() < mNumberPreallocs) {
|
||||
AllocateOnIdle();
|
||||
}
|
||||
} else if (!mEnabled || sShutdown) {
|
||||
} else if (!mEnabled || IsShutdown()) {
|
||||
// if this has a remote type set, it's been allocated for use
|
||||
// already
|
||||
if (process->mRemoteType == PREALLOC_REMOTE_TYPE) {
|
||||
|
@ -387,7 +389,7 @@ void PreallocatedProcessManagerImpl::CloseProcesses() {
|
|||
|
||||
inline PreallocatedProcessManagerImpl*
|
||||
PreallocatedProcessManager::GetPPMImpl() {
|
||||
if (PreallocatedProcessManagerImpl::sShutdown) {
|
||||
if (PreallocatedProcessManagerImpl::IsShutdown()) {
|
||||
return nullptr;
|
||||
}
|
||||
return PreallocatedProcessManagerImpl::Singleton();
|
||||
|
|
|
@ -1353,7 +1353,7 @@ IPCResult WindowGlobalParent::RecvDiscoverIdentityCredentialFromExternalSource(
|
|||
const IdentityCredentialRequestOptions& aOptions,
|
||||
const DiscoverIdentityCredentialFromExternalSourceResolver& aResolver) {
|
||||
IdentityCredential::DiscoverFromExternalSourceInMainProcess(
|
||||
DocumentPrincipal(), aOptions)
|
||||
DocumentPrincipal(), this->BrowsingContext(), aOptions)
|
||||
->Then(
|
||||
GetCurrentSerialEventTarget(), __func__,
|
||||
[aResolver](const IPCIdentityCredential& aResult) {
|
||||
|
|
|
@ -2,4 +2,5 @@
|
|||
# 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/.
|
||||
|
||||
default-audio-output-device-label = Default audio output device
|
||||
mediastatus-fallback-title = { -brand-short-name } is playing media
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "mozilla/dom/NavigatorBinding.h"
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "mozilla/dom/WindowContext.h"
|
||||
#include "mozilla/intl/Localization.h"
|
||||
#include "mozilla/MediaManager.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
#include "MediaTrackConstraints.h"
|
||||
|
@ -31,9 +32,10 @@ using ConstDeviceSetPromise = MediaManager::ConstDeviceSetPromise;
|
|||
using LocalDeviceSetPromise = MediaManager::LocalDeviceSetPromise;
|
||||
using LocalMediaDeviceSetRefCnt = MediaManager::LocalMediaDeviceSetRefCnt;
|
||||
using MediaDeviceSetRefCnt = MediaManager::MediaDeviceSetRefCnt;
|
||||
using mozilla::intl::Localization;
|
||||
|
||||
MediaDevices::MediaDevices(nsPIDOMWindowInner* aWindow)
|
||||
: DOMEventTargetHelper(aWindow) {}
|
||||
: DOMEventTargetHelper(aWindow), mDefaultOutputLabel(VoidString()) {}
|
||||
|
||||
MediaDevices::~MediaDevices() {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
@ -267,11 +269,23 @@ RefPtr<MediaDeviceSetRefCnt> MediaDevices::FilterExposedDevices(
|
|||
if (!haveDefaultOutput && !outputIsDefault) {
|
||||
// Insert a virtual default device so that the first enumerated
|
||||
// device is the default output.
|
||||
if (mDefaultOutputLabel.IsVoid()) {
|
||||
mDefaultOutputLabel.SetIsVoid(false);
|
||||
AutoTArray<nsCString, 1> resourceIds{"dom/media.ftl"_ns};
|
||||
RefPtr l10n = Localization::Create(resourceIds, /*sync*/ true);
|
||||
nsAutoCString translation;
|
||||
IgnoredErrorResult rv;
|
||||
l10n->FormatValueSync("default-audio-output-device-label"_ns, {},
|
||||
translation, rv);
|
||||
if (!rv.Failed()) {
|
||||
AppendUTF8toUTF16(translation, mDefaultOutputLabel);
|
||||
}
|
||||
}
|
||||
RefPtr info = new AudioDeviceInfo(
|
||||
nullptr, u""_ns, u""_ns, u""_ns, CUBEB_DEVICE_TYPE_OUTPUT,
|
||||
CUBEB_DEVICE_STATE_ENABLED, CUBEB_DEVICE_PREF_ALL,
|
||||
CUBEB_DEVICE_FMT_ALL, CUBEB_DEVICE_FMT_S16NE, 2, 44100, 44100,
|
||||
44100, 128, 128);
|
||||
nullptr, mDefaultOutputLabel, u""_ns, u""_ns,
|
||||
CUBEB_DEVICE_TYPE_OUTPUT, CUBEB_DEVICE_STATE_ENABLED,
|
||||
CUBEB_DEVICE_PREF_ALL, CUBEB_DEVICE_FMT_ALL,
|
||||
CUBEB_DEVICE_FMT_S16NE, 2, 44100, 44100, 44100, 128, 128);
|
||||
exposed->AppendElement(
|
||||
new MediaDevice(new MediaEngineFake(), info, u""_ns));
|
||||
}
|
||||
|
|
|
@ -109,6 +109,8 @@ class MediaDevices final : public DOMEventTargetHelper {
|
|||
|
||||
nsTHashSet<nsString> mExplicitlyGrantedAudioOutputRawIds;
|
||||
nsTArray<RefPtr<Promise>> mPendingEnumerateDevicesPromises;
|
||||
// Set only once, if and when required.
|
||||
mutable nsString mDefaultOutputLabel;
|
||||
|
||||
// Connect/Disconnect on main thread only
|
||||
MediaEventListener mDeviceChangeListener;
|
||||
|
|
|
@ -974,6 +974,11 @@ already_AddRefed<VideoData> ChromiumCDMParent::CreateVideoFrame(
|
|||
media::TimeUnit::FromMicroseconds(aFrame.mDuration()), b, false,
|
||||
media::TimeUnit::FromMicroseconds(-1), pictureRegion, mKnowsCompositor);
|
||||
|
||||
if (!v || !v->mImage) {
|
||||
NS_WARNING("Failed to decode video frame.");
|
||||
return v.forget();
|
||||
}
|
||||
|
||||
// This is a DRM image.
|
||||
v->mImage->SetIsDRM(true);
|
||||
|
||||
|
|
|
@ -99,53 +99,6 @@ void ConstrainPreservingAspectRatioExact(uint32_t max_fs, t* width, t* height) {
|
|||
*height = 0;
|
||||
}
|
||||
|
||||
template <class t>
|
||||
void ConstrainPreservingAspectRatio(uint16_t max_width, uint16_t max_height,
|
||||
t* width, t* height) {
|
||||
if (((*width) <= max_width) && ((*height) <= max_height)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((*width) * max_height > max_width * (*height)) {
|
||||
(*height) = max_width * (*height) / (*width);
|
||||
(*width) = max_width;
|
||||
} else {
|
||||
(*width) = max_height * (*width) / (*height);
|
||||
(*height) = max_height;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to select and change the encoding frame rate based on incoming frame
|
||||
* rate and max-mbps setting.
|
||||
* @param current framerate
|
||||
* @result new framerate
|
||||
*/
|
||||
unsigned int SelectSendFrameRate(const VideoCodecConfig& codecConfig,
|
||||
unsigned int old_framerate,
|
||||
unsigned short sending_width,
|
||||
unsigned short sending_height) {
|
||||
unsigned int new_framerate = old_framerate;
|
||||
|
||||
// Limit frame rate based on max-mbps
|
||||
if (codecConfig.mEncodingConstraints.maxMbps) {
|
||||
unsigned int cur_fs, mb_width, mb_height;
|
||||
|
||||
mb_width = (sending_width + 15) >> 4;
|
||||
mb_height = (sending_height + 15) >> 4;
|
||||
|
||||
cur_fs = mb_width * mb_height;
|
||||
if (cur_fs > 0) { // in case no frames have been sent
|
||||
new_framerate = codecConfig.mEncodingConstraints.maxMbps / cur_fs;
|
||||
}
|
||||
}
|
||||
|
||||
new_framerate =
|
||||
std::min(new_framerate, WebrtcVideoConduit::ToLibwebrtcMaxFramerate(
|
||||
codecConfig.mEncodingConstraints.maxFps));
|
||||
return new_framerate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform validation on the codecConfig to be applied
|
||||
*/
|
||||
|
@ -384,11 +337,9 @@ WebrtcVideoConduit::WebrtcVideoConduit(
|
|||
MakeUnique<WebrtcVideoDecoderFactory>(mCallThread.get(), aPCHandle)),
|
||||
mEncoderFactory(MakeUnique<WebrtcVideoEncoderFactory>(
|
||||
mCallThread.get(), std::move(aPCHandle))),
|
||||
mVideoAdapter(MakeUnique<cricket::VideoAdapter>()),
|
||||
mBufferPool(false, SCALER_BUFFER_POOL_SIZE),
|
||||
mEngineTransmitting(false),
|
||||
mEngineReceiving(false),
|
||||
mMaxFramerateForAllStreams(std::numeric_limits<unsigned int>::max()),
|
||||
mVideoLatencyTestEnable(aOptions.mVideoLatencyTestEnable),
|
||||
mMinBitrate(aOptions.mMinBitrate),
|
||||
mStartBitrate(aOptions.mStartBitrate),
|
||||
|
@ -657,7 +608,6 @@ void WebrtcVideoConduit::OnControlConfigChange() {
|
|||
|
||||
if (ValidateCodecConfig(*codecConfig) == kMediaConduitNoError) {
|
||||
encoderReconfigureNeeded = true;
|
||||
mUpdateSendResolution = true;
|
||||
|
||||
mCurSendCodecConfig = codecConfig;
|
||||
|
||||
|
@ -678,15 +628,6 @@ void WebrtcVideoConduit::OnControlConfigChange() {
|
|||
"Updating send codec for VideoConduit:%p stream count:%zu",
|
||||
this, streamCount);
|
||||
|
||||
{
|
||||
// maxFps inside codecConfig applies to all streams.
|
||||
const unsigned maxFramerate =
|
||||
ToLibwebrtcMaxFramerate(codecConfig->mEncodingConstraints.maxFps);
|
||||
// apply restrictions from maxMbps/etc
|
||||
mMaxFramerateForAllStreams = SelectSendFrameRate(
|
||||
*codecConfig, maxFramerate, mLastWidth, mLastHeight);
|
||||
}
|
||||
|
||||
// So we can comply with b=TIAS/b=AS/maxbr=X when input resolution
|
||||
// changes
|
||||
MOZ_ASSERT(codecConfig->mTias < INT_MAX);
|
||||
|
@ -702,22 +643,6 @@ void WebrtcVideoConduit::OnControlConfigChange() {
|
|||
mCall->Call()->SetClientBitratePreferences(settings);
|
||||
}
|
||||
|
||||
mVideoStreamFactory = new rtc::RefCountedObject<VideoStreamFactory>(
|
||||
*codecConfig, mControl.mCodecMode, mMinBitrate, mStartBitrate,
|
||||
mPrefMaxBitrate, mNegotiatedMaxBitrate, mMaxFramerateForAllStreams);
|
||||
mEncoderConfig.video_stream_factory = mVideoStreamFactory.get();
|
||||
|
||||
// Reset the VideoAdapter. SelectResolution will ensure limits are set.
|
||||
mVideoAdapter = MakeUnique<cricket::VideoAdapter>(
|
||||
streamCount > 1 ? SIMULCAST_RESOLUTION_ALIGNMENT : 1);
|
||||
mVideoAdapter->OnScaleResolutionBy(
|
||||
codecConfig->mEncodings[highestResolutionIndex]
|
||||
.constraints.scaleDownBy > 1.0
|
||||
? absl::optional<float>(
|
||||
codecConfig->mEncodings[highestResolutionIndex]
|
||||
.constraints.scaleDownBy)
|
||||
: absl::optional<float>());
|
||||
|
||||
// XXX parse the encoded SPS/PPS data and set
|
||||
// spsData/spsLen/ppsData/ppsLen
|
||||
mEncoderConfig.encoder_specific_settings =
|
||||
|
@ -814,6 +739,8 @@ void WebrtcVideoConduit::OnControlConfigChange() {
|
|||
mSendStreamConfig.rtp = newRtp;
|
||||
sendStreamRecreationNeeded = true;
|
||||
}
|
||||
|
||||
mEncoderConfig.video_stream_factory = CreateVideoStreamFactory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -821,8 +748,15 @@ void WebrtcVideoConduit::OnControlConfigChange() {
|
|||
const auto& mode = mControl.mCodecMode.Ref();
|
||||
MOZ_ASSERT(mode == webrtc::VideoCodecMode::kRealtimeVideo ||
|
||||
mode == webrtc::VideoCodecMode::kScreensharing);
|
||||
if (mVideoStreamFactory) {
|
||||
mVideoStreamFactory->SetCodecMode(mode);
|
||||
|
||||
auto contentType =
|
||||
mode == webrtc::VideoCodecMode::kRealtimeVideo
|
||||
? webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo
|
||||
: webrtc::VideoEncoderConfig::ContentType::kScreen;
|
||||
|
||||
if (contentType != mEncoderConfig.content_type) {
|
||||
mEncoderConfig.video_stream_factory = CreateVideoStreamFactory();
|
||||
encoderReconfigureNeeded = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1313,49 +1247,13 @@ void WebrtcVideoConduit::DetachRenderer() {
|
|||
}
|
||||
}
|
||||
|
||||
void WebrtcVideoConduit::SelectSendResolution(unsigned short width,
|
||||
unsigned short height) {
|
||||
mMutex.AssertCurrentThreadOwns();
|
||||
if (mCurSendCodecConfig) {
|
||||
int max_fs = std::numeric_limits<int>::max();
|
||||
if (!mLockScaling) {
|
||||
max_fs = mVideoBroadcaster.wants().max_pixel_count;
|
||||
}
|
||||
// Limit resolution to max-fs
|
||||
if (mCurSendCodecConfig->mEncodingConstraints.maxFs) {
|
||||
// max-fs is in macroblocks, convert to pixels
|
||||
max_fs = std::min(
|
||||
max_fs,
|
||||
static_cast<int>(mCurSendCodecConfig->mEncodingConstraints.maxFs *
|
||||
(16 * 16)));
|
||||
}
|
||||
|
||||
unsigned int framerate_all_streams = SelectSendFrameRate(
|
||||
mCurSendCodecConfig.ref(), mMaxFramerateForAllStreams, width, height);
|
||||
if (mMaxFramerateForAllStreams != framerate_all_streams) {
|
||||
CSFLogDebug(LOGTAG, "%s: framerate changing to %u (from %u)",
|
||||
__FUNCTION__, framerate_all_streams,
|
||||
mMaxFramerateForAllStreams);
|
||||
mMaxFramerateForAllStreams = framerate_all_streams;
|
||||
mVideoStreamFactory->SetMaxFramerateForAllStreams(
|
||||
mMaxFramerateForAllStreams);
|
||||
}
|
||||
|
||||
int framerate_with_wants;
|
||||
if (framerate_all_streams > std::numeric_limits<int>::max()) {
|
||||
framerate_with_wants = std::numeric_limits<int>::max();
|
||||
} else {
|
||||
framerate_with_wants = static_cast<int>(framerate_all_streams);
|
||||
}
|
||||
|
||||
framerate_with_wants = std::min(
|
||||
framerate_with_wants, mVideoBroadcaster.wants().max_framerate_fps);
|
||||
CSFLogDebug(LOGTAG,
|
||||
"%s: Calling OnOutputFormatRequest, max_fs=%d, max_fps=%d",
|
||||
__FUNCTION__, max_fs, framerate_with_wants);
|
||||
mVideoAdapter->OnOutputFormatRequest(absl::optional<std::pair<int, int>>(),
|
||||
max_fs, framerate_with_wants);
|
||||
}
|
||||
rtc::RefCountedObject<mozilla::VideoStreamFactory>*
|
||||
WebrtcVideoConduit::CreateVideoStreamFactory() {
|
||||
mVideoStreamFactory = new rtc::RefCountedObject<VideoStreamFactory>(
|
||||
*mCurSendCodecConfig, mControl.mCodecMode, mMinBitrate, mStartBitrate,
|
||||
mPrefMaxBitrate, mNegotiatedMaxBitrate, mVideoBroadcaster.wants(),
|
||||
mLockScaling);
|
||||
return mVideoStreamFactory.get();
|
||||
}
|
||||
|
||||
void WebrtcVideoConduit::AddOrUpdateSink(
|
||||
|
@ -1368,7 +1266,8 @@ void WebrtcVideoConduit::AddOrUpdateSink(
|
|||
auto oldWants = mVideoBroadcaster.wants();
|
||||
mVideoBroadcaster.AddOrUpdateSink(sink, wants);
|
||||
if (oldWants != mVideoBroadcaster.wants()) {
|
||||
mUpdateSendResolution = true;
|
||||
mEncoderConfig.video_stream_factory = CreateVideoStreamFactory();
|
||||
mSendStream->ReconfigureVideoEncoder(mEncoderConfig.Copy());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1380,7 +1279,8 @@ void WebrtcVideoConduit::RemoveSink(
|
|||
auto oldWants = mVideoBroadcaster.wants();
|
||||
mVideoBroadcaster.RemoveSink(sink);
|
||||
if (oldWants != mVideoBroadcaster.wants()) {
|
||||
mUpdateSendResolution = true;
|
||||
mEncoderConfig.video_stream_factory = CreateVideoStreamFactory();
|
||||
mSendStream->ReconfigureVideoEncoder(mEncoderConfig.Copy());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1391,10 +1291,6 @@ MediaConduitErrorCode WebrtcVideoConduit::SendVideoFrame(
|
|||
// avoids sampling error when capturing frames, but google had to deal with
|
||||
// some broken cameras, include Logitech c920's IIRC.
|
||||
|
||||
int cropWidth;
|
||||
int cropHeight;
|
||||
int adaptedWidth;
|
||||
int adaptedHeight;
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
if (mSendStreamConfig.rtp.ssrcs.empty()) {
|
||||
|
@ -1411,9 +1307,7 @@ MediaConduitErrorCode WebrtcVideoConduit::SendVideoFrame(
|
|||
this, __FUNCTION__, mSendStreamConfig.rtp.ssrcs.front(),
|
||||
mSendStreamConfig.rtp.ssrcs.front());
|
||||
|
||||
bool updateSendResolution = mUpdateSendResolution.exchange(false);
|
||||
if (updateSendResolution || aFrame.width() != mLastWidth ||
|
||||
aFrame.height() != mLastHeight) {
|
||||
if (aFrame.width() != mLastWidth || aFrame.height() != mLastHeight) {
|
||||
// See if we need to recalculate what we're sending.
|
||||
CSFLogVerbose(LOGTAG, "%s: call SelectSendResolution with %ux%u",
|
||||
__FUNCTION__, aFrame.width(), aFrame.height());
|
||||
|
@ -1423,7 +1317,6 @@ MediaConduitErrorCode WebrtcVideoConduit::SendVideoFrame(
|
|||
|
||||
mLastWidth = aFrame.width();
|
||||
mLastHeight = aFrame.height();
|
||||
SelectSendResolution(aFrame.width(), aFrame.height());
|
||||
}
|
||||
|
||||
// adapt input video to wants of sink
|
||||
|
@ -1431,49 +1324,20 @@ MediaConduitErrorCode WebrtcVideoConduit::SendVideoFrame(
|
|||
return kMediaConduitNoError;
|
||||
}
|
||||
|
||||
if (!mVideoAdapter->AdaptFrameResolution(
|
||||
aFrame.width(), aFrame.height(),
|
||||
aFrame.timestamp_us() * rtc::kNumNanosecsPerMicrosec, &cropWidth,
|
||||
&cropHeight, &adaptedWidth, &adaptedHeight)) {
|
||||
// VideoAdapter dropped the frame.
|
||||
// Check if we need to drop this frame to meet a requested FPS
|
||||
if (mVideoStreamFactory->ShouldDropFrame(aFrame.timestamp_us())) {
|
||||
return kMediaConduitNoError;
|
||||
}
|
||||
|
||||
uint16_t max_width = mCurSendCodecConfig->mEncodingConstraints.maxWidth;
|
||||
uint16_t max_height = mCurSendCodecConfig->mEncodingConstraints.maxHeight;
|
||||
if (max_width || max_height) {
|
||||
max_width = max_width ? max_width : UINT16_MAX;
|
||||
max_height = max_height ? max_height : UINT16_MAX;
|
||||
ConstrainPreservingAspectRatio(max_width, max_height, &adaptedWidth,
|
||||
&adaptedHeight);
|
||||
}
|
||||
}
|
||||
|
||||
// If we have zero width or height, drop the frame here. Attempting to send
|
||||
// it will cause all sorts of problems in the webrtc.org code.
|
||||
if (cropWidth == 0 || cropHeight == 0) {
|
||||
if (aFrame.width() == 0 || aFrame.height() == 0) {
|
||||
return kMediaConduitNoError;
|
||||
}
|
||||
|
||||
int cropX = (aFrame.width() - cropWidth) / 2;
|
||||
int cropY = (aFrame.height() - cropHeight) / 2;
|
||||
|
||||
rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer;
|
||||
if (adaptedWidth == aFrame.width() && adaptedHeight == aFrame.height()) {
|
||||
// No adaption - optimized path.
|
||||
buffer = aFrame.video_frame_buffer();
|
||||
} else {
|
||||
// Adapted I420 frame.
|
||||
rtc::scoped_refptr<webrtc::I420Buffer> i420Buffer =
|
||||
mBufferPool.CreateI420Buffer(adaptedWidth, adaptedHeight);
|
||||
if (!i420Buffer) {
|
||||
CSFLogWarn(LOGTAG, "Creating a buffer for scaling failed, pool is empty");
|
||||
return kMediaConduitNoError;
|
||||
}
|
||||
i420Buffer->CropAndScaleFrom(*aFrame.video_frame_buffer()->GetI420(), cropX,
|
||||
cropY, cropWidth, cropHeight);
|
||||
buffer = i420Buffer;
|
||||
}
|
||||
rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer =
|
||||
aFrame.video_frame_buffer();
|
||||
|
||||
MOZ_ASSERT(!aFrame.color_space(), "Unexpected use of color space");
|
||||
MOZ_ASSERT(!aFrame.has_update_rect(), "Unexpected use of update rect");
|
||||
|
@ -1500,12 +1364,7 @@ MediaConduitErrorCode WebrtcVideoConduit::SendVideoFrame(
|
|||
timestampDelta / 1000.f, ssrcsCommaSeparated.get());
|
||||
}
|
||||
|
||||
mVideoBroadcaster.OnFrame(webrtc::VideoFrame::Builder()
|
||||
.set_video_frame_buffer(buffer)
|
||||
.set_timestamp_us(aFrame.timestamp_us())
|
||||
.set_timestamp_rtp(aFrame.timestamp())
|
||||
.set_rotation(aFrame.rotation())
|
||||
.build());
|
||||
mVideoBroadcaster.OnFrame(aFrame);
|
||||
|
||||
return kMediaConduitNoError;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "api/video_codecs/sdp_video_format.h"
|
||||
#include "call/call_basic_stats.h"
|
||||
#include "common_video/include/video_frame_buffer_pool.h"
|
||||
#include "media/base/video_adapter.h"
|
||||
#include "media/base/video_broadcaster.h"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
@ -93,13 +92,6 @@ class WebrtcVideoConduit
|
|||
void StopReceiving();
|
||||
void StartReceiving();
|
||||
|
||||
/**
|
||||
* Function to select and change the encoding resolution based on incoming
|
||||
* frame size and current available bandwidth.
|
||||
* @param width, height: dimensions of the frame
|
||||
*/
|
||||
void SelectSendResolution(unsigned short width, unsigned short height);
|
||||
|
||||
/**
|
||||
* Function to deliver a capture video frame for encoding and transport.
|
||||
* If the frame's timestamp is 0, it will be automatically generated.
|
||||
|
@ -167,6 +159,8 @@ class WebrtcVideoConduit
|
|||
void NotifyUnsetCurrentRemoteSSRC();
|
||||
void SetRemoteSSRCConfig(uint32_t aSsrc, uint32_t aRtxSsrc);
|
||||
void SetRemoteSSRCAndRestartAsNeeded(uint32_t aSsrc, uint32_t aRtxSsrc);
|
||||
rtc::RefCountedObject<mozilla::VideoStreamFactory>*
|
||||
CreateVideoStreamFactory();
|
||||
|
||||
public:
|
||||
// Creating a recv stream or a send stream requires a local ssrc to be
|
||||
|
@ -342,11 +336,6 @@ class WebrtcVideoConduit
|
|||
// handles CodecPluginID plumbing tied to this VideoConduit.
|
||||
const UniquePtr<WebrtcVideoEncoderFactory> mEncoderFactory;
|
||||
|
||||
// Adapter handling resolution constraints from signaling and sinks.
|
||||
// Written only on the Call thread. Guarded by mMutex, except for reads on the
|
||||
// Call thread.
|
||||
UniquePtr<cricket::VideoAdapter> mVideoAdapter;
|
||||
|
||||
// Our own record of the sinks added to mVideoBroadcaster so we can support
|
||||
// dispatching updates to sinks from off-Call-thread. Call thread only.
|
||||
AutoTArray<rtc::VideoSinkInterface<webrtc::VideoFrame>*, 1> mRegisteredSinks;
|
||||
|
@ -355,10 +344,6 @@ class WebrtcVideoConduit
|
|||
// Threadsafe.
|
||||
rtc::VideoBroadcaster mVideoBroadcaster;
|
||||
|
||||
// When true the send resolution needs to be updated next time we process a
|
||||
// video frame. Set on various threads.
|
||||
Atomic<bool> mUpdateSendResolution{false};
|
||||
|
||||
// Buffer pool used for scaling frames.
|
||||
// Accessed on the frame-feeding thread only.
|
||||
webrtc::VideoFrameBufferPool mBufferPool;
|
||||
|
@ -407,9 +392,6 @@ class WebrtcVideoConduit
|
|||
// Guarded by mMutex.
|
||||
Maybe<uint32_t> mLastRTPTimestampReceive;
|
||||
|
||||
// Accessed under mMutex.
|
||||
unsigned int mMaxFramerateForAllStreams;
|
||||
|
||||
// Accessed from any thread under mRendererMonitor.
|
||||
uint64_t mVideoLatencyAvg = 0;
|
||||
|
||||
|
|
|
@ -10,6 +10,22 @@
|
|||
#include "nsThreadUtils.h"
|
||||
#include "VideoConduit.h"
|
||||
|
||||
template <class t>
|
||||
void ConstrainPreservingAspectRatio(uint16_t aMaxWidth, uint16_t aMaxHeight,
|
||||
t* aWidth, t* aHeight) {
|
||||
if (((*aWidth) <= aMaxWidth) && ((*aHeight) <= aMaxHeight)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((*aWidth) * aMaxHeight > aMaxWidth * (*aHeight)) {
|
||||
(*aHeight) = aMaxWidth * (*aHeight) / (*aWidth);
|
||||
(*aWidth) = aMaxWidth;
|
||||
} else {
|
||||
(*aWidth) = aMaxHeight * (*aWidth) / (*aHeight);
|
||||
(*aHeight) = aMaxHeight;
|
||||
}
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
#ifdef LOGTAG
|
||||
|
@ -113,113 +129,71 @@ static void SelectBitrates(unsigned short width, unsigned short height, int min,
|
|||
MOZ_ASSERT(pref_cap == 0 || out_max <= pref_cap);
|
||||
}
|
||||
|
||||
void VideoStreamFactory::SetCodecMode(webrtc::VideoCodecMode aCodecMode) {
|
||||
mCodecMode = aCodecMode;
|
||||
}
|
||||
|
||||
void VideoStreamFactory::SetMaxFramerateForAllStreams(
|
||||
unsigned int aMaxFramerate) {
|
||||
mMaxFramerateForAllStreams = aMaxFramerate;
|
||||
}
|
||||
|
||||
std::vector<webrtc::VideoStream> VideoStreamFactory::CreateEncoderStreams(
|
||||
int width, int height, const webrtc::VideoEncoderConfig& config) {
|
||||
int aWidth, int aHeight, const webrtc::VideoEncoderConfig& aConfig) {
|
||||
// We only allow one layer when screensharing
|
||||
const size_t streamCount =
|
||||
mCodecMode == webrtc::VideoCodecMode::kScreensharing
|
||||
? 1
|
||||
: config.number_of_streams;
|
||||
: aConfig.number_of_streams;
|
||||
|
||||
MOZ_RELEASE_ASSERT(streamCount >= 1, "Should request at least one stream");
|
||||
|
||||
std::vector<webrtc::VideoStream> streams;
|
||||
streams.reserve(streamCount);
|
||||
|
||||
// Find the highest-resolution stream
|
||||
int highestResolutionIndex = 0;
|
||||
for (size_t i = 1; i < streamCount; ++i) {
|
||||
if (mCodecConfig.mEncodings[i].constraints.scaleDownBy <
|
||||
mCodecConfig.mEncodings[highestResolutionIndex]
|
||||
.constraints.scaleDownBy) {
|
||||
highestResolutionIndex = i;
|
||||
}
|
||||
{
|
||||
auto frameRateController = mFramerateController.Lock();
|
||||
frameRateController->Reset();
|
||||
}
|
||||
|
||||
// This ensures all simulcast layers will be of the same aspect ratio as the
|
||||
// input.
|
||||
mSimulcastAdapter->OnOutputFormatRequest(
|
||||
cricket::VideoFormat(width, height, 0, 0));
|
||||
|
||||
for (int idx = streamCount - 1; idx >= 0; --idx) {
|
||||
webrtc::VideoStream video_stream;
|
||||
auto& encoding = mCodecConfig.mEncodings[idx];
|
||||
MOZ_ASSERT(encoding.constraints.scaleDownBy >= 1.0);
|
||||
|
||||
// All streams' dimensions must retain the aspect ratio of the input stream.
|
||||
// Note that the first stream might already have been scaled by us.
|
||||
// Webrtc.org doesn't know this, so we have to adjust lower layers manually.
|
||||
int unusedCropWidth, unusedCropHeight, outWidth, outHeight;
|
||||
if (idx == highestResolutionIndex) {
|
||||
// This is the highest-resolution stream. We avoid calling
|
||||
// AdaptFrameResolution on this because precision errors in VideoAdapter
|
||||
// can cause the out-resolution to be an odd pixel smaller than the
|
||||
// source (1920x1419 has caused this). We shortcut this instead.
|
||||
outWidth = width;
|
||||
outHeight = height;
|
||||
} else {
|
||||
float effectiveScaleDownBy =
|
||||
encoding.constraints.scaleDownBy /
|
||||
mCodecConfig.mEncodings[highestResolutionIndex]
|
||||
.constraints.scaleDownBy;
|
||||
MOZ_ASSERT(effectiveScaleDownBy >= 1.0);
|
||||
mSimulcastAdapter->OnScaleResolutionBy(
|
||||
effectiveScaleDownBy > 1.0
|
||||
? absl::optional<float>(effectiveScaleDownBy)
|
||||
: absl::optional<float>());
|
||||
bool rv = mSimulcastAdapter->AdaptFrameResolution(
|
||||
width, height,
|
||||
0, // Ok, since we don't request an output format with an interval
|
||||
&unusedCropWidth, &unusedCropHeight, &outWidth, &outHeight);
|
||||
gfx::IntSize newSize(0, 0);
|
||||
|
||||
if (!rv) {
|
||||
// The only thing that can make AdaptFrameResolution fail in this case
|
||||
// is if this layer is scaled so far down that it has less than one
|
||||
// pixel.
|
||||
outWidth = 0;
|
||||
outHeight = 0;
|
||||
}
|
||||
if (aWidth && aHeight) {
|
||||
auto maxPixelCount = mLockScaling ? 0U : mWants.max_pixel_count;
|
||||
newSize = CalculateScaledResolution(
|
||||
aWidth, aHeight, encoding.constraints.scaleDownBy, maxPixelCount);
|
||||
}
|
||||
|
||||
if (outWidth == 0 || outHeight == 0) {
|
||||
if (newSize.width == 0 || newSize.height == 0) {
|
||||
CSFLogInfo(LOGTAG,
|
||||
"%s Stream with RID %s ignored because of no resolution.",
|
||||
__FUNCTION__, encoding.rid.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(outWidth > 0);
|
||||
MOZ_ASSERT(outHeight > 0);
|
||||
video_stream.width = outWidth;
|
||||
video_stream.height = outHeight;
|
||||
uint16_t max_width = mCodecConfig.mEncodingConstraints.maxWidth;
|
||||
uint16_t max_height = mCodecConfig.mEncodingConstraints.maxHeight;
|
||||
if (max_width || max_height) {
|
||||
max_width = max_width ? max_width : UINT16_MAX;
|
||||
max_height = max_height ? max_height : UINT16_MAX;
|
||||
ConstrainPreservingAspectRatio(max_width, max_height, &newSize.width,
|
||||
&newSize.height);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(newSize.width > 0);
|
||||
MOZ_ASSERT(newSize.height > 0);
|
||||
video_stream.width = newSize.width;
|
||||
video_stream.height = newSize.height;
|
||||
SelectMaxFramerateForAllStreams(newSize.width, newSize.height);
|
||||
|
||||
CSFLogInfo(LOGTAG, "%s Input frame %ux%u, RID %s scaling to %zux%zu",
|
||||
__FUNCTION__, width, height, encoding.rid.c_str(),
|
||||
__FUNCTION__, aWidth, aHeight, encoding.rid.c_str(),
|
||||
video_stream.width, video_stream.height);
|
||||
|
||||
if (video_stream.width * height != width * video_stream.height) {
|
||||
CSFLogInfo(LOGTAG,
|
||||
"%s Stream with RID %s ignored because of bad aspect ratio.",
|
||||
__FUNCTION__, encoding.rid.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
// mMaxFramerateForAllStreams is based on codec-wide stuff like fmtp, and
|
||||
// hard-coded limits based on the source resolution.
|
||||
// mCodecConfig.mEncodingConstraints.maxFps does not take the hard-coded
|
||||
// limits into account, so we have mMaxFramerateForAllStreams which
|
||||
// incorporates those. Per-encoding max framerate is based on parameters
|
||||
// from JS, and maybe rid
|
||||
unsigned int max_framerate = mMaxFramerateForAllStreams;
|
||||
unsigned int max_framerate = SelectFrameRate(
|
||||
mMaxFramerateForAllStreams, video_stream.width, video_stream.height);
|
||||
max_framerate = std::min(WebrtcVideoConduit::ToLibwebrtcMaxFramerate(
|
||||
encoding.constraints.maxFps),
|
||||
max_framerate);
|
||||
|
@ -237,7 +211,7 @@ std::vector<webrtc::VideoStream> VideoStreamFactory::CreateEncoderStreams(
|
|||
mStartBitrate, encoding.constraints.maxBr, mPrefMaxBitrate,
|
||||
mNegotiatedMaxBitrate, video_stream);
|
||||
|
||||
video_stream.bitrate_priority = config.bitrate_priority;
|
||||
video_stream.bitrate_priority = aConfig.bitrate_priority;
|
||||
video_stream.max_qp = kQpMax;
|
||||
|
||||
if (streamCount > 1) {
|
||||
|
@ -264,4 +238,119 @@ std::vector<webrtc::VideoStream> VideoStreamFactory::CreateEncoderStreams(
|
|||
return streams;
|
||||
}
|
||||
|
||||
gfx::IntSize VideoStreamFactory::CalculateScaledResolution(
|
||||
int aWidth, int aHeight, double aScaleDownByResolution,
|
||||
unsigned int aMaxPixelCount) {
|
||||
// If any adjustments like scaleResolutionDownBy or maxFS are being given
|
||||
// we want to choose a height and width here to provide for more variety
|
||||
// in possible resolutions.
|
||||
int width = aWidth;
|
||||
int height = aHeight;
|
||||
|
||||
if (aScaleDownByResolution > 1) {
|
||||
width = static_cast<int>(aWidth / aScaleDownByResolution);
|
||||
height = static_cast<int>(aHeight / aScaleDownByResolution);
|
||||
}
|
||||
|
||||
// Check if we still need to adjust resolution down more due to other
|
||||
// constraints.
|
||||
if (mCodecConfig.mEncodingConstraints.maxFs > 0 || aMaxPixelCount > 0) {
|
||||
auto currentFs = static_cast<unsigned int>(width * height);
|
||||
auto maxFs =
|
||||
(mCodecConfig.mEncodingConstraints.maxFs > 0 && aMaxPixelCount > 0)
|
||||
? std::min((mCodecConfig.mEncodingConstraints.maxFs * 16 * 16),
|
||||
aMaxPixelCount)
|
||||
: std::max((mCodecConfig.mEncodingConstraints.maxFs * 16 * 16),
|
||||
aMaxPixelCount);
|
||||
|
||||
// If our currentFs is greater than maxFs we calculate a width and height
|
||||
// that will get as close as possible to maxFs and try to maintain aspect
|
||||
// ratio.
|
||||
if (currentFs > maxFs) {
|
||||
if (aWidth > aHeight) { // Landscape
|
||||
auto aspectRatio = static_cast<double>(aWidth) / aHeight;
|
||||
|
||||
height = static_cast<int>(std::sqrt(maxFs / aspectRatio));
|
||||
width = static_cast<int>(height * aspectRatio);
|
||||
} else { // Portrait
|
||||
auto aspectRatio = static_cast<double>(aHeight) / aWidth;
|
||||
|
||||
width = static_cast<int>(std::sqrt(maxFs / aspectRatio));
|
||||
height = static_cast<int>(width * aspectRatio);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return gfx::IntSize(width, height);
|
||||
}
|
||||
|
||||
void VideoStreamFactory::SelectMaxFramerateForAllStreams(
|
||||
unsigned short aWidth, unsigned short aHeight) {
|
||||
int max_fs = std::numeric_limits<int>::max();
|
||||
if (!mLockScaling) {
|
||||
max_fs = mWants.max_pixel_count;
|
||||
}
|
||||
// Limit resolution to max-fs
|
||||
if (mCodecConfig.mEncodingConstraints.maxFs) {
|
||||
// max-fs is in macroblocks, convert to pixels
|
||||
max_fs = std::min(
|
||||
max_fs,
|
||||
static_cast<int>(mCodecConfig.mEncodingConstraints.maxFs * (16 * 16)));
|
||||
}
|
||||
|
||||
unsigned int framerate_all_streams =
|
||||
SelectFrameRate(mMaxFramerateForAllStreams, aWidth, aHeight);
|
||||
unsigned int maxFrameRate = mMaxFramerateForAllStreams;
|
||||
if (mMaxFramerateForAllStreams != framerate_all_streams) {
|
||||
CSFLogDebug(LOGTAG, "%s: framerate changing to %u (from %u)", __FUNCTION__,
|
||||
framerate_all_streams, maxFrameRate);
|
||||
mMaxFramerateForAllStreams = framerate_all_streams;
|
||||
}
|
||||
|
||||
int framerate_with_wants;
|
||||
if (framerate_all_streams > std::numeric_limits<int>::max()) {
|
||||
framerate_with_wants = std::numeric_limits<int>::max();
|
||||
} else {
|
||||
framerate_with_wants = static_cast<int>(framerate_all_streams);
|
||||
}
|
||||
|
||||
framerate_with_wants =
|
||||
std::min(framerate_with_wants, mWants.max_framerate_fps);
|
||||
CSFLogDebug(LOGTAG,
|
||||
"%s: Calling OnOutputFormatRequest, max_fs=%d, max_fps=%d",
|
||||
__FUNCTION__, max_fs, framerate_with_wants);
|
||||
auto frameRateController = mFramerateController.Lock();
|
||||
frameRateController->SetMaxFramerate(framerate_with_wants);
|
||||
}
|
||||
|
||||
unsigned int VideoStreamFactory::SelectFrameRate(
|
||||
unsigned int aOldFramerate, unsigned short aSendingWidth,
|
||||
unsigned short aSendingHeight) {
|
||||
unsigned int new_framerate = aOldFramerate;
|
||||
|
||||
// Limit frame rate based on max-mbps
|
||||
if (mCodecConfig.mEncodingConstraints.maxMbps) {
|
||||
unsigned int cur_fs, mb_width, mb_height;
|
||||
|
||||
mb_width = (aSendingWidth + 15) >> 4;
|
||||
mb_height = (aSendingHeight + 15) >> 4;
|
||||
|
||||
cur_fs = mb_width * mb_height;
|
||||
if (cur_fs > 0) { // in case no frames have been sent
|
||||
new_framerate = mCodecConfig.mEncodingConstraints.maxMbps / cur_fs;
|
||||
}
|
||||
}
|
||||
|
||||
new_framerate =
|
||||
std::min(new_framerate, WebrtcVideoConduit::ToLibwebrtcMaxFramerate(
|
||||
mCodecConfig.mEncodingConstraints.maxFps));
|
||||
return new_framerate;
|
||||
}
|
||||
|
||||
bool VideoStreamFactory::ShouldDropFrame(int64_t aTimestamp) {
|
||||
auto frameRateController = mFramerateController.Lock();
|
||||
return frameRateController->ShouldDropFrame(
|
||||
(aTimestamp * rtc::kNumNanosecsPerMicrosec));
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -9,9 +9,13 @@
|
|||
|
||||
#include "CodecConfig.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/DataMutex.h"
|
||||
#include "mozilla/gfx/Point.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "api/video/video_source_interface.h"
|
||||
#include "api/video_codecs/video_encoder_config.h"
|
||||
#include "media/base/video_adapter.h"
|
||||
#include "common_video/framerate_controller.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -34,25 +38,68 @@ class VideoStreamFactory
|
|||
VideoStreamFactory(VideoCodecConfig aConfig,
|
||||
webrtc::VideoCodecMode aCodecMode, int aMinBitrate,
|
||||
int aStartBitrate, int aPrefMaxBitrate,
|
||||
int aNegotiatedMaxBitrate, unsigned int aMaxFramerate)
|
||||
int aNegotiatedMaxBitrate,
|
||||
const rtc::VideoSinkWants& aWants, bool aLockScaling)
|
||||
: mCodecMode(aCodecMode),
|
||||
mMaxFramerateForAllStreams(aMaxFramerate),
|
||||
mMaxFramerateForAllStreams(std::numeric_limits<unsigned int>::max()),
|
||||
mCodecConfig(std::forward<VideoCodecConfig>(aConfig)),
|
||||
mMinBitrate(aMinBitrate),
|
||||
mStartBitrate(aStartBitrate),
|
||||
mPrefMaxBitrate(aPrefMaxBitrate),
|
||||
mNegotiatedMaxBitrate(aNegotiatedMaxBitrate),
|
||||
mSimulcastAdapter(MakeUnique<cricket::VideoAdapter>()) {}
|
||||
|
||||
void SetCodecMode(webrtc::VideoCodecMode aCodecMode);
|
||||
void SetMaxFramerateForAllStreams(unsigned int aMaxFramerate);
|
||||
mFramerateController("VideoStreamFactory::mFramerateController"),
|
||||
mWants(aWants),
|
||||
mLockScaling(aLockScaling) {}
|
||||
|
||||
// This gets called off-main thread and may hold internal webrtc.org
|
||||
// locks. May *NOT* lock the conduit's mutex, to avoid deadlocks.
|
||||
std::vector<webrtc::VideoStream> CreateEncoderStreams(
|
||||
int width, int height, const webrtc::VideoEncoderConfig& config) override;
|
||||
int aWidth, int aHeight,
|
||||
const webrtc::VideoEncoderConfig& aConfig) override;
|
||||
/**
|
||||
* Function to select and change the encoding resolution based on incoming
|
||||
* frame size and current available bandwidth.
|
||||
* @param width, height: dimensions of the frame
|
||||
*/
|
||||
void SelectMaxFramerateForAllStreams(unsigned short aWidth,
|
||||
unsigned short aHeight);
|
||||
|
||||
/**
|
||||
* Function to determine if the frame should be dropped to achieve a lower
|
||||
* framerate based on the given timestamp.
|
||||
* @param aTimestamp timestamp of frame to be evaluated.
|
||||
* @return true if frame should be dropped to achieve a specific framerate,
|
||||
* false otehrwise.
|
||||
*/
|
||||
bool ShouldDropFrame(int64_t aTimestamp);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Function to calculate a scaled down width and height based on
|
||||
* scaleDownByResolution, maxFS, and max pixel count settings.
|
||||
* @param aWidth current frame width
|
||||
* @param aHeight current frame height
|
||||
* @param aScaleDownByResolution value to scale width and height down by.
|
||||
* @param aMaxPixelCount maximum number of pixels wanted in a frame.
|
||||
* @return a gfx:IntSize containing width and height to use. These may match
|
||||
* the aWidth and aHeight passed in if no scaling was needed.
|
||||
*/
|
||||
gfx::IntSize CalculateScaledResolution(int aWidth, int aHeight,
|
||||
double aScaleDownByResolution,
|
||||
unsigned int aMaxPixelCount);
|
||||
|
||||
/**
|
||||
* Function to select and change the encoding frame rate based on incoming
|
||||
* frame rate, current frame size and max-mbps setting.
|
||||
* @param aOldFramerate current framerate
|
||||
* @param aSendingWidth width of frames being sent
|
||||
* @param aSendingHeight height of frames being sent
|
||||
* @return new framerate meeting max-mbps requriements based on frame size
|
||||
*/
|
||||
unsigned int SelectFrameRate(unsigned int aOldFramerate,
|
||||
unsigned short aSendingWidth,
|
||||
unsigned short aSendingHeight);
|
||||
|
||||
// Used to limit number of streams for screensharing.
|
||||
Atomic<webrtc::VideoCodecMode> mCodecMode;
|
||||
|
||||
|
@ -68,10 +115,12 @@ class VideoStreamFactory
|
|||
const int mPrefMaxBitrate = 0;
|
||||
const int mNegotiatedMaxBitrate = 0;
|
||||
|
||||
// Adapter for simulcast layers. We use this to handle scaleResolutionDownBy
|
||||
// for layers. It's separate from the conduit's mVideoAdapter to not affect
|
||||
// scaling settings for incoming frames.
|
||||
UniquePtr<cricket::VideoAdapter> mSimulcastAdapter;
|
||||
// DatamMutex used as object is mutated from a libwebrtc thread and
|
||||
// a seperate thread used to pass video frames to libwebrtc.
|
||||
DataMutex<webrtc::FramerateController> mFramerateController;
|
||||
|
||||
const rtc::VideoSinkWants mWants;
|
||||
const bool mLockScaling;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -76,8 +76,8 @@
|
|||
if (v2.videoWidth == 0 && v2.videoHeight == 0) {
|
||||
info("Skipping test, insufficient time for video to start.");
|
||||
} else {
|
||||
is(v2.videoWidth, 160, "sink width should be 160 for " + codec);
|
||||
is(v2.videoHeight, 120, "sink height should be 120 for " + codec);
|
||||
is(v2.videoWidth, 184, "sink width should be 184 for " + codec);
|
||||
is(v2.videoHeight, 138, "sink height should be 138 for " + codec);
|
||||
}})
|
||||
.then(() => {
|
||||
stream.getTracks().forEach(track => track.stop());
|
||||
|
|
|
@ -12,7 +12,7 @@ createHTML({
|
|||
});
|
||||
|
||||
let sender, localElem, remoteElem;
|
||||
let originalWidth, originalAspectRatio, originalScale;
|
||||
let originalWidth, originalHeight;
|
||||
|
||||
async function checkScaleDownBy(scale) {
|
||||
sender.setParameters({ encodings: [{ scaleResolutionDownBy: scale }] });
|
||||
|
@ -21,12 +21,11 @@ async function checkScaleDownBy(scale) {
|
|||
// Find the expected resolution. Internally we pick the closest lower
|
||||
// resolution with an identical aspect ratio.
|
||||
let expectedWidth = Math.floor(originalWidth / scale);
|
||||
while (expectedWidth / originalAspectRatio % 1 != 0) {
|
||||
--expectedWidth;
|
||||
}
|
||||
let expectedHeight = Math.floor(originalHeight / scale);
|
||||
|
||||
is(remoteElem.videoWidth, expectedWidth,
|
||||
`Width should have scaled down by ${scale}`);
|
||||
is(remoteElem.videoHeight, expectedWidth / originalAspectRatio,
|
||||
is(remoteElem.videoHeight, expectedHeight,
|
||||
`Height should have scaled down by ${scale}`);
|
||||
}
|
||||
|
||||
|
@ -57,8 +56,7 @@ runNetworkTest(async function (options) {
|
|||
info(`Video resized to ${remoteElem.videoWidth}x${remoteElem.videoHeight}`));
|
||||
|
||||
originalWidth = localElem.videoWidth;
|
||||
originalAspectRatio = originalWidth / localElem.videoHeight;
|
||||
originalScale = remoteElem.videoWidth / originalWidth;
|
||||
originalHeight = localElem.videoHeight;
|
||||
info(`Original width is ${originalWidth}`);
|
||||
},
|
||||
function PC_LOCAL_SCALEDOWNBY_2() {
|
||||
|
|
|
@ -89,13 +89,13 @@
|
|||
info('Waiting for second video element to start playing');
|
||||
await helper.checkVideoPlaying(videoElems[1]);
|
||||
|
||||
is(videoElems[0].videoWidth, 48,
|
||||
is(videoElems[0].videoWidth, 50,
|
||||
"sink is same width as source, modulo our cropping algorithm");
|
||||
is(videoElems[0].videoHeight, 48,
|
||||
is(videoElems[0].videoHeight, 50,
|
||||
"sink is same height as source, modulo our cropping algorithm");
|
||||
is(videoElems[1].videoWidth, 24,
|
||||
is(videoElems[1].videoWidth, 25,
|
||||
"sink is 1/2 width of source, modulo our cropping algorithm");
|
||||
is(videoElems[1].videoHeight, 24,
|
||||
is(videoElems[1].videoHeight, 25,
|
||||
"sink is 1/2 height of source, modulo our cropping algorithm");
|
||||
|
||||
await statsReady;
|
||||
|
|
|
@ -89,13 +89,13 @@
|
|||
info('Waiting for second video element to start playing');
|
||||
await helper.checkVideoPlaying(videoElems[1]);
|
||||
|
||||
is(videoElems[1].videoWidth, 48,
|
||||
is(videoElems[1].videoWidth, 50,
|
||||
"sink is same width as source, modulo our cropping algorithm");
|
||||
is(videoElems[1].videoHeight, 48,
|
||||
is(videoElems[1].videoHeight, 50,
|
||||
"sink is same height as source, modulo our cropping algorithm");
|
||||
is(videoElems[0].videoWidth, 24,
|
||||
is(videoElems[0].videoWidth, 25,
|
||||
"sink is 1/2 width of source, modulo our cropping algorithm");
|
||||
is(videoElems[0].videoHeight, 24,
|
||||
is(videoElems[0].videoHeight, 25,
|
||||
"sink is 1/2 height of source, modulo our cropping algorithm");
|
||||
|
||||
await statsReady;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!DOCTYPE HTML>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<script type="application/javascript" src="pc.js"></script>
|
||||
|
@ -86,13 +86,13 @@
|
|||
info('Waiting for second video element to start playing');
|
||||
await helper.checkVideoPlaying(videoElems[1]);
|
||||
|
||||
is(videoElems[0].videoWidth, 48,
|
||||
is(videoElems[0].videoWidth, 50,
|
||||
"sink is same width as source, modulo our cropping algorithm");
|
||||
is(videoElems[0].videoHeight, 48,
|
||||
is(videoElems[0].videoHeight, 50,
|
||||
"sink is same height as source, modulo our cropping algorithm");
|
||||
is(videoElems[1].videoWidth, 24,
|
||||
is(videoElems[1].videoWidth, 25,
|
||||
"sink is 1/2 width of source, modulo our cropping algorithm");
|
||||
is(videoElems[1].videoHeight, 24,
|
||||
is(videoElems[1].videoHeight, 25,
|
||||
"sink is 1/2 height of source, modulo our cropping algorithm");
|
||||
|
||||
await statsReady;
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче