Skip to content
This repository was archived by the owner on Aug 4, 2022. It is now read-only.

Commit d80d466

Browse files
committed
Bug 1582502 - Don't interpret a click at 0,0 of a fullscreen video as a click on the Picture-in-Picture toggle. r=JSON_voorhees
We weren't handling the case where the toggle has no dimensions, so its X and Y coordinate would be at 0,0, which would match a click in the top-left corner of the screen for a video that was fullscreened. This adds a check that ensures that the toggle has both width and height before checking whether or not a mouse event occurred within it. Differential Revision: https://phabricator.services.mozilla.com/D47789
1 parent 94c3243 commit d80d466

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

toolkit/actors/PictureInPictureChild.jsm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,14 @@ class PictureInPictureToggleChild extends ActorChild {
664664
let toggleRect = toggle.ownerGlobal.windowUtils.getBoundsWithoutFlushing(
665665
toggle
666666
);
667+
668+
// If the toggle has no dimensions, we're definitely not over it.
669+
if (!toggleRect.width || !toggleRect.height) {
670+
return false;
671+
}
672+
667673
let { clientX, clientY } = event;
674+
668675
return (
669676
clientX >= toggleRect.left &&
670677
clientX <= toggleRect.right &&

0 commit comments

Comments
 (0)