From a90a5cba08fdf6c0ceb95101c275108a152a3aed Mon Sep 17 00:00:00 2001
From: Daniel Baumann
Date: Wed, 12 Jun 2024 07:35:37 +0200
Subject: Merging upstream version 127.0.
Signed-off-by: Daniel Baumann
---
toolkit/content/aboutLogging.js | 2 +-
toolkit/content/aboutNetError.mjs | 3 +-
toolkit/content/aboutTelemetry.js | 6 +
toolkit/content/customElements.js | 62 +++---
toolkit/content/jar.mn | 2 -
toolkit/content/license.html | 5 +-
toolkit/content/preferencesBindings.js | 5 +
.../content/tests/browser/browser_bug1693577.js | 4 +-
toolkit/content/tests/chrome/chrome.toml | 1 -
.../tests/chrome/file_editor_with_autocomplete.js | 4 +
...est_autocomplete_with_composition_on_input.html | 2 -
.../test_editor_for_input_with_autocomplete.html | 2 -
.../content/tests/chrome/window_largemenu.xhtml | 15 +-
toolkit/content/tests/widgets/mochitest.toml | 2 +
toolkit/content/tests/widgets/test_moz_button.html | 132 +++++++++++--
.../tests/widgets/test_moz_button_group.html | 144 +++++++++-----
.../tests/widgets/test_moz_message_bar.html | 28 +--
.../content/tests/widgets/test_moz_page_nav.html | 61 ++++++
.../widgets/test_videocontrols_src_change.html | 56 ++++++
.../widgets/test_videocontrols_video_noaudio.html | 2 +-
toolkit/content/widgets.css | 2 +-
toolkit/content/widgets/arrowscrollbox.js | 4 +-
.../content/widgets/autocomplete-richlistitem.js | 4 +-
toolkit/content/widgets/datetimebox.js | 28 +--
toolkit/content/widgets/message-bar.css | 219 ---------------------
toolkit/content/widgets/message-bar.js | 91 ---------
.../widgets/moz-button-group/moz-button-group.css | 3 +-
.../widgets/moz-button-group/moz-button-group.mjs | 25 ++-
toolkit/content/widgets/moz-button/moz-button.css | 26 ++-
toolkit/content/widgets/moz-button/moz-button.mjs | 21 +-
.../widgets/moz-button/moz-button.stories.mjs | 29 +--
.../widgets/moz-message-bar/moz-message-bar.mjs | 12 +-
.../content/widgets/moz-page-nav/README.stories.md | 46 ++++-
.../widgets/moz-page-nav/moz-page-nav-button.css | 23 ++-
.../content/widgets/moz-page-nav/moz-page-nav.mjs | 86 +++++++-
.../widgets/moz-page-nav/moz-page-nav.stories.mjs | 32 ++-
.../widgets/moz-support-link/moz-support-link.mjs | 6 +-
toolkit/content/widgets/notificationbox.js | 3 +-
toolkit/content/widgets/panel-list/panel-list.js | 4 -
toolkit/content/widgets/popupnotification.js | 2 -
toolkit/content/widgets/videocontrols.js | 17 +-
toolkit/content/xul.css | 14 --
42 files changed, 683 insertions(+), 552 deletions(-)
create mode 100644 toolkit/content/tests/widgets/test_videocontrols_src_change.html
delete mode 100644 toolkit/content/widgets/message-bar.css
delete mode 100644 toolkit/content/widgets/message-bar.js
(limited to 'toolkit/content')
diff --git a/toolkit/content/aboutLogging.js b/toolkit/content/aboutLogging.js
index 360ab366e1..f2f4cabc62 100644
--- a/toolkit/content/aboutLogging.js
+++ b/toolkit/content/aboutLogging.js
@@ -114,7 +114,7 @@ const gLoggingPresets = {
},
"media-playback": {
modules:
- "HTMLMediaElement:4,HTMLMediaElementEvents:4,cubeb:5,PlatformDecoderModule:5,AudioSink:5,AudioSinkWrapper:5,MediaDecoderStateMachine:4,MediaDecoder:4,MediaFormatReader:5,GMP:5",
+ "HTMLMediaElement:4,HTMLMediaElementEvents:4,cubeb:5,PlatformDecoderModule:5,AudioSink:5,AudioSinkWrapper:5,MediaDecoderStateMachine:4,MediaDecoder:4,MediaFormatReader:5,GMP:5,EME:5",
l10nIds: {
label: "about-logging-preset-media-playback-label",
description: "about-logging-preset-media-playback-description",
diff --git a/toolkit/content/aboutNetError.mjs b/toolkit/content/aboutNetError.mjs
index 1c733d5dbb..935111dcca 100644
--- a/toolkit/content/aboutNetError.mjs
+++ b/toolkit/content/aboutNetError.mjs
@@ -396,7 +396,8 @@ function initPage() {
});
longDesc = null;
- document.getElementById("openInNewWindowContainer").hidden = false;
+ document.getElementById("openInNewWindowContainer").hidden =
+ RPMGetBoolPref("security.xfocsp.hideOpenInNewWindow");
const openInNewWindowButton = document.getElementById(
"openInNewWindowButton"
diff --git a/toolkit/content/aboutTelemetry.js b/toolkit/content/aboutTelemetry.js
index 45a8488820..9cf3c3320d 100644
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -352,6 +352,12 @@ var PingPicker = {
},
_updateCurrentPingData() {
+ TelemetryController.ensureInitialized().then(() =>
+ this._doUpdateCurrentPingData()
+ );
+ },
+
+ _doUpdateCurrentPingData() {
const subsession = document.getElementById("show-subsession-data").checked;
let ping = TelemetryController.getCurrentPingData(subsession);
if (!ping) {
diff --git a/toolkit/content/customElements.js b/toolkit/content/customElements.js
index ef58963a02..132b069326 100644
--- a/toolkit/content/customElements.js
+++ b/toolkit/content/customElements.js
@@ -791,7 +791,6 @@
["button-group", "chrome://global/content/elements/named-deck.js"],
["findbar", "chrome://global/content/elements/findbar.js"],
["menulist", "chrome://global/content/elements/menulist.js"],
- ["message-bar", "chrome://global/content/elements/message-bar.js"],
["named-deck", "chrome://global/content/elements/named-deck.js"],
["named-deck-button", "chrome://global/content/elements/named-deck.js"],
["panel-list", "chrome://global/content/elements/panel-list.js"],
@@ -806,49 +805,32 @@
"chrome://global/content/elements/autocomplete-input.js",
],
["editor", "chrome://global/content/elements/editor.js"],
+ ["moz-button", "chrome://global/content/elements/moz-button.mjs"],
+ [
+ "moz-button-group",
+ "chrome://global/content/elements/moz-button-group.mjs",
+ ],
+ ["moz-card", "chrome://global/content/elements/moz-card.mjs"],
+ ["moz-five-star", "chrome://global/content/elements/moz-five-star.mjs"],
+ [
+ "moz-message-bar",
+ "chrome://global/content/elements/moz-message-bar.mjs",
+ ],
+ ["moz-page-nav", "chrome://global/content/elements/moz-page-nav.mjs"],
+ [
+ "moz-support-link",
+ "chrome://global/content/elements/moz-support-link.mjs",
+ ],
+ ["moz-toggle", "chrome://global/content/elements/moz-toggle.mjs"],
]) {
customElements.setElementCreationCallback(tag, () => {
- Services.scriptloader.loadSubScript(script, window);
+ if (script.endsWith(".mjs")) {
+ ChromeUtils.importESModule(script, { global: "current" });
+ } else {
+ Services.scriptloader.loadSubScript(script, window);
+ }
});
}
- // Bug 1813077: This is a workaround until Bug 1803810 lands
- // which will give us the ability to load ESMs synchronously
- // like the previous Services.scriptloader.loadSubscript() function
- function importCustomElementFromESModule(name) {
- switch (name) {
- case "moz-button":
- return import("chrome://global/content/elements/moz-button.mjs");
- case "moz-button-group":
- return import(
- "chrome://global/content/elements/moz-button-group.mjs"
- );
- case "moz-message-bar":
- return import("chrome://global/content/elements/moz-message-bar.mjs");
- case "moz-support-link":
- return import(
- "chrome://global/content/elements/moz-support-link.mjs"
- );
- case "moz-toggle":
- return import("chrome://global/content/elements/moz-toggle.mjs");
- case "moz-card":
- return import("chrome://global/content/elements/moz-card.mjs");
- }
- throw new Error(`Unknown custom element name (${name})`);
- }
-
- /*
- This function explicitly returns null so that there is no confusion
- about which custom elements from ES Modules have been loaded.
- */
- window.ensureCustomElements = function (...elementNames) {
- return Promise.all(
- elementNames
- .filter(name => !customElements.get(name))
- .map(name => importCustomElementFromESModule(name))
- )
- .then(() => null)
- .catch(console.error);
- };
// Immediately load the following elements
for (let script of [
diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
index d08037a84a..e555936a73 100644
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -87,8 +87,6 @@ toolkit.jar:
content/global/elements/findbar.js (widgets/findbar.js)
content/global/elements/editor.js (widgets/editor.js)
content/global/elements/general.js (widgets/general.js)
- content/global/elements/message-bar.css (widgets/message-bar.css)
- content/global/elements/message-bar.js (widgets/message-bar.js)
content/global/elements/menu.js (widgets/menu.js)
content/global/elements/menupopup.js (widgets/menupopup.js)
content/global/elements/moz-button.css (widgets/moz-button/moz-button.css)
diff --git a/toolkit/content/license.html b/toolkit/content/license.html
index fe489f74d1..3f05da0118 100644
--- a/toolkit/content/license.html
+++ b/toolkit/content/license.html
@@ -1495,6 +1495,9 @@ licences.
third_party/cups/include
#ifdef MOZ_JXL
third_party/highway/
+#endif
+#ifdef MOZ_PERFETTO
+ third_party/perfetto/
#endif
@@ -3600,7 +3603,6 @@ SOFTWARE.
devtools/shared/natural-sort.js
devtools/shared/node-properties/node-properties.js
third_party/rust/ordered-float
- third_party/rust/owning_ref
third_party/rust/phf
,
third_party/rust/phf_codegen
,
third_party/rust/phf_generator
, and
@@ -3625,6 +3627,7 @@ SOFTWARE.
third_party/rust/synstructure
third_party/rust/void
js/src/zydis
(unless otherwise specified)
+ js/src/vm/Float16.h
(the code contained in the half namespace)
See the individual LICENSE files or headers for copyright owners.
diff --git a/toolkit/content/preferencesBindings.js b/toolkit/content/preferencesBindings.js
index b2e4070cf5..3dba0bed1e 100644
--- a/toolkit/content/preferencesBindings.js
+++ b/toolkit/content/preferencesBindings.js
@@ -381,6 +381,11 @@ const Preferences = (window.Preferences = (function () {
if (this.locked) {
aElement.disabled = true;
}
+ if (aElement.labels?.length) {
+ for (let label of aElement.labels) {
+ label.toggleAttribute("disabled", this.locked);
+ }
+ }
if (!this.isElementEditable(aElement)) {
return;
diff --git a/toolkit/content/tests/browser/browser_bug1693577.js b/toolkit/content/tests/browser/browser_bug1693577.js
index 712749dc89..b85b9f13de 100644
--- a/toolkit/content/tests/browser/browser_bug1693577.js
+++ b/toolkit/content/tests/browser/browser_bug1693577.js
@@ -12,7 +12,7 @@ add_task(async function test_search_input_popupshowing() {
let sidebar = document.getElementById("sidebar");
let loadPromise = BrowserTestUtils.waitForEvent(sidebar, "load", true);
- SidebarUI.toggle("viewBookmarksSidebar");
+ SidebarController.toggle("viewBookmarksSidebar");
await loadPromise;
let inputField =
@@ -45,5 +45,5 @@ add_task(async function test_search_input_popupshowing() {
popup.hidePopup();
await popuphidden;
- SidebarUI.toggle("viewBookmarksSidebar");
+ SidebarController.toggle("viewBookmarksSidebar");
});
diff --git a/toolkit/content/tests/chrome/chrome.toml b/toolkit/content/tests/chrome/chrome.toml
index 986822ac48..e037f45ecf 100644
--- a/toolkit/content/tests/chrome/chrome.toml
+++ b/toolkit/content/tests/chrome/chrome.toml
@@ -51,7 +51,6 @@ support-files = [
]
prefs = [
"gfx.font_rendering.fallback.async=false",
- "widget.non-native-theme.enabled=false",
]
["test_about_networking.html"]
diff --git a/toolkit/content/tests/chrome/file_editor_with_autocomplete.js b/toolkit/content/tests/chrome/file_editor_with_autocomplete.js
index acf2c9e9df..0068440785 100644
--- a/toolkit/content/tests/chrome/file_editor_with_autocomplete.js
+++ b/toolkit/content/tests/chrome/file_editor_with_autocomplete.js
@@ -84,6 +84,10 @@ nsDoTestsForEditorWithAutoComplete.prototype = {
Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH
);
});
+ if (test.popup) {
+ await waitForCondition(() => this._controller.input.popupOpen);
+ }
+
this._target.removeEventListener("beforeinput", onBeforeInput);
this._target.removeEventListener("input", onInput);
this._checkResult(test, beforeInputEvents, inputEvents);
diff --git a/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html b/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html
index fbcd44e830..fd484a93d1 100644
--- a/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html
+++ b/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html
@@ -27,7 +27,6 @@ function runTests() {
.QueryInterface(Ci.nsIAutoCompleteInput);
var originalFormFillTimeout = formFillController.timeout;
- SpecialPowers.attachFormFillControllerTo(window);
var target = document.getElementById("input");
// Register a word to the form history.
@@ -53,7 +52,6 @@ function runTests() {
function() { return target.value; },
function() {
formFillController.timeout = originalFormFillTimeout;
- SpecialPowers.detachFormFillControllerFrom(window);
SimpleTest.finish();
});
});
diff --git a/toolkit/content/tests/chrome/test_editor_for_input_with_autocomplete.html b/toolkit/content/tests/chrome/test_editor_for_input_with_autocomplete.html
index 91f0f159b4..f2786d47be 100644
--- a/toolkit/content/tests/chrome/test_editor_for_input_with_autocomplete.html
+++ b/toolkit/content/tests/chrome/test_editor_for_input_with_autocomplete.html
@@ -51,7 +51,6 @@ async function runTests() {
.QueryInterface(Ci.nsIAutoCompleteInput);
var originalFormFillTimeout = formFillController.timeout;
- SpecialPowers.attachFormFillControllerTo(window);
var target = document.getElementById("input");
// Register a word to the form history.
@@ -71,7 +70,6 @@ async function runTests() {
await tests2.run();
formFillController.timeout = originalFormFillTimeout;
- SpecialPowers.detachFormFillControllerFrom(window);
SimpleTest.finish();
}
diff --git a/toolkit/content/tests/chrome/window_largemenu.xhtml b/toolkit/content/tests/chrome/window_largemenu.xhtml
index 8e6b6718b4..413ab248bc 100644
--- a/toolkit/content/tests/chrome/window_largemenu.xhtml
+++ b/toolkit/content/tests/chrome/window_largemenu.xhtml
@@ -336,14 +336,18 @@ function testPopupMovement()
var marginTop = parseFloat(getComputedStyle(popup).marginTop);
var panelIsTop = SpecialPowers.getBoolPref("ui.panel.default_level_parent");
- var overlapOSChrome = !platformIsMac() && (!isPanelTest || panelIsTop);
+ var overlapOSChrome = canOverlapOSChrome() && (!isPanelTest || panelIsTop);
popup.moveTo(1, 1);
[screenX, screenY] = getScreenXY(popup);
var expectedx = 1, expectedy = 1;
if (!overlapOSChrome) {
- if (screen.availLeft >= 1) expectedx = screen.availLeft;
- if (screen.availTop >= 1) expectedy = screen.availTop;
+ if (screen.availLeft >= 1) {
+ expectedx = screen.availLeft + marginLeft;
+ }
+ if (screen.availTop >= 1) {
+ expectedy = screen.availTop + marginTop;
+ }
}
is(screenX, expectedx, gTests[gTestIndex] + " (1, 1) x");
is(screenY, expectedy, gTests[gTestIndex] + " (1, 1) y");
@@ -398,6 +402,11 @@ function platformIsMac()
return navigator.platform.indexOf("Mac") > -1;
}
+function canOverlapOSChrome()
+{
+ return navigator.platform.startsWith("Win");
+}
+
window.arguments[0].SimpleTest.waitForFocus(runTests, window);
]]>
diff --git a/toolkit/content/tests/widgets/mochitest.toml b/toolkit/content/tests/widgets/mochitest.toml
index efd86f1208..f5bc0505bf 100644
--- a/toolkit/content/tests/widgets/mochitest.toml
+++ b/toolkit/content/tests/widgets/mochitest.toml
@@ -96,6 +96,8 @@ skip-if = [
["test_videocontrols_size.html"]
+["test_videocontrols_src_change.html"]
+
["test_videocontrols_standalone.html"]
skip-if = [
"os == 'linux'", # bug 1804621
diff --git a/toolkit/content/tests/widgets/test_moz_button.html b/toolkit/content/tests/widgets/test_moz_button.html
index a849ccc956..0e64f939dc 100644
--- a/toolkit/content/tests/widgets/test_moz_button.html
+++ b/toolkit/content/tests/widgets/test_moz_button.html
@@ -17,6 +17,33 @@
}
- Test button
-
- Test button
-
-
-
+
+
+
+ Test button
+
+ Test button
+
+
+
+
+
+
+
+
+
+