summaryrefslogtreecommitdiffstats
path: root/toolkit/components/pictureinpicture
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/pictureinpicture')
-rw-r--r--toolkit/components/pictureinpicture/content/player.js14
-rw-r--r--toolkit/components/pictureinpicture/content/player.xhtml1
-rw-r--r--toolkit/components/pictureinpicture/tests/browser_cannotTriggerFromContent.js2
-rw-r--r--toolkit/components/pictureinpicture/tests/browser_closePip_pageNavigationChanges.js4
-rw-r--r--toolkit/components/pictureinpicture/tests/browser_preserveTabPipIconOverlay.js4
-rw-r--r--toolkit/components/pictureinpicture/tests/browser_removeVideoElement.js2
-rw-r--r--toolkit/components/pictureinpicture/tests/browser_reversePiP.js25
-rw-r--r--toolkit/components/pictureinpicture/tests/browser_touch_toggle_enablepip.js2
8 files changed, 35 insertions, 19 deletions
diff --git a/toolkit/components/pictureinpicture/content/player.js b/toolkit/components/pictureinpicture/content/player.js
index c60c2ca44e..d306494d92 100644
--- a/toolkit/components/pictureinpicture/content/player.js
+++ b/toolkit/components/pictureinpicture/content/player.js
@@ -45,7 +45,7 @@ const BOTTOM_LEFT_QUADRANT = 3;
const BOTTOM_RIGHT_QUADRANT = 4;
/**
- * Public function to be called from PictureInPicture.jsm. This is the main
+ * Public function to be called from PictureInPicture.sys.mjs. This is the main
* entrypoint for initializing the player window.
*
* @param {Number} id
@@ -61,7 +61,7 @@ function setupPlayer(id, wgp, videoRef) {
}
/**
- * Public function to be called from PictureInPicture.jsm. This update the
+ * Public function to be called from PictureInPicture.sys.mjs. This update the
* controls based on whether or not the video is playing.
*
* @param {Boolean} isPlaying
@@ -72,7 +72,7 @@ function setIsPlayingState(isPlaying) {
}
/**
- * Public function to be called from PictureInPicture.jsm. This update the
+ * Public function to be called from PictureInPicture.sys.mjs. This update the
* controls based on whether or not the video is muted.
*
* @param {Boolean} isMuted
@@ -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" });
},
diff --git a/toolkit/components/pictureinpicture/content/player.xhtml b/toolkit/components/pictureinpicture/content/player.xhtml
index 5b6892d649..9982bf35be 100644
--- a/toolkit/components/pictureinpicture/content/player.xhtml
+++ b/toolkit/components/pictureinpicture/content/player.xhtml
@@ -6,6 +6,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
windowtype="Toolkit:PictureInPicture"
+ macnativefullscreen="true"
chromemargin="0,0,0,0"
scrolling="false"
>
diff --git a/toolkit/components/pictureinpicture/tests/browser_cannotTriggerFromContent.js b/toolkit/components/pictureinpicture/tests/browser_cannotTriggerFromContent.js
index 4c3d32b474..1ba93dbb8c 100644
--- a/toolkit/components/pictureinpicture/tests/browser_cannotTriggerFromContent.js
+++ b/toolkit/components/pictureinpicture/tests/browser_cannotTriggerFromContent.js
@@ -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);
diff --git a/toolkit/components/pictureinpicture/tests/browser_closePip_pageNavigationChanges.js b/toolkit/components/pictureinpicture/tests/browser_closePip_pageNavigationChanges.js
index c64b5f2b14..b4615c42a1 100644
--- a/toolkit/components/pictureinpicture/tests/browser_closePip_pageNavigationChanges.js
+++ b/toolkit/components/pictureinpicture/tests/browser_closePip_pageNavigationChanges.js
@@ -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"
diff --git a/toolkit/components/pictureinpicture/tests/browser_preserveTabPipIconOverlay.js b/toolkit/components/pictureinpicture/tests/browser_preserveTabPipIconOverlay.js
index 55cd003a2c..b1296607f1 100644
--- a/toolkit/components/pictureinpicture/tests/browser_preserveTabPipIconOverlay.js
+++ b/toolkit/components/pictureinpicture/tests/browser_preserveTabPipIconOverlay.js
@@ -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);
};
diff --git a/toolkit/components/pictureinpicture/tests/browser_removeVideoElement.js b/toolkit/components/pictureinpicture/tests/browser_removeVideoElement.js
index d9622dc3f0..ece635fd34 100644
--- a/toolkit/components/pictureinpicture/tests/browser_removeVideoElement.js
+++ b/toolkit/components/pictureinpicture/tests/browser_removeVideoElement.js
@@ -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;
};
diff --git a/toolkit/components/pictureinpicture/tests/browser_reversePiP.js b/toolkit/components/pictureinpicture/tests/browser_reversePiP.js
index a8ae20166f..3f8b43b02b 100644
--- a/toolkit/components/pictureinpicture/tests/browser_reversePiP.js
+++ b/toolkit/components/pictureinpicture/tests/browser_reversePiP.js
@@ -53,8 +53,11 @@ add_task(async () => {
}
);
- // The "flipped" attribute should be set on the toggle button (when applicable).
- Assert.equal(toggleFlippedAttribute, "true");
+ Assert.equal(
+ toggleFlippedAttribute,
+ "",
+ `The "flipped" attribute should be set on the toggle button (when applicable).`
+ );
}
);
});
@@ -110,12 +113,20 @@ add_task(async () => {
let videoID = "reversed";
let videoFlippedAttribute = await getFlippedAttribute(browser, videoID);
- Assert.equal(videoFlippedAttribute, null); // The "flipped" attribute should not be set initially.
+ Assert.equal(
+ videoFlippedAttribute,
+ null,
+ `The "flipped" attribute should not be set initially.`
+ );
let pipWin = await triggerPictureInPicture(browser, videoID);
videoFlippedAttribute = await getFlippedAttribute(browser, "reversed");
- Assert.equal(videoFlippedAttribute, "true"); // The "flipped" value should be set once the PiP window is opened (when applicable).
+ Assert.equal(
+ videoFlippedAttribute,
+ "true",
+ `The "flipped" value should be set once the PiP window is opened (when applicable).`
+ );
let playerBrowser = pipWin.document.getElementById("browser");
let pipVideoTransform = await getPiPVideoTransform(playerBrowser);
@@ -124,7 +135,11 @@ add_task(async () => {
await ensureMessageAndClosePiP(browser, videoID, pipWin, false);
videoFlippedAttribute = await getFlippedAttribute(browser, "reversed");
- Assert.equal(videoFlippedAttribute, null); // The "flipped" attribute should be removed after closing PiP.
+ Assert.equal(
+ videoFlippedAttribute,
+ null,
+ `The "flipped" attribute should be removed after closing PiP.`
+ );
// Now we want to test that regular (not-reversed) videos are unaffected
videoID = "not-reversed";
diff --git a/toolkit/components/pictureinpicture/tests/browser_touch_toggle_enablepip.js b/toolkit/components/pictureinpicture/tests/browser_touch_toggle_enablepip.js
index e50c430d0c..46eebe1719 100644
--- a/toolkit/components/pictureinpicture/tests/browser_touch_toggle_enablepip.js
+++ b/toolkit/components/pictureinpicture/tests/browser_touch_toggle_enablepip.js
@@ -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"
);