Commit 93307450 authored by Mike Conley's avatar Mike Conley
Browse files

Bug 1536219 - Account for CSS scale factor when positioning Picture-in-Picture...

Bug 1536219 - Account for CSS scale factor when positioning Picture-in-Picture window. r=JSON_voorhees

Differential Revision: https://phabricator.services.mozilla.com/D25842

--HG--
extra : moz-landing-system : lando
parent 0ccb72a3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -116,6 +116,12 @@ var PictureInPicture = {
    screen.GetAvailRectDisplayPix(screenLeft, screenTop, screenWidth,
                                  screenHeight);

    // We have to divide these dimensions by the CSS scale factor for the
    // display in order for the video to be positioned correctly on displays
    // that are not at a 1.0 scaling.
    screenWidth.value = screenWidth.value / screen.defaultCSSScaleFactor;
    screenHeight.value = screenHeight.value / screen.defaultCSSScaleFactor;

    // For now, the Picture in Picture window will be a maximum of a quarter
    // of the screen height, and a third of the screen width.
    const MAX_HEIGHT = screenHeight.value / 4;