Commit 1e28f3fc authored by Fatih's avatar Fatih Committed by Pier Angelo Vendrame
Browse files

Bug 1922204: fixup square spoofed orientation. r=tjr

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


/* static */
/* static */
uint16_t nsRFPService::ViewportSizeToAngle(int32_t aWidth, int32_t aHeight) {
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
#ifdef MOZ_WIDGET_ANDROID
  bool neutral = aHeight >= aWidth;
  bool neutral = aHeight >= aWidth;
#else
#else
  bool neutral = aWidth >= aHeight;
  bool neutral = aWidth > aHeight;
#endif
#endif
  if (neutral) {
  if (neutral) {
    return 0;
    return 0;
@@ -2310,7 +2312,7 @@ uint16_t nsRFPService::ViewportSizeToAngle(int32_t aWidth, int32_t aHeight) {
/* static */
/* static */
dom::OrientationType nsRFPService::ViewportSizeToOrientationType(
dom::OrientationType nsRFPService::ViewportSizeToOrientationType(
    int32_t aWidth, int32_t aHeight) {
    int32_t aWidth, int32_t aHeight) {
  if (aWidth >= aHeight) {
  if (aWidth > aHeight) {
    return dom::OrientationType::Landscape_primary;
    return dom::OrientationType::Landscape_primary;
  }
  }
  return dom::OrientationType::Portrait_primary;
  return dom::OrientationType::Portrait_primary;