Loading browser/actors/ContextMenuChild.sys.mjs +4 −1 Original line number Diff line number Diff line Loading @@ -128,7 +128,10 @@ export class ContextMenuChild extends JSWindowActorChild { }, this.contentWindow ); media.dispatchEvent(event); this.contentWindow.windowUtils.dispatchEventToChromeOnly( media, event ); break; } } Loading toolkit/actors/PictureInPictureChild.sys.mjs +6 −3 Original line number Diff line number Diff line Loading @@ -182,7 +182,10 @@ export class PictureInPictureLauncherChild extends JSWindowActorChild { detail: { reason }, } ); video.dispatchEvent(stopPipEvent); this.contentWindow.windowUtils.dispatchEventToChromeOnly( video, stopPipEvent ); return; } Loading Loading @@ -673,7 +676,7 @@ export class PictureInPictureToggleChild extends JSWindowActorChild { detail: { reason: "urlBar" }, } ); video.dispatchEvent(pipEvent); this.contentWindow.windowUtils.dispatchEventToChromeOnly(video, pipEvent); } } Loading Loading @@ -1066,7 +1069,7 @@ export class PictureInPictureToggleChild extends JSWindowActorChild { detail: { reason: "toggle" }, } ); video.dispatchEvent(pipEvent); this.contentWindow.windowUtils.dispatchEventToChromeOnly(video, pipEvent); // Since we've initiated Picture-in-Picture, we can go ahead and // hide the toggle now. Loading toolkit/components/pictureinpicture/tests/click-event-helper.js +12 −5 Original line number Diff line number Diff line Loading @@ -2,13 +2,20 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ /** * This helper script is used to record mouse button events for * Picture-in-Picture toggle click tests. Anytime the toggle is * clicked, we expect none of the events to be fired. Otherwise, * all events should be fired when clicking. * This helper script is used to record events for Picture-in-Picture toggle * click tests. Anytime the toggle is clicked, we expect none of the events to * be fired. Otherwise, all (except MozTogglePictureInPicture) events should be * fired when clicking on web content. */ let eventTypes = ["pointerdown", "mousedown", "pointerup", "mouseup", "click"]; let eventTypes = [ "MozTogglePictureInPicture", "pointerdown", "mousedown", "pointerup", "mouseup", "click", ]; for (let event of eventTypes) { addEventListener(event, recordEvent, { capture: true }); Loading toolkit/components/pictureinpicture/tests/head.js +1 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ async function triggerPictureInPicture(browser, videoID, triggerFn) { let event = new content.CustomEvent("MozTogglePictureInPicture", { bubbles: true, }); video.dispatchEvent(event); content.windowUtils.dispatchEventToChromeOnly(video, event); await ContentTaskUtils.waitForCondition(() => { return video.isCloningElementVisually; }, "Video is being cloned visually."); Loading Loading
browser/actors/ContextMenuChild.sys.mjs +4 −1 Original line number Diff line number Diff line Loading @@ -128,7 +128,10 @@ export class ContextMenuChild extends JSWindowActorChild { }, this.contentWindow ); media.dispatchEvent(event); this.contentWindow.windowUtils.dispatchEventToChromeOnly( media, event ); break; } } Loading
toolkit/actors/PictureInPictureChild.sys.mjs +6 −3 Original line number Diff line number Diff line Loading @@ -182,7 +182,10 @@ export class PictureInPictureLauncherChild extends JSWindowActorChild { detail: { reason }, } ); video.dispatchEvent(stopPipEvent); this.contentWindow.windowUtils.dispatchEventToChromeOnly( video, stopPipEvent ); return; } Loading Loading @@ -673,7 +676,7 @@ export class PictureInPictureToggleChild extends JSWindowActorChild { detail: { reason: "urlBar" }, } ); video.dispatchEvent(pipEvent); this.contentWindow.windowUtils.dispatchEventToChromeOnly(video, pipEvent); } } Loading Loading @@ -1066,7 +1069,7 @@ export class PictureInPictureToggleChild extends JSWindowActorChild { detail: { reason: "toggle" }, } ); video.dispatchEvent(pipEvent); this.contentWindow.windowUtils.dispatchEventToChromeOnly(video, pipEvent); // Since we've initiated Picture-in-Picture, we can go ahead and // hide the toggle now. Loading
toolkit/components/pictureinpicture/tests/click-event-helper.js +12 −5 Original line number Diff line number Diff line Loading @@ -2,13 +2,20 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ /** * This helper script is used to record mouse button events for * Picture-in-Picture toggle click tests. Anytime the toggle is * clicked, we expect none of the events to be fired. Otherwise, * all events should be fired when clicking. * This helper script is used to record events for Picture-in-Picture toggle * click tests. Anytime the toggle is clicked, we expect none of the events to * be fired. Otherwise, all (except MozTogglePictureInPicture) events should be * fired when clicking on web content. */ let eventTypes = ["pointerdown", "mousedown", "pointerup", "mouseup", "click"]; let eventTypes = [ "MozTogglePictureInPicture", "pointerdown", "mousedown", "pointerup", "mouseup", "click", ]; for (let event of eventTypes) { addEventListener(event, recordEvent, { capture: true }); Loading
toolkit/components/pictureinpicture/tests/head.js +1 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ async function triggerPictureInPicture(browser, videoID, triggerFn) { let event = new content.CustomEvent("MozTogglePictureInPicture", { bubbles: true, }); video.dispatchEvent(event); content.windowUtils.dispatchEventToChromeOnly(video, event); await ContentTaskUtils.waitForCondition(() => { return video.isCloningElementVisually; }, "Video is being cloned visually."); Loading