Backed out 3 changesets (bug 1535437, bug 1591253) for causing browser_resizeVideo.js to permafail CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Thu, 14 Nov 2019 23:25:26 +0200
changeset 502033 96b4cb315770c2037cb2cee9c7ffd76ef252ed2b
parent 502032 289a3851e8c71110ffcb64425fef17a8cce04af9
child 502034 f7d3a6261cb34b81f7382a917069a4ed84e573a7
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1535437, 1591253
milestone72.0a1
backs outf7cc2f6d9640820f5278bbc7787ccae542e06e69
bc637c20c7d4c06835d3269e9a3558feacb6c28e
46b4eb05f2ae0122e9f7e3711d2470e47ef54e15
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 3 changesets (bug 1535437, bug 1591253) for causing browser_resizeVideo.js to permafail CLOSED TREE Backed out changeset f7cc2f6d9640 (bug 1591253) Backed out changeset bc637c20c7d4 (bug 1535437) Backed out changeset 46b4eb05f2ae (bug 1535437)
toolkit/actors/PictureInPictureChild.jsm
toolkit/components/pictureinpicture/PictureInPicture.jsm
toolkit/components/pictureinpicture/tests/browser.ini
toolkit/components/pictureinpicture/tests/browser_resizeVideo.js
toolkit/components/pictureinpicture/tests/head.js
toolkit/components/pictureinpicture/tests/test-video-cropped.mp4
toolkit/components/pictureinpicture/tests/test-video-vertical.mp4
widget/windows/nsWindow.cpp
--- a/toolkit/actors/PictureInPictureChild.jsm
+++ b/toolkit/actors/PictureInPictureChild.jsm
@@ -863,26 +863,16 @@ class PictureInPictureChild extends JSWi
 
         if (video.muted) {
           this.sendAsyncMessage("PictureInPicture:Muting");
         } else {
           this.sendAsyncMessage("PictureInPicture:Unmuting");
         }
         break;
       }
-      case "resize": {
-        let video = event.target;
-        if (this.inPictureInPicture(video)) {
-          this.sendAsyncMessage("PictureInPicture:Resize", {
-            videoHeight: video.videoHeight,
-            videoWidth: video.videoWidth,
-          });
-        }
-        break;
-      }
     }
   }
 
   /**
    * Returns a reference to the <video> element being displayed in Picture-in-Picture
    * mode.
    *
    * @return {Element} The <video> being displayed in Picture-in-Picture mode, or null
@@ -1049,34 +1039,32 @@ class PictureInPictureChild extends JSWi
    */
   trackOriginatingVideo(originatingVideo) {
     let originatingWindow = originatingVideo.ownerGlobal;
     if (originatingWindow) {
       originatingWindow.addEventListener("pagehide", this);
       originatingVideo.addEventListener("play", this);
       originatingVideo.addEventListener("pause", this);
       originatingVideo.addEventListener("volumechange", this);
-      originatingVideo.addEventListener("resize", this);
     }
   }
 
   /**
    * Stops tracking the originating video's document. This should
    * happen once the Picture-in-Picture window goes away (or is about
    * to go away), and we no longer care about hearing when the originating
    * window's document unloads.
    */
   untrackOriginatingVideo(originatingVideo) {
     let originatingWindow = originatingVideo.ownerGlobal;
     if (originatingWindow) {
       originatingWindow.removeEventListener("pagehide", this);
       originatingVideo.removeEventListener("play", this);
       originatingVideo.removeEventListener("pause", this);
       originatingVideo.removeEventListener("volumechange", this);
-      originatingVideo.removeEventListener("resize", this);
     }
   }
 
   /**
    * Runs in an instance of PictureInPictureChild for the
    * player window's content, and not the originating video
    * content. Sets up the player so that it clones the originating
    * video. If anything goes wrong during set up, a message is
--- a/toolkit/components/pictureinpicture/PictureInPicture.jsm
+++ b/toolkit/components/pictureinpicture/PictureInPicture.jsm
@@ -65,21 +65,16 @@ class PictureInPictureParent extends JSW
     let browser = browsingContext.top.embedderElement;
 
     switch (aMessage.name) {
       case "PictureInPicture:Request": {
         let videoData = aMessage.data;
         PictureInPicture.handlePictureInPictureRequest(browser, videoData);
         break;
       }
-      case "PictureInPicture:Resize": {
-        let videoData = aMessage.data;
-        PictureInPicture.resizePictureInPictureWindow(videoData);
-        break;
-      }
       case "PictureInPicture:Close": {
         /**
          * Content has requested that its Picture in Picture window go away.
          */
         let reason = aMessage.data.reason;
         PictureInPicture.closePipWindow({ reason });
         break;
       }
@@ -271,21 +266,101 @@ var PictureInPicture = {
    *
    *   videoWidth (int):
    *     The preferred width of the video.
    *
    * @returns Promise
    *   Resolves once the window has opened and loaded the player component.
    */
   async openPipWindow(parentWin, videoData) {
-    let { top, left, width, height } = this.fitToScreen(parentWin, videoData);
+    let { videoHeight, videoWidth } = videoData;
+
+    // The Picture in Picture window will open on the same display as the
+    // originating window, and anchor to the bottom right.
+    let screenManager = Cc["@mozilla.org/gfx/screenmanager;1"].getService(
+      Ci.nsIScreenManager
+    );
+    let screen = screenManager.screenForRect(
+      parentWin.screenX,
+      parentWin.screenY,
+      1,
+      1
+    );
+
+    // Now that we have the right screen, let's see how much available
+    // real-estate there is for us to work with.
+    let screenLeft = {},
+      screenTop = {},
+      screenWidth = {},
+      screenHeight = {};
+    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;
+    const MAX_WIDTH = screenWidth.value / 3;
+
+    let resultWidth = videoWidth;
+    let resultHeight = videoHeight;
 
+    if (videoHeight > MAX_HEIGHT || videoWidth > MAX_WIDTH) {
+      let aspectRatio = videoWidth / videoHeight;
+      // We're bigger than the max - take the largest dimension and clamp
+      // it to the associated max. Recalculate the other dimension to maintain
+      // aspect ratio.
+      if (videoWidth >= videoHeight) {
+        // We're clamping the width, so the height must be adjusted to match
+        // the original aspect ratio. Since aspect ratio is width over height,
+        // that means we need to _divide_ the MAX_WIDTH by the aspect ratio to
+        // calculate the appropriate height.
+        resultWidth = MAX_WIDTH;
+        resultHeight = Math.round(MAX_WIDTH / aspectRatio);
+      } else {
+        // We're clamping the height, so the width must be adjusted to match
+        // the original aspect ratio. Since aspect ratio is width over height,
+        // this means we need to _multiply_ the MAX_HEIGHT by the aspect ratio
+        // to calculate the appropriate width.
+        resultHeight = MAX_HEIGHT;
+        resultWidth = Math.round(MAX_HEIGHT * aspectRatio);
+      }
+    }
+
+    // Now that we have the dimensions of the video, we need to figure out how
+    // to position it in the bottom right corner. Since we know the width of the
+    // available rect, we need to subtract the dimensions of the window we're
+    // opening to get the top left coordinates that openWindow expects.
+    //
+    // In event that the user has multiple displays connected, we have to
+    // calculate the top-left coordinate of the new window in absolute
+    // coordinates that span the entire display space, since this is what the
+    // openWindow expects for its top and left feature values.
+    //
+    // The screenWidth and screenHeight values only tell us the available
+    // dimensions on the screen that the parent window is on. We add these to
+    // the screenLeft and screenTop values, which tell us where this screen is
+    // located relative to the "origin" in absolute coordinates.
+    let isRTL = Services.locale.isAppLocaleRTL;
+    let pipLeft = isRTL
+      ? screenLeft.value
+      : screenLeft.value + screenWidth.value - resultWidth;
+    let pipTop = screenTop.value + screenHeight.value - resultHeight;
     let features =
-      `${PLAYER_FEATURES},top=${top},left=${left},` +
-      `outerWidth=${width},outerHeight=${height}`;
+      `${PLAYER_FEATURES},top=${pipTop},left=${pipLeft},` +
+      `outerWidth=${resultWidth},outerHeight=${resultHeight}`;
 
     let pipWindow = Services.ww.openWindow(
       parentWin,
       PLAYER_URI,
       null,
       features,
       null
     );
@@ -304,201 +379,16 @@ var PictureInPicture = {
         () => {
           resolve(pipWindow);
         },
         { once: true }
       );
     });
   },
 
-  /**
-   * Calculate the desired size and position for a Picture in Picture window
-   * for the provided window and videoData.
-   *
-   * @param windowOrPlayer (chrome window|player window)
-   *   The window hosting the browser that requested the Picture in
-   *   Picture window. If this is an existing player window then the returned
-   *   player size and position will be determined based on the existing
-   *   player window's size and position.
-   *
-   * @param videoData (object)
-   *   An object containing the following properties:
-   *
-   *   videoHeight (int):
-   *     The preferred height of the video.
-   *
-   *   videoWidth (int):
-   *     The preferred width of the video.
-   *
-   * @returns object
-   *   The size and position for the player window.
-   *
-   *   top (int):
-   *     The top position for the player window.
-   *
-   *   left (int):
-   *     The left position for the player window.
-   *
-   *   width (int):
-   *     The width of the player window.
-   *
-   *   height (int):
-   *     The height of the player window.
-   */
-  fitToScreen(windowOrPlayer, videoData) {
-    let { videoHeight, videoWidth } = videoData;
-    let isPlayerWindow = windowOrPlayer == this.getWeakPipPlayer();
-
-    // The Picture in Picture window will open on the same display as the
-    // originating window, and anchor to the bottom right.
-    let screenManager = Cc["@mozilla.org/gfx/screenmanager;1"].getService(
-      Ci.nsIScreenManager
-    );
-    let screen = screenManager.screenForRect(
-      windowOrPlayer.screenX,
-      windowOrPlayer.screenY,
-      1,
-      1
-    );
-
-    // Now that we have the right screen, let's see how much available
-    // real-estate there is for us to work with.
-    let screenLeft = {},
-      screenTop = {},
-      screenWidth = {},
-      screenHeight = {};
-    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;
-
-    // If we have a player window, maintain the previous player window's size by
-    // clamping the new video's largest dimension to the player window's
-    // largest dimension.
-    //
-    // Otherwise the Picture in Picture window will be a maximum of a quarter of
-    // the screen height, and a third of the screen width.
-    let preferredSize;
-    if (isPlayerWindow) {
-      let prevWidth = windowOrPlayer.innerWidth;
-      let prevHeight = windowOrPlayer.innerHeight;
-      preferredSize = prevWidth >= prevHeight ? prevWidth : prevHeight;
-    }
-    const MAX_HEIGHT = preferredSize || screenHeight.value / 4;
-    const MAX_WIDTH = preferredSize || screenWidth.value / 3;
-
-    let width = videoWidth;
-    let height = videoHeight;
-    let aspectRatio = videoWidth / videoHeight;
-
-    if (
-      videoHeight > MAX_HEIGHT ||
-      videoWidth > MAX_WIDTH ||
-      (isPlayerWindow && videoHeight < MAX_HEIGHT && videoWidth < MAX_WIDTH)
-    ) {
-      // We're bigger than the max, or smaller than the previous player window.
-      // Take the largest dimension and clamp it to the associated max.
-      // Recalculate the other dimension to maintain aspect ratio.
-      if (videoWidth >= videoHeight) {
-        // We're clamping the width, so the height must be adjusted to match
-        // the original aspect ratio. Since aspect ratio is width over height,
-        // that means we need to _divide_ the MAX_WIDTH by the aspect ratio to
-        // calculate the appropriate height.
-        width = MAX_WIDTH;
-        height = Math.round(MAX_WIDTH / aspectRatio);
-      } else {
-        // We're clamping the height, so the width must be adjusted to match
-        // the original aspect ratio. Since aspect ratio is width over height,
-        // this means we need to _multiply_ the MAX_HEIGHT by the aspect ratio
-        // to calculate the appropriate width.
-        height = MAX_HEIGHT;
-        width = Math.round(MAX_HEIGHT * aspectRatio);
-      }
-    }
-
-    // Figure out where to position the window on screen. If we have a player
-    // window this will account for any change in video size. Otherwise the
-    // video will be positioned in the bottom right.
-
-    if (isPlayerWindow) {
-      // We might need to move the window to keep its positioning in a similar
-      // part of the screen.
-      //
-      // Find the distance from each edge of the screen of the old video, we'll
-      // keep the closest edge in the same spot.
-      let prevWidth = windowOrPlayer.innerWidth;
-      let prevHeight = windowOrPlayer.innerHeight;
-      let distanceLeft = windowOrPlayer.screenX;
-      let distanceRight =
-        screenWidth.value - windowOrPlayer.screenX - prevWidth;
-      let distanceTop = windowOrPlayer.screenY;
-      let distanceBottom =
-        screenHeight.value - windowOrPlayer.screenY - prevHeight;
-
-      let left = windowOrPlayer.screenX;
-      let top = windowOrPlayer.screenY;
-
-      if (distanceRight < distanceLeft) {
-        // Closer to the right edge than the left. Move the window right by
-        // the difference in the video widths.
-        left += prevWidth - width;
-      }
-
-      if (distanceBottom < distanceTop) {
-        // Closer to the bottom edge than the top. Move the window down by
-        // the difference in the video heights.
-        top += prevHeight - height;
-      }
-
-      return { top, left, width, height };
-    }
-
-    // Now that we have the dimensions of the video, we need to figure out how
-    // to position it in the bottom right corner. Since we know the width of the
-    // available rect, we need to subtract the dimensions of the window we're
-    // opening to get the top left coordinates that openWindow expects.
-    //
-    // In event that the user has multiple displays connected, we have to
-    // calculate the top-left coordinate of the new window in absolute
-    // coordinates that span the entire display space, since this is what the
-    // openWindow expects for its top and left feature values.
-    //
-    // The screenWidth and screenHeight values only tell us the available
-    // dimensions on the screen that the parent window is on. We add these to
-    // the screenLeft and screenTop values, which tell us where this screen is
-    // located relative to the "origin" in absolute coordinates.
-    let isRTL = Services.locale.isAppLocaleRTL;
-    let left = isRTL
-      ? screenLeft.value
-      : screenLeft.value + screenWidth.value - width;
-    let top = screenTop.value + screenHeight.value - height;
-
-    return { top, left, width, height };
-  },
-
-  resizePictureInPictureWindow(videoData) {
-    let win = this.getWeakPipPlayer();
-
-    if (!win) {
-      return;
-    }
-
-    let { top, left, width, height } = this.fitToScreen(win, videoData);
-    win.resizeTo(width, height);
-    win.moveTo(left, top);
-  },
-
   openToggleContextMenu(window, data) {
     let document = window.document;
     let popup = document.getElementById("pictureInPictureToggleContextMenu");
 
     // We synthesize a new MouseEvent to propagate the inputSource to the
     // subsequently triggered popupshowing event.
     let newEvent = document.createEvent("MouseEvent");
     newEvent.initNSMouseEvent(
--- a/toolkit/components/pictureinpicture/tests/browser.ini
+++ b/toolkit/components/pictureinpicture/tests/browser.ini
@@ -5,37 +5,33 @@ support-files =
   test-button-overlay.html
   test-opaque-overlay.html
   test-page.html
   test-page-with-iframe.html
   test-pointer-events-none.html
   test-transparent-overlay-1.html
   test-transparent-overlay-2.html
   test-video.mp4
-  test-video-cropped.mp4
-  test-video-vertical.mp4
 
 prefs =
   media.videocontrols.picture-in-picture.enabled=true
   media.videocontrols.picture-in-picture.video-toggle.enabled=true
   media.videocontrols.picture-in-picture.video-toggle.testing=true
   media.videocontrols.picture-in-picture.video-toggle.always-show=true
 
 [browser_cannotTriggerFromContent.js]
 [browser_contextMenu.js]
 [browser_closeTab.js]
-[browser_disabledForMediaStreamVideos.js]
+[browser_disabledForMediaStreamVideos.js]
 [browser_fullscreen.js]
 skip-if = (os == "mac" && debug) #Bug 1566173
 [browser_mouseButtonVariation.js]
 skip-if = debug
 [browser_removeVideoElement.js]
 [browser_rerequestPiP.js]
-[browser_resizeVideo.js]
-skip-if = os == 'linux' # Bug 1594223
 [browser_showMessage.js]
 [browser_stripVideoStyles.js]
 [browser_thirdPartyIframe.js]
 skip-if = fission # Bug 1576915
 [browser_toggleAfterTabTearOutIn.js]
 [browser_toggleButtonOverlay.js]
 skip-if = true # Bug 1546455
 [browser_toggleOnInsertedVideo.js]
deleted file mode 100644
--- a/toolkit/components/pictureinpicture/tests/browser_resizeVideo.js
+++ /dev/null
@@ -1,249 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-/**
- * Run the resize test on a player window.
- *
- * @param browser (xul:browser)
- *   The browser that has the source video.
- *
- * @param videoID (string)
- *   The id of the video in the browser to test.
- *
- * @param pipWin (player window)
- *   A player window to run the tests on.
- *
- * @param opts (object)
- *   The options for the test.
- *
- *   pinX (boolean):
- *     If true, the video's X position shouldn't change when resized.
- *
- *   pinY (boolean):
- *     If true, the video's Y position shouldn't change when resized.
- */
-async function testVideo(browser, videoID, pipWin, { pinX, pinY } = {}) {
-  async function switchVideoSource(src) {
-    let videoResized = BrowserTestUtils.waitForEvent(pipWin, "resize");
-    await ContentTask.spawn(
-      browser,
-      { src, videoID },
-      async ({ src, videoID }) => {
-        let doc = content.document;
-        let video = doc.getElementById(videoID);
-        video.src = src;
-      }
-    );
-    await videoResized;
-  }
-
-  /**
-   * Check the new screen position against the previous one. When
-   * pinX or pinY is true then the top left corner is checked in that
-   * dimension. Otherwise, the bottom right corner is checked.
-   *
-   * The video position is determined by the screen edge it's closest
-   * to, so in the default bottom right its bottom right corner should
-   * match the previous video's bottom right corner. For the top left,
-   * the top left corners should match.
-   */
-  function checkPosition(
-    previousScreenX,
-    previousScreenY,
-    previousWidth,
-    previousHeight,
-    newScreenX,
-    newScreenY,
-    newWidth,
-    newHeight
-  ) {
-    if (pinX) {
-      Assert.equal(
-        previousScreenX,
-        newScreenX,
-        "New video is still in the same X position"
-      );
-    } else {
-      Assert.equal(
-        previousScreenX + previousWidth,
-        newScreenX + newWidth,
-        "New video ends at the same screen X position"
-      );
-    }
-    if (pinY) {
-      Assert.equal(
-        previousScreenY,
-        newScreenY,
-        "New video is still in the same Y position"
-      );
-    } else {
-      Assert.equal(
-        previousScreenY + previousHeight,
-        newScreenY + newHeight,
-        "New video ends at the same screen Y position"
-      );
-    }
-  }
-
-  Assert.ok(pipWin, "Got PiP window.");
-
-  let initialWidth = pipWin.innerWidth;
-  let initialHeight = pipWin.innerHeight;
-  let initialAspectRatio = initialWidth / initialHeight;
-  Assert.equal(
-    Math.floor(initialAspectRatio * 100),
-    177, // 16 / 9 = 1.777777777
-    "Original aspect ratio is 16:9"
-  );
-
-  // Store the window position for later.
-  let initialScreenX = pipWin.mozInnerScreenX;
-  let initialScreenY = pipWin.mozInnerScreenY;
-
-  await switchVideoSource("test-video-cropped.mp4");
-
-  let resizedWidth = pipWin.innerWidth;
-  let resizedHeight = pipWin.innerHeight;
-  let resizedAspectRatio = resizedWidth / resizedHeight;
-  Assert.equal(
-    Math.floor(resizedAspectRatio * 100),
-    133, // 4 / 3 = 1.333333333
-    "Resized aspect ratio is 4:3"
-  );
-  Assert.equal(initialWidth, resizedWidth, "Resized video has the same width");
-  Assert.greater(resizedHeight, initialHeight, "Resized video grew vertically");
-
-  let resizedScreenX = pipWin.mozInnerScreenX;
-  let resizedScreenY = pipWin.mozInnerScreenY;
-  checkPosition(
-    initialScreenX,
-    initialScreenY,
-    initialWidth,
-    initialHeight,
-    resizedScreenX,
-    resizedScreenY,
-    resizedWidth,
-    resizedHeight
-  );
-
-  await switchVideoSource("test-video-vertical.mp4");
-
-  let verticalWidth = pipWin.innerWidth;
-  let verticalHeight = pipWin.innerHeight;
-  let verticalAspectRatio = verticalWidth / verticalHeight;
-  Assert.equal(
-    Math.floor(verticalAspectRatio * 100),
-    50, // 1 / 2 = 0.5
-    "Vertical aspect ratio is 1:2"
-  );
-  Assert.less(verticalWidth, resizedWidth, "Vertical video width shrunk");
-  Assert.equal(
-    resizedWidth,
-    verticalHeight,
-    "Vertical video height matches previous width"
-  );
-
-  let verticalScreenX = pipWin.mozInnerScreenX;
-  let verticalScreenY = pipWin.mozInnerScreenY;
-  checkPosition(
-    resizedScreenX,
-    resizedScreenY,
-    resizedWidth,
-    resizedHeight,
-    verticalScreenX,
-    verticalScreenY,
-    verticalWidth,
-    verticalHeight
-  );
-
-  await switchVideoSource("test-video.mp4");
-
-  let restoredWidth = pipWin.innerWidth;
-  let restoredHeight = pipWin.innerHeight;
-  let restoredAspectRatio = restoredWidth / restoredHeight;
-  Assert.equal(
-    Math.floor(restoredAspectRatio * 100),
-    177,
-    "Restored aspect ratio is still 16:9"
-  );
-  Assert.equal(
-    initialWidth,
-    pipWin.innerWidth,
-    "Restored video has its original width"
-  );
-  Assert.equal(
-    initialHeight,
-    pipWin.innerHeight,
-    "Restored video has its original height"
-  );
-
-  let restoredScreenX = pipWin.mozInnerScreenX;
-  let restoredScreenY = pipWin.mozInnerScreenY;
-  checkPosition(
-    initialScreenX,
-    initialScreenY,
-    initialWidth,
-    initialHeight,
-    restoredScreenX,
-    restoredScreenY,
-    restoredWidth,
-    restoredHeight
-  );
-}
-
-/**
- * Tests that if a <video> element is resized the Picture-in-Picture window
- * will be resized to match the new dimensions.
- */
-add_task(async () => {
-  for (let videoID of ["with-controls", "no-controls"]) {
-    info(`Testing ${videoID} case.`);
-
-    await BrowserTestUtils.withNewTab(
-      {
-        url: TEST_PAGE,
-        gBrowser,
-      },
-      async browser => {
-        let pipWin = await triggerPictureInPicture(browser, videoID);
-
-        await testVideo(browser, videoID, pipWin);
-
-        pipWin.moveTo(0, 0);
-
-        await testVideo(browser, videoID, pipWin, { pinX: true, pinY: true });
-
-        await BrowserTestUtils.closeWindow(pipWin);
-      }
-    );
-  }
-});
-
-/**
- * Tests that the RTL video starts on the left and is pinned in the X dimension.
- */
-add_task(async () => {
-  await SpecialPowers.pushPrefEnv({ set: [["intl.l10n.pseudo", "bidi"]] });
-
-  for (let videoID of ["with-controls", "no-controls"]) {
-    info(`Testing ${videoID} case.`);
-
-    await BrowserTestUtils.withNewTab(
-      {
-        url: TEST_PAGE,
-        gBrowser,
-      },
-      async browser => {
-        let pipWin = await triggerPictureInPicture(browser, videoID);
-
-        await testVideo(browser, videoID, pipWin, { pinX: true });
-
-        await BrowserTestUtils.closeWindow(pipWin);
-      }
-    );
-  }
-
-  await SpecialPowers.popPrefEnv();
-});
--- a/toolkit/components/pictureinpicture/tests/head.js
+++ b/toolkit/components/pictureinpicture/tests/head.js
@@ -41,17 +41,16 @@ async function triggerPictureInPicture(b
     });
     video.dispatchEvent(event);
     await ContentTaskUtils.waitForCondition(() => {
       return video.isCloningElementVisually;
     }, "Video is being cloned visually.");
   });
   let win = await domWindowOpened;
   await BrowserTestUtils.waitForEvent(win, "load");
-  await win.promiseDocumentFlushed(() => {});
   await videoReady;
   return win;
 }
 
 /**
  * Given a browser and the ID for a <video> element, checks that the
  * video is showing the "This video is playing in Picture-in-Picture mode."
  * status message overlay.
deleted file mode 100644
index 6ea66eb1fcbeae5101631a3c5b0f474ca11105c4..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 404eec6fd08ee021c548b1729f157a684238ca24..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -1840,20 +1840,18 @@ void nsWindow::Resize(double aWidth, dou
     UINT flags = SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE;
 
     if (!aRepaint) {
       flags |= SWP_NOREDRAW;
     }
 
     ClearThemeRegion();
     double oldScale = mDefaultScale;
-    mResizeState = RESIZING;
     VERIFY(
         ::SetWindowPos(mWnd, nullptr, 0, 0, width, GetHeight(height), flags));
-    mResizeState = NOT_RESIZING;
     if (WinUtils::LogToPhysFactor(mWnd) != oldScale) {
       ChangedDPI();
     }
     SetThemeRegion();
   }
 
   if (aRepaint) Invalidate();
 
@@ -1891,20 +1889,18 @@ void nsWindow::Resize(double aX, double 
   if (mWnd) {
     UINT flags = SWP_NOZORDER | SWP_NOACTIVATE;
     if (!aRepaint) {
       flags |= SWP_NOREDRAW;
     }
 
     ClearThemeRegion();
     double oldScale = mDefaultScale;
-    mResizeState = RESIZING;
     VERIFY(
         ::SetWindowPos(mWnd, nullptr, x, y, width, GetHeight(height), flags));
-    mResizeState = NOT_RESIZING;
     if (WinUtils::LogToPhysFactor(mWnd) != oldScale) {
       ChangedDPI();
     }
     if (mTransitionWnd) {
       // If we have a fullscreen transition window, we need to make
       // it topmost again, otherwise the taskbar may be raised by
       // the system unexpectedly when we leave fullscreen state.
       ::SetWindowPos(mTransitionWnd, HWND_TOPMOST, 0, 0, 0, 0,