[tbb-commits] [Git][tpo/applications/tor-browser][tor-browser-128.3.0esr-14.0-1] Bug 1922204: fixup square spoofed orientation. r=tjr

morgan (@morgan) git at gitlab.torproject.org
Thu Oct 10 20:38:20 UTC 2024



morgan pushed to branch tor-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser


Commits:
61c5f500 by Fatih at 2024-10-10T09:43:32+02:00
Bug 1922204: fixup square spoofed orientation. r=tjr

Differential Revision: https://phabricator.services.mozilla.com/D224312
- - - - -


1 changed file:

- toolkit/components/resistfingerprinting/nsRFPService.cpp


Changes:

=====================================
toolkit/components/resistfingerprinting/nsRFPService.cpp
=====================================
@@ -2287,10 +2287,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;
@@ -2301,7 +2303,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;



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/61c5f5000b9eaf0bc46c71290c466562b8c5a8f4

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/61c5f5000b9eaf0bc46c71290c466562b8c5a8f4
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20241010/47778145/attachment-0001.htm>


More information about the tbb-commits mailing list