summaryrefslogtreecommitdiffstats
path: root/toolkit/actors
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
commitda4c7e7ed675c3bf405668739c3012d140856109 (patch)
treecdd868dba063fecba609a1d819de271f0d51b23e /toolkit/actors
parentAdding upstream version 125.0.3. (diff)
downloadfirefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz
firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/actors')
-rw-r--r--toolkit/actors/AutoCompleteChild.sys.mjs22
-rw-r--r--toolkit/actors/AutoCompleteParent.sys.mjs39
-rw-r--r--toolkit/actors/AutoplayChild.sys.mjs2
-rw-r--r--toolkit/actors/AutoplayParent.sys.mjs2
-rw-r--r--toolkit/actors/ControllersParent.sys.mjs2
-rw-r--r--toolkit/actors/NetErrorParent.sys.mjs4
-rw-r--r--toolkit/actors/PictureInPictureChild.sys.mjs18
-rw-r--r--toolkit/actors/PrintingChild.sys.mjs2
-rw-r--r--toolkit/actors/SelectChild.sys.mjs2
-rw-r--r--toolkit/actors/SelectParent.sys.mjs5
-rw-r--r--toolkit/actors/UserCharacteristicsChild.sys.mjs28
-rw-r--r--toolkit/actors/UserCharacteristicsParent.sys.mjs34
-rw-r--r--toolkit/actors/ViewSourcePageChild.sys.mjs2
-rw-r--r--toolkit/actors/moz.build2
14 files changed, 110 insertions, 54 deletions
diff --git a/toolkit/actors/AutoCompleteChild.sys.mjs b/toolkit/actors/AutoCompleteChild.sys.mjs
index 4cd9b9f3de..3694e497d5 100644
--- a/toolkit/actors/AutoCompleteChild.sys.mjs
+++ b/toolkit/actors/AutoCompleteChild.sys.mjs
@@ -33,7 +33,7 @@ export class AutoCompleteChild extends JSWindowActorChild {
receiveMessage(message) {
switch (message.name) {
- case "FormAutoComplete:HandleEnter": {
+ case "AutoComplete:HandleEnter": {
this.selectedIndex = message.data.selectedIndex;
let controller = Cc[
@@ -43,22 +43,22 @@ export class AutoCompleteChild extends JSWindowActorChild {
break;
}
- case "FormAutoComplete:PopupClosed": {
+ case "AutoComplete:PopupClosed": {
this._popupOpen = false;
this.notifyListeners(message.name, message.data);
break;
}
- case "FormAutoComplete:PopupOpened": {
+ case "AutoComplete:PopupOpened": {
this._popupOpen = true;
this.notifyListeners(message.name, message.data);
break;
}
- case "FormAutoComplete:Focus": {
+ case "AutoComplete:Focus": {
// XXX See bug 1582722
// Before bug 1573836, the messages here didn't match
- // ("FormAutoComplete:Focus" versus "FormAutoComplete:RequestFocus")
+ // ("AutoComplete:Focus" versus "AutoComplete:RequestFocus")
// so this was never called. However this._input is actually a
// nsIAutoCompleteInput, which doesn't have a focus() method, so it
// wouldn't have worked anyway. So for now, I have just disabled this.
@@ -87,7 +87,7 @@ export class AutoCompleteChild extends JSWindowActorChild {
}
set selectedIndex(index) {
- this.sendAsyncMessage("FormAutoComplete:SetSelectedIndex", { index });
+ this.sendAsyncMessage("AutoComplete:SetSelectedIndex", { index });
}
get selectedIndex() {
@@ -98,7 +98,7 @@ export class AutoCompleteChild extends JSWindowActorChild {
// selectedIndex is trivial to catch (e.g. moving the mouse over the
// list).
let selectedIndexResult = Services.cpmm.sendSyncMessage(
- "FormAutoComplete:GetSelectedIndex",
+ "AutoComplete:GetSelectedIndex",
{
browsingContext: this.browsingContext,
}
@@ -131,7 +131,7 @@ export class AutoCompleteChild extends JSWindowActorChild {
);
let inputElementIdentifier = lazy.ContentDOMReference.get(element);
- this.sendAsyncMessage("FormAutoComplete:MaybeOpenPopup", {
+ this.sendAsyncMessage("AutoComplete:MaybeOpenPopup", {
results,
rect,
dir,
@@ -148,18 +148,18 @@ export class AutoCompleteChild extends JSWindowActorChild {
// up in a state where the content thinks that a popup
// is open when it isn't (or soon won't be).
this._popupOpen = false;
- this.sendAsyncMessage("FormAutoComplete:ClosePopup", {});
+ this.sendAsyncMessage("AutoComplete:ClosePopup", {});
}
invalidate() {
if (this._popupOpen) {
let results = this.getResultsFromController(this._input);
- this.sendAsyncMessage("FormAutoComplete:Invalidate", { results });
+ this.sendAsyncMessage("AutoComplete:Invalidate", { results });
}
}
selectBy(reverse, page) {
- Services.cpmm.sendSyncMessage("FormAutoComplete:SelectBy", {
+ Services.cpmm.sendSyncMessage("AutoComplete:SelectBy", {
browsingContext: this.browsingContext,
reverse,
page,
diff --git a/toolkit/actors/AutoCompleteParent.sys.mjs b/toolkit/actors/AutoCompleteParent.sys.mjs
index 611677a84f..70cbcea44d 100644
--- a/toolkit/actors/AutoCompleteParent.sys.mjs
+++ b/toolkit/actors/AutoCompleteParent.sys.mjs
@@ -41,21 +41,18 @@ function compareContext(message) {
// The browsingContext within the message data is either the one that has
// the active autocomplete popup or the top-level of the one that has
// the active autocomplete popup.
-Services.ppmm.addMessageListener(
- "FormAutoComplete:GetSelectedIndex",
- message => {
- if (compareContext(message)) {
- let actor = currentActor;
- if (actor && actor.openedPopup) {
- return actor.openedPopup.selectedIndex;
- }
+Services.ppmm.addMessageListener("AutoComplete:GetSelectedIndex", message => {
+ if (compareContext(message)) {
+ let actor = currentActor;
+ if (actor && actor.openedPopup) {
+ return actor.openedPopup.selectedIndex;
}
-
- return -1;
}
-);
-Services.ppmm.addMessageListener("FormAutoComplete:SelectBy", message => {
+ return -1;
+});
+
+Services.ppmm.addMessageListener("AutoComplete:SelectBy", message => {
if (compareContext(message)) {
let actor = currentActor;
if (actor && actor.openedPopup) {
@@ -174,7 +171,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
handleEvent(evt) {
switch (evt.type) {
case "popupshowing": {
- this.sendAsyncMessage("FormAutoComplete:PopupOpened", {});
+ this.sendAsyncMessage("AutoComplete:PopupOpened", {});
break;
}
@@ -188,7 +185,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
selectedIndex != -1
? AutoCompleteResultView.getStyleAt(selectedIndex)
: "";
- this.sendAsyncMessage("FormAutoComplete:PopupClosed", {
+ this.sendAsyncMessage("AutoComplete:PopupClosed", {
selectedRowComment,
selectedRowStyle,
});
@@ -250,7 +247,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
// the scrollbar in login or form autofill popups.
if (
resultStyles.size &&
- (resultStyles.has("autofill-profile") || resultStyles.has("loginsFooter"))
+ (resultStyles.has("autofill") || resultStyles.has("loginsFooter"))
) {
this.openedPopup._normalMaxRows = this.openedPopup.maxRows;
this.openedPopup.mInput.maxRows = 10;
@@ -397,7 +394,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
}
switch (message.name) {
- case "FormAutoComplete:SetSelectedIndex": {
+ case "AutoComplete:SetSelectedIndex": {
let { index } = message.data;
if (this.openedPopup) {
this.openedPopup.selectedIndex = index;
@@ -405,7 +402,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
break;
}
- case "FormAutoComplete:MaybeOpenPopup": {
+ case "AutoComplete:MaybeOpenPopup": {
let { results, rect, dir, inputElementIdentifier, formOrigin } =
message.data;
if (lazy.DELEGATE_AUTOCOMPLETE) {
@@ -422,13 +419,13 @@ export class AutoCompleteParent extends JSWindowActorParent {
break;
}
- case "FormAutoComplete:Invalidate": {
+ case "AutoComplete:Invalidate": {
let { results } = message.data;
this.invalidate(results);
break;
}
- case "FormAutoComplete:ClosePopup": {
+ case "AutoComplete:ClosePopup": {
if (lazy.DELEGATE_AUTOCOMPLETE) {
lazy.GeckoViewAutocomplete.delegateDismiss();
break;
@@ -489,7 +486,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
*/
handleEnter(aIsPopupSelection) {
if (this.openedPopup) {
- this.sendAsyncMessage("FormAutoComplete:HandleEnter", {
+ this.sendAsyncMessage("AutoComplete:HandleEnter", {
selectedIndex: this.openedPopup.selectedIndex,
isPopupSelection: aIsPopupSelection,
});
@@ -507,7 +504,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
// disabled.
/*
if (this.openedPopup) {
- this.sendAsyncMessage("FormAutoComplete:Focus");
+ this.sendAsyncMessage("AutoComplete:Focus");
}
*/
}
diff --git a/toolkit/actors/AutoplayChild.sys.mjs b/toolkit/actors/AutoplayChild.sys.mjs
index 87fa966cb1..42bff87ea1 100644
--- a/toolkit/actors/AutoplayChild.sys.mjs
+++ b/toolkit/actors/AutoplayChild.sys.mjs
@@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
export class AutoplayChild extends JSWindowActorChild {
- handleEvent(event) {
+ handleEvent() {
this.sendAsyncMessage("GloballyAutoplayBlocked", {});
}
}
diff --git a/toolkit/actors/AutoplayParent.sys.mjs b/toolkit/actors/AutoplayParent.sys.mjs
index 3e9f807b3a..7b33c49c7f 100644
--- a/toolkit/actors/AutoplayParent.sys.mjs
+++ b/toolkit/actors/AutoplayParent.sys.mjs
@@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
export class AutoplayParent extends JSWindowActorParent {
- receiveMessage(aMessage) {
+ receiveMessage() {
let topBrowsingContext = this.manager.browsingContext.top;
let browser = topBrowsingContext.embedderElement;
let document = browser.ownerDocument;
diff --git a/toolkit/actors/ControllersParent.sys.mjs b/toolkit/actors/ControllersParent.sys.mjs
index 05ea166112..8461d76ba2 100644
--- a/toolkit/actors/ControllersParent.sys.mjs
+++ b/toolkit/actors/ControllersParent.sys.mjs
@@ -47,7 +47,7 @@ export class ControllersParent extends JSWindowActorParent {
this.sendAsyncMessage("ControllerCommands:Do", aCommand);
}
- getCommandStateWithParams(aCommand, aCommandParams) {
+ getCommandStateWithParams() {
throw Components.Exception("Not implemented", Cr.NS_ERROR_NOT_IMPLEMENTED);
}
diff --git a/toolkit/actors/NetErrorParent.sys.mjs b/toolkit/actors/NetErrorParent.sys.mjs
index ac0dbf49a0..071529976a 100644
--- a/toolkit/actors/NetErrorParent.sys.mjs
+++ b/toolkit/actors/NetErrorParent.sys.mjs
@@ -33,7 +33,7 @@ class CaptivePortalObserver {
Services.obs.removeObserver(this, "captive-portal-login-success");
}
- observe(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic) {
switch (aTopic) {
case "captive-portal-login-abort":
case "captive-portal-login-success":
@@ -172,7 +172,7 @@ export class NetErrorParent extends JSWindowActorParent {
request.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
request.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
- request.addEventListener("error", event => {
+ request.addEventListener("error", () => {
// Make sure the user is still on the cert error page.
if (!browser.documentURI.spec.startsWith("about:certerror")) {
return;
diff --git a/toolkit/actors/PictureInPictureChild.sys.mjs b/toolkit/actors/PictureInPictureChild.sys.mjs
index 2a415df32d..bffcb55e6d 100644
--- a/toolkit/actors/PictureInPictureChild.sys.mjs
+++ b/toolkit/actors/PictureInPictureChild.sys.mjs
@@ -947,11 +947,8 @@ export class PictureInPictureToggleChild extends JSWindowActorChild {
* tear out or in. If we happened to be tracking videos before the tear
* occurred, we re-add the mouse event listeners so that they're attached to
* the right WindowRoot.
- *
- * @param {Event} event The pageshow event fired when completing a tab tear
- * out or in.
*/
- onPageShow(event) {
+ onPageShow() {
let state = this.docState;
if (state.isTrackingVideos) {
this.addMouseButtonListeners();
@@ -963,11 +960,8 @@ export class PictureInPictureToggleChild extends JSWindowActorChild {
* tear out or in. If we happened to be tracking videos before the tear
* occurred, we remove the mouse event listeners. We'll re-add them when the
* pageshow event fires.
- *
- * @param {Event} event The pagehide event fired when starting a tab tear
- * out or in.
*/
- onPageHide(event) {
+ onPageHide() {
let state = this.docState;
if (state.isTrackingVideos) {
this.removeMouseButtonListeners();
@@ -1049,7 +1043,7 @@ export class PictureInPictureToggleChild extends JSWindowActorChild {
}
}
- startPictureInPicture(event, video, toggle) {
+ startPictureInPicture(event, video) {
Services.telemetry.keyedScalarAdd(
"pictureinpicture.opened_method",
"toggle",
@@ -2445,7 +2439,7 @@ export class PictureInPictureChild extends JSWindowActorChild {
}
}
- onCueChange(e) {
+ onCueChange() {
if (!lazy.DISPLAY_TEXT_TRACKS_PREF) {
this.updateWebVTTTextTracksDisplay(null);
} else {
@@ -3110,10 +3104,10 @@ class PictureInPictureChildVideoWrapper {
* a cue change is triggered {@see updatePiPTextTracks()}.
* @param {HTMLVideoElement} video
* The originating video source element
- * @param {Function} callback
+ * @param {Function} _callback
* The callback function to be executed when cue changes are detected
*/
- setCaptionContainerObserver(video, callback) {
+ setCaptionContainerObserver(video, _callback) {
return this.#callWrapperMethod({
name: "setCaptionContainerObserver",
args: [
diff --git a/toolkit/actors/PrintingChild.sys.mjs b/toolkit/actors/PrintingChild.sys.mjs
index 4fca3ab403..182784cfe7 100644
--- a/toolkit/actors/PrintingChild.sys.mjs
+++ b/toolkit/actors/PrintingChild.sys.mjs
@@ -94,7 +94,7 @@ export class PrintingChild extends JSWindowActorChild {
// will wait for MozAfterPaint event to be fired.
let actor = thisWindow.windowGlobalChild.getActor("Printing");
let webProgressListener = {
- onStateChange(webProgress, req, flags, status) {
+ onStateChange(webProgress, req, flags) {
if (flags & Ci.nsIWebProgressListener.STATE_STOP) {
webProgress.removeProgressListener(webProgressListener);
let domUtils = contentWindow.windowUtils;
diff --git a/toolkit/actors/SelectChild.sys.mjs b/toolkit/actors/SelectChild.sys.mjs
index 1bc80001ae..9901f72648 100644
--- a/toolkit/actors/SelectChild.sys.mjs
+++ b/toolkit/actors/SelectChild.sys.mjs
@@ -70,7 +70,7 @@ SelectContentHelper.prototype = {
mozSystemGroup: true,
});
let MutationObserver = this.element.ownerGlobal.MutationObserver;
- this.mut = new MutationObserver(mutations => {
+ this.mut = new MutationObserver(() => {
// Something changed the <select> while it was open, so
// we'll poke a DeferredTask to update the parent sometime
// in the very near future.
diff --git a/toolkit/actors/SelectParent.sys.mjs b/toolkit/actors/SelectParent.sys.mjs
index 5382b35ab3..fa8ce002f0 100644
--- a/toolkit/actors/SelectParent.sys.mjs
+++ b/toolkit/actors/SelectParent.sys.mjs
@@ -670,8 +670,9 @@ export var SelectParentHelper = {
if (!currentItem.hiddenByContent) {
// Get label and tooltip (title) from option and change to
// lower case for comparison
- let itemLabel = currentItem.getAttribute("label").toLowerCase();
- let itemTooltip = currentItem.getAttribute("title").toLowerCase();
+ let itemLabel = currentItem.getAttribute("label")?.toLowerCase() || "";
+ let itemTooltip =
+ currentItem.getAttribute("title")?.toLowerCase() || "";
// If search input is empty, all options should be shown
if (!input) {
diff --git a/toolkit/actors/UserCharacteristicsChild.sys.mjs b/toolkit/actors/UserCharacteristicsChild.sys.mjs
new file mode 100644
index 0000000000..da70c428e6
--- /dev/null
+++ b/toolkit/actors/UserCharacteristicsChild.sys.mjs
@@ -0,0 +1,28 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* 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 https://mozilla.org/MPL/2.0/. */
+
+const lazy = {};
+
+ChromeUtils.defineLazyGetter(lazy, "console", () => {
+ return console.createInstance({
+ prefix: "UserCharacteristicsPage",
+ maxLogLevelPref: "toolkit.telemetry.user_characteristics_ping.logLevel",
+ });
+});
+
+export class UserCharacteristicsChild extends JSWindowActorChild {
+ handleEvent(event) {
+ lazy.console.debug("Got ", event.type);
+ switch (event.type) {
+ case "UserCharacteristicsDataDone":
+ lazy.console.debug("creating IdleDispatch");
+ ChromeUtils.idleDispatch(() => {
+ lazy.console.debug("sending PageReady");
+ this.sendAsyncMessage("UserCharacteristics::PageReady", event.detail);
+ });
+ break;
+ }
+ }
+}
diff --git a/toolkit/actors/UserCharacteristicsParent.sys.mjs b/toolkit/actors/UserCharacteristicsParent.sys.mjs
new file mode 100644
index 0000000000..87405ebf4d
--- /dev/null
+++ b/toolkit/actors/UserCharacteristicsParent.sys.mjs
@@ -0,0 +1,34 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* 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 https://mozilla.org/MPL/2.0/. */
+
+import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
+
+const lazy = {};
+ChromeUtils.defineLazyGetter(lazy, "console", () => {
+ return console.createInstance({
+ prefix: "UserCharacteristicsPage",
+ maxLogLevelPref: "toolkit.telemetry.user_characteristics_ping.logLevel",
+ });
+});
+
+XPCOMUtils.defineLazyServiceGetter(
+ lazy,
+ "UserCharacteristicsPageService",
+ "@mozilla.org/user-characteristics-page;1",
+ "nsIUserCharacteristicsPageService"
+);
+
+export class UserCharacteristicsParent extends JSWindowActorParent {
+ receiveMessage(aMessage) {
+ lazy.console.debug("Got ", aMessage.name);
+ if (aMessage.name == "UserCharacteristics::PageReady") {
+ lazy.console.debug("Got pageReady");
+ lazy.UserCharacteristicsPageService.pageLoaded(
+ this.browsingContext,
+ aMessage.data
+ );
+ }
+ }
+}
diff --git a/toolkit/actors/ViewSourcePageChild.sys.mjs b/toolkit/actors/ViewSourcePageChild.sys.mjs
index d5c2ba46cd..ff8a046327 100644
--- a/toolkit/actors/ViewSourcePageChild.sys.mjs
+++ b/toolkit/actors/ViewSourcePageChild.sys.mjs
@@ -125,7 +125,7 @@ export class ViewSourcePageChild extends JSWindowActorChild {
* @param event
* The pageshow event being handled.
*/
- onPageShow(event) {
+ onPageShow() {
// If we need to draw the selection, wait until an actual view source page
// has loaded, instead of about:blank.
if (
diff --git a/toolkit/actors/moz.build b/toolkit/actors/moz.build
index 8e2d8a5efc..d0fda6c42f 100644
--- a/toolkit/actors/moz.build
+++ b/toolkit/actors/moz.build
@@ -75,6 +75,8 @@ FINAL_TARGET_FILES.actors += [
"UAWidgetsChild.sys.mjs",
"UnselectedTabHoverChild.sys.mjs",
"UnselectedTabHoverParent.sys.mjs",
+ "UserCharacteristicsChild.sys.mjs",
+ "UserCharacteristicsParent.sys.mjs",
"ViewSourceChild.sys.mjs",
"ViewSourcePageChild.sys.mjs",
"ViewSourcePageParent.sys.mjs",