Verified Commit 036aaa05 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

fixup! Bug 32308: Use direct browser sizing for letterboxing.

Restore our changes after backporting MozBug 1556002.
parent 4a33efb7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -53,8 +53,8 @@ function checkForDefaultSetting(
  aRealHeight
) {
  // We can get the rounded size by subtracting twice the margin.
  let targetWidth = aRealWidth - 2 * RFPHelper.steppedRange(aRealWidth, true);
  let targetHeight = aRealHeight - 2 * RFPHelper.steppedRange(aRealHeight);
  let targetWidth = aRealWidth - 2 * RFPHelper.steppedSize(aRealWidth, true);
  let targetHeight = aRealHeight - 2 * RFPHelper.steppedSize(aRealHeight);

  // This platform-specific code is explained in the large comment below.
  if (getPlatform() != "linux") {
+2 −5
Original line number Diff line number Diff line
@@ -522,7 +522,7 @@ class _RFPHelper {
  /**
   * Given a width or height, rounds it with the proper stepping.
   */
  steppedRange(aDimension, aIsWidth = false) {
  steppedSize(aDimension, aIsWidth = false) {
    let stepping;
    if (aDimension <= 50) {
      return 0;
@@ -607,10 +607,7 @@ class _RFPHelper {
      // If the set is empty, we will round the content with the default
      // stepping size.
      if (!this._letterboxingDimensions.length) {
        result = {
          width: this.steppedRange(aWidth, true),
          height: this.steppedRange(aHeight),
        };
        return r(this.steppedSize(aWidth, true), this.steppedSize(aHeight));
      }

      let matchingArea = aWidth * aHeight;