Bug 1864896: Autofix unused function arguments (pip). r=pip-reviewers,kpatenio

Differential Revision: https://phabricator.services.mozilla.com/D202977
This commit is contained in:
Dave Townsend 2024-03-02 15:26:02 +00:00
Родитель d92190fa91
Коммит 59b829116d
31 изменённых файлов: 41 добавлений и 41 удалений

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

@ -25,7 +25,7 @@ this.pictureInPictureParent = class extends ExtensionAPI {
* @param {ExtensionContext} context the context of our extension
* @returns {object} returns the necessary API structure required to manage sharedData in PictureInPictureParent
*/
getAPI(context) {
getAPI() {
return {
pictureInPictureParent: {
setOverrides(overrides) {

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

@ -35,7 +35,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text = container?.querySelector("#overlayCaption").innerText;
if (!text) {

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let textNodeList = container.querySelectorAll(".avp-captions-line");
if (!textNodeList.length) {
updateCaptionsFunction("");

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text = container.querySelector(".p_cueDirUniWrapper")?.innerText;
updateCaptionsFunction(text);
};

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let textNodeList = container
?.querySelector(".subtitles")
?.querySelectorAll("div");

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

@ -41,7 +41,7 @@ class PictureInPictureVideoWrapper {
container = document.querySelector(".shaka-text-container");
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let textNodeList = container?.querySelectorAll("span");
if (!textNodeList) {
updateCaptionsFunction("");

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text = container.querySelector(
".closed-captions.is-visible"
)?.innerText;

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

@ -25,7 +25,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text = container.querySelector(
'[data-testid="CueBoxContainer"]'
)?.innerText;

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let textNodeList = container?.querySelectorAll("span");
if (!textNodeList) {
updateCaptionsFunction("");

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

@ -32,7 +32,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
// This will get the subtitles for both live and regular playback videos
// and combine them to display. liveVideoText should be an empty string
// when the video is regular playback and vice versa. If both
@ -63,7 +63,7 @@ class PictureInPictureVideoWrapper {
});
}
}
getDuration(video) {
getDuration() {
return this.player.duration;
}
}

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

@ -5,12 +5,12 @@
"use strict";
class PictureInPictureVideoWrapper {
play(video) {
play() {
let playPauseButton = document.querySelector("#player .play-pause-button");
playPauseButton.click();
}
pause(video) {
pause() {
let invalidSelector = "#player .pause-button";
let playPauseButton = document.querySelector(invalidSelector);
playPauseButton.click();

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

@ -25,7 +25,7 @@ class PictureInPictureVideoWrapper {
* @param {HTMLVideoElement} video The original video element
* @returns {number} The current time in seconds
*/
getCurrentTime(video) {
getCurrentTime() {
return this.player.getCurrentTime() / 1000;
}
/**
@ -35,7 +35,7 @@ class PictureInPictureVideoWrapper {
* @param {HTMLVideoElement} video The original video element
* @returns {number} The duration in seconds
*/
getDuration(video) {
getDuration() {
return this.player.getDuration() / 1000;
}
play() {
@ -50,7 +50,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text = container.querySelector(".player-timedtext").innerText;
updateCaptionsFunction(text);
};

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text = container.querySelector(".cueWrap-2P4Ue4VQ")?.innerText;
if (!text) {
updateCaptionsFunction("");

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let textNodeList = container
.querySelector(".shaka-text-wrapper")
?.querySelectorAll('span[style="background-color: black;"]');

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

@ -57,7 +57,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function (mutationsList) {
// eslint-disable-next-line no-unused-vars
for (const mutation of mutationsList) {
let text;

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text = container.querySelector(
`.text-track-wrapper:not([style*="display: none"])`
)?.innerText;

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text = container?.querySelector(
`[data-id="captionsComponent"]:not([style="display: none;"])`
)?.innerText;

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text =
container.querySelector(`.tubi-text-track-container`)?.innerText ||
container.querySelector(`.subtitleWindow`)?.innerText;

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

@ -5,7 +5,7 @@
"use strict";
class PictureInPictureVideoWrapper {
isLive(video) {
isLive() {
return !document.querySelector(".seekbar-bar");
}
getDuration(video) {

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

@ -37,7 +37,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text = container.querySelector(
`[data-purpose="captions-cue-text"]`
)?.innerText;

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

@ -11,7 +11,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text = container.querySelector("div").innerText;
if (!text) {
updateCaptionsFunction("");

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text = container.querySelector(".playkit-subtitles").innerText;
if (!text) {
updateCaptionsFunction("");

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let subtitleElement = container.querySelector(".powa-sub-torpedo");
if (!subtitleElement?.innerText) {
updateCaptionsFunction("");

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

@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function () {
let text = container.querySelector(".vp-cc-element.vp-show")?.innerText;
if (!text) {

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

@ -14,7 +14,7 @@ class PictureInPictureVideoWrapper {
? shortsPlayer
: video.closest("#movie_player")?.wrappedJSObject;
}
isLive(video) {
isLive() {
return !!document.querySelector(".ytp-live");
}
setMuted(video, shouldMute) {
@ -39,7 +39,7 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function (mutationsList, observer) {
const callback = function (mutationsList) {
// eslint-disable-next-line no-unused-vars
for (const mutation of mutationsList) {
let textNodeList = container

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

@ -247,10 +247,10 @@ let Player = {
this.audioScrubbing = true;
this.handleAudioScrubbing(event.target.value);
});
this.audioScrubber.addEventListener("change", event => {
this.audioScrubber.addEventListener("change", () => {
this.audioScrubbing = false;
});
this.audioScrubber.addEventListener("pointerdown", event => {
this.audioScrubber.addEventListener("pointerdown", () => {
if (this.isMuted) {
this.audioScrubber.max = 1;
}
@ -1140,7 +1140,7 @@ let Player = {
* @param {Event} event
* Event context data object
*/
onResize(event) {
onResize() {
this.toggleSubtitlesSettingsPanel({ forceHide: true });
this.resizeDebouncer.disarm();
this.resizeDebouncer.arm();
@ -1152,7 +1152,7 @@ let Player = {
* @param {Event} event
* Event context data object
*/
onCommand(event) {
onCommand() {
this.closePipWindow({ reason: "shortcut" });
},

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

@ -18,7 +18,7 @@ add_task(async () => {
// if we receive the PictureInPicture:Request message.
const MESSAGE = "PictureInPicture:Request";
let sawMessage = false;
let listener = msg => {
let listener = () => {
sawMessage = true;
};
browser.messageManager.addMessageListener(MESSAGE, listener);

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

@ -65,7 +65,7 @@ add_task(async function test_close_pagehide() {
ok(pipWin, "Got Picture-in-Picture window.");
let pipClosed = BrowserTestUtils.domWindowClosed(pipWin);
await SpecialPowers.spawn(browser, [{ videoID }], async args => {
await SpecialPowers.spawn(browser, [{ videoID }], async () => {
content.location.href = "otherpage.html";
});
@ -92,7 +92,7 @@ add_task(async function test_open_pip_window_history_nav() {
let pipWin = await triggerPictureInPicture(browser, videoID);
ok(pipWin, "Got Picture-in-Picture window.");
await SpecialPowers.spawn(browser, [{ videoID }], async args => {
await SpecialPowers.spawn(browser, [{ videoID }], async () => {
let popStatePromise = ContentTaskUtils.waitForEvent(
content,
"popstate"

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

@ -12,8 +12,8 @@ var EventUtils = {};
Services.scriptloader.loadSubScript(EVENTUTILS_URL, EventUtils);
async function detachTab(tab) {
let newWindowPromise = new Promise((resolve, reject) => {
let observe = (win, topic, data) => {
let newWindowPromise = new Promise(resolve => {
let observe = win => {
Services.obs.removeObserver(observe, "domwindowopened");
resolve(win);
};

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

@ -28,7 +28,7 @@ add_task(async () => {
let otherVideo = doc.querySelector(`video:not([id="${videoID}"])`);
let eventFired = false;
let listener = e => {
let listener = () => {
eventFired = true;
};

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

@ -30,7 +30,7 @@ add_task(async () => {
// Remove other page elements before reading PiP toggle's client rect.
// Otherwise, we will provide the wrong coordinates when simulating the touch event.
await SpecialPowers.spawn(browser, [], async args => {
await SpecialPowers.spawn(browser, [], async () => {
info(
"Removing other elements first to make the PiP toggle more visible"
);