Commit 7a62d59b authored by Fatih's avatar Fatih Committed by Beatriz Rizental
Browse files

Bug 1922204: fixup square spoofed orientation. r=tjr

parent 19e8483c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2296,10 +2296,12 @@ Maybe<RFPTarget> nsRFPService::GetOverriddenFingerprintingSettingsForURI(

/* static */
uint16_t nsRFPService::ViewportSizeToAngle(int32_t aWidth, int32_t aHeight) {
  // Note that, if screen is square, we return portrait-primary.
  // That's why we use > on non-android and >= on Android.
#ifdef MOZ_WIDGET_ANDROID
  bool neutral = aHeight >= aWidth;
#else
  bool neutral = aWidth >= aHeight;
  bool neutral = aWidth > aHeight;
#endif
  if (neutral) {
    return 0;
@@ -2310,7 +2312,7 @@ uint16_t nsRFPService::ViewportSizeToAngle(int32_t aWidth, int32_t aHeight) {
/* static */
dom::OrientationType nsRFPService::ViewportSizeToOrientationType(
    int32_t aWidth, int32_t aHeight) {
  if (aWidth >= aHeight) {
  if (aWidth > aHeight) {
    return dom::OrientationType::Landscape_primary;
  }
  return dom::OrientationType::Portrait_primary;