Bug 1864896: Autofix unused function arguments (widget). r=spohl

Differential Revision: https://phabricator.services.mozilla.com/D203001
This commit is contained in:
Dave Townsend 2024-03-02 15:25:59 +00:00
Родитель 418e53f33c
Коммит 34f00cfba5
17 изменённых файлов: 26 добавлений и 26 удалений

Просмотреть файл

@ -22,7 +22,7 @@ registerCleanupFunction(() => {
const progressListeners = new Map(); const progressListeners = new Map();
function loadContentWindow(windowlessBrowser, uri) { function loadContentWindow(windowlessBrowser, uri) {
return new Promise((resolve, reject) => { return new Promise(resolve => {
let loadURIOptions = { let loadURIOptions = {
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(), triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
}; };
@ -46,7 +46,7 @@ function loadContentWindow(windowlessBrowser, uri) {
progressListeners.delete(progressListener); progressListeners.delete(progressListener);
contentWindow.addEventListener( contentWindow.addEventListener(
"load", "load",
event => { () => {
resolve(contentWindow); resolve(contentWindow);
}, },
{ once: true } { once: true }

Просмотреть файл

@ -63,7 +63,7 @@ async function clipboardAsyncGetData(aBrowser, aClipboardType) {
"nsIAsyncClipboardGetCallback", "nsIAsyncClipboardGetCallback",
]), ]),
// nsIAsyncClipboardGetCallback // nsIAsyncClipboardGetCallback
onSuccess: aAsyncGetClipboardData => { onSuccess: () => {
resolve(); resolve();
}, },
onError: aResult => { onError: aResult => {

Просмотреть файл

@ -1131,7 +1131,7 @@ add_task(async () => {
// Set up an APZ aware event listener and... // Set up an APZ aware event listener and...
await SpecialPowers.spawn(tab.linkedBrowser, [], async () => { await SpecialPowers.spawn(tab.linkedBrowser, [], async () => {
content.document.documentElement.addEventListener("wheel", e => {}, { content.document.documentElement.addEventListener("wheel", () => {}, {
passive: false, passive: false,
}); });
await content.wrappedJSObject.promiseApzFlushedRepaints(); await content.wrappedJSObject.promiseApzFlushedRepaints();

Просмотреть файл

@ -94,7 +94,7 @@ clipboardTypes.forEach(function (type) {
() => { () => {
ok(false, "asyncClipboardRequestGetData should not success"); ok(false, "asyncClipboardRequestGetData should not success");
}, },
e => { () => {
ok(true, "asyncClipboardRequestGetData should reject"); ok(true, "asyncClipboardRequestGetData should reject");
} }
); );
@ -133,7 +133,7 @@ clipboardTypes.forEach(function (type) {
() => { () => {
ok(false, "asyncClipboardRequestGetData should not success"); ok(false, "asyncClipboardRequestGetData should not success");
}, },
e => { () => {
ok(true, "asyncClipboardRequestGetData should reject"); ok(true, "asyncClipboardRequestGetData should reject");
} }
); );

Просмотреть файл

@ -141,13 +141,13 @@
let popupShowingFired = false; let popupShowingFired = false;
let itemActivated = false; let itemActivated = false;
menupopup.addEventListener("popupshowing", function (e) { menupopup.addEventListener("popupshowing", function () {
popupShowingFired = true; popupShowingFired = true;
let menuitem = document.createElementNS(XUL_NS, "menuitem"); let menuitem = document.createElementNS(XUL_NS, "menuitem");
menuitem.setAttribute("label", "detached menu item"); menuitem.setAttribute("label", "detached menu item");
/* eslint-disable-next-line no-shadow */ /* eslint-disable-next-line no-shadow */
menuitem.addEventListener("command", function (e) { menuitem.addEventListener("command", function () {
itemActivated = true; itemActivated = true;
}) })
menupopup.appendChild(menuitem); menupopup.appendChild(menuitem);

Просмотреть файл

@ -30,7 +30,7 @@ SimpleTest.waitForExplicitFinish();
var idleObserver = var idleObserver =
{ {
QueryInterface: ChromeUtils.generateQI(["nsIObserver"]), QueryInterface: ChromeUtils.generateQI(["nsIObserver"]),
observe: function _observe(subject, topic, data) observe: function _observe(subject, topic)
{ {
if (topic != "idle") if (topic != "idle")
return; return;

Просмотреть файл

@ -20,7 +20,7 @@ function testClipboardOwner(aClipboardType, aAsync) {
const clipboardOwner = { const clipboardOwner = {
QueryInterface: ChromeUtils.generateQI(["nsIClipboardOwner"]), QueryInterface: ChromeUtils.generateQI(["nsIClipboardOwner"]),
// nsIClipboardOwner // nsIClipboardOwner
LosingOwnership(aTransferable) { LosingOwnership() {
losingOwnership = true; losingOwnership = true;
}, },
}; };

Просмотреть файл

@ -60,7 +60,7 @@ async function process_contextmenu_event({ isMousedown, preventEvent }) {
is(count++, 1, "The second event is contextmenu"); is(count++, 1, "The second event is contextmenu");
e.preventDefault(); e.preventDefault();
}, { once: true }); }, { once: true });
target.addEventListener("mouseup", e => { target.addEventListener("mouseup", () => {
is(count++, 2, "The third event is mouseup"); is(count++, 2, "The third event is mouseup");
resolve(); resolve();
}, { once: true} ); }, { once: true} );

Просмотреть файл

@ -38,7 +38,7 @@ add_task(async function test_modify_contenteditable_on_focused_element() {
const div2 = document.getElementById("div2"); const div2 = document.getElementById("div2");
const div3 = document.getElementById("div3"); const div3 = document.getElementById("div3");
div1.addEventListener("mousedown", e => { div1.addEventListener("mousedown", () => {
div2.contentEditable = true; div2.contentEditable = true;
}); });
div3.addEventListener("mousedown", e => { div3.addEventListener("mousedown", e => {

Просмотреть файл

@ -96,7 +96,7 @@ function runTestPasswordFieldOnDialog() {
WindowObserver.prototype = { WindowObserver.prototype = {
QueryInterface: ChromeUtils.generateQI(["nsIObserver"]), QueryInterface: ChromeUtils.generateQI(["nsIObserver"]),
observe(subject, topic, data) { observe(subject, topic) {
if (topic === "domwindowopened") { if (topic === "domwindowopened") {
ok(true, "dialog window is created"); ok(true, "dialog window is created");
dialog = subject; dialog = subject;

Просмотреть файл

@ -24,7 +24,7 @@
var gKeyPressEventCount = 0; var gKeyPressEventCount = 0;
var gKeyDownEventCount = 0; var gKeyDownEventCount = 0;
function onKeyDown(e) function onKeyDown()
{ {
gKeyDownEventCount++; gKeyDownEventCount++;
} }

Просмотреть файл

@ -4802,7 +4802,7 @@ function* runAccessKeyTests()
var button = document.getElementById("button"); var button = document.getElementById("button");
var activationCount; var activationCount;
function onClick(e) function onClick()
{ {
++activationCount; ++activationCount;
} }

Просмотреть файл

@ -292,7 +292,7 @@
aElement.id + ": Incorrect selection end"); aElement.id + ": Incorrect selection end");
} }
function* testRun(aElement, aSelectionCheck, aCallback) { function* testRun(aElement, aSelectionCheck) {
if (document.activeElement) { if (document.activeElement) {
document.activeElement.blur(); document.activeElement.blur();
} }

Просмотреть файл

@ -31,7 +31,7 @@ const kAsyncChanges = kIsLinux || kIsMacOS;
let gSizeModeDidChange = false; let gSizeModeDidChange = false;
let gSizeModeDidChangeTo = 0; let gSizeModeDidChangeTo = 0;
function sizemodeChanged(e) { function sizemodeChanged() {
gSizeModeDidChange = true; gSizeModeDidChange = true;
gSizeModeDidChangeTo = gWindow.windowState; gSizeModeDidChangeTo = gWindow.windowState;
} }

Просмотреть файл

@ -177,7 +177,7 @@ function fireWheelScrollEvent(aForward)
}, window); }, window);
} }
function onScrollView(aEvent) function onScrollView()
{ {
if (gIgnoreScrollEvent) if (gIgnoreScrollEvent)
return; return;
@ -187,7 +187,7 @@ function onScrollView(aEvent)
gTimer = setTimeout(runNextTest, 0); gTimer = setTimeout(runNextTest, 0);
} }
function onMouseScrollFailed(aEvent) function onMouseScrollFailed()
{ {
clearTimer(); clearTimer();
gIgnoreScrollEvent = true; gIgnoreScrollEvent = true;
@ -197,7 +197,7 @@ function onMouseScrollFailed(aEvent)
runNextTest(); runNextTest();
} }
function onTransactionTimeout(aEvent) function onTransactionTimeout()
{ {
if (!gTimer) if (!gTimer)
return; return;

Просмотреть файл

@ -6270,7 +6270,7 @@ function runQueryContentEventRelativeToInsertionPoint()
synthesizeComposition({ type: "compositioncommitasis" }); synthesizeComposition({ type: "compositioncommitasis" });
// Move start of composition at first compositionupdate event. // Move start of composition at first compositionupdate event.
function onCompositionUpdate(aEvent) function onCompositionUpdate()
{ {
startOffset = textarea.selectionStart = textarea.selectionEnd = textarea.selectionStart - 1; startOffset = textarea.selectionStart = textarea.selectionEnd = textarea.selectionStart - 1;
textarea.removeEventListener("compositionupdate", onCompositionUpdate); textarea.removeEventListener("compositionupdate", onCompositionUpdate);

Просмотреть файл

@ -214,7 +214,7 @@ var gPreparingSteps = [
target: gP1, x: 10, y: 10, window, target: gP1, x: 10, y: 10, window,
modifiers: 0, modifiers: 0,
additionalFlags: 0, additionalFlags: 0,
onLineScrollEvent(aEvent) { onLineScrollEvent() {
return true; return true;
}, },
onPixelScrollEvent(aEvent) { onPixelScrollEvent(aEvent) {
@ -234,7 +234,7 @@ var gPreparingSteps = [
target: gP1, x: 10, y: 10, window, target: gP1, x: 10, y: 10, window,
modifiers: 0, modifiers: 0,
additionalFlags: 0, additionalFlags: 0,
onLineScrollEvent(aEvent) { onLineScrollEvent() {
return true; return true;
}, },
onPixelScrollEvent(aEvent) { onPixelScrollEvent(aEvent) {
@ -250,7 +250,7 @@ var gPreparingSteps = [
target: gP1, x: 10, y: 10, window, target: gP1, x: 10, y: 10, window,
modifiers: 0, modifiers: 0,
additionalFlags: 0, additionalFlags: 0,
onLineScrollEvent(aEvent) { onLineScrollEvent() {
return true; return true;
}, },
onPixelScrollEvent(aEvent) { onPixelScrollEvent(aEvent) {
@ -270,7 +270,7 @@ var gPreparingSteps = [
target: gP1, x: 10, y: 10, window, target: gP1, x: 10, y: 10, window,
modifiers: 0, modifiers: 0,
additionalFlags: 0, additionalFlags: 0,
onLineScrollEvent(aEvent) { onLineScrollEvent() {
return true; return true;
}, },
onPixelScrollEvent(aEvent) { onPixelScrollEvent(aEvent) {
@ -1100,7 +1100,7 @@ var gDeactiveWindowTests = [
SpecialPowers.setIntPref(kVAmountPref, 3); SpecialPowers.setIntPref(kVAmountPref, 3);
SpecialPowers.setIntPref(kHAmountPref, 3); SpecialPowers.setIntPref(kHAmountPref, 3);
}, },
onLineScrollEvent(aEvent) { onLineScrollEvent() {
var fm = Services.focus; var fm = Services.focus;
is(fm.activeWindow, gOtherWindow, "The other window isn't activated"); is(fm.activeWindow, gOtherWindow, "The other window isn't activated");
}, },