[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-153.1.0esr-16.0-1] Bug 2059471: Do not spoof screen orientation when it is locked. r=tjr



Title: GitLab

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

Commits:

  • 03e9a8f0
    by Pier Angelo Vendrame at 2026-08-24T13:43:42+00:00
    Bug 2059471: Do not spoof screen orientation when it is locked. r=tjr
    
    Differential Revision: https://phabricator.services.mozilla.com/D315317
    

1 changed file:

Changes:

  • dom/base/ScreenOrientation.cpp
    ... ... @@ -709,8 +709,11 @@ OrientationType ScreenOrientation::DeviceType(CallerType aCallerType) const {
    709 709
         if (!bc) {
    
    710 710
           return nsRFPService::GetDefaultOrientationType();
    
    711 711
         }
    
    712
    -    CSSIntSize size = bc->TopInnerSizeSpoofedForRFP();
    
    713
    -    return nsRFPService::ViewportSizeToOrientationType(size.width, size.height);
    
    712
    +    if (bc->GetOrientationLock() == hal::ScreenOrientation::None) {
    
    713
    +      CSSIntSize size = bc->TopInnerSizeSpoofedForRFP();
    
    714
    +      return nsRFPService::ViewportSizeToOrientationType(size.width,
    
    715
    +                                                         size.height);
    
    716
    +    }
    
    714 717
       }
    
    715 718
       return mType;
    
    716 719
     }
    
    ... ... @@ -723,8 +726,10 @@ uint16_t ScreenOrientation::DeviceAngle(CallerType aCallerType) const {
    723 726
         if (!bc) {
    
    724 727
           return 0;
    
    725 728
         }
    
    726
    -    CSSIntSize size = bc->TopInnerSizeSpoofedForRFP();
    
    727
    -    return nsRFPService::ViewportSizeToAngle(size.width, size.height);
    
    729
    +    if (bc->GetOrientationLock() == hal::ScreenOrientation::None) {
    
    730
    +      CSSIntSize size = bc->TopInnerSizeSpoofedForRFP();
    
    731
    +      return nsRFPService::ViewportSizeToAngle(size.width, size.height);
    
    732
    +    }
    
    728 733
       }
    
    729 734
       return mAngle;
    
    730 735
     }
    
    ... ... @@ -740,7 +745,8 @@ OrientationType ScreenOrientation::GetType(CallerType aCallerType,
    740 745
     
    
    741 746
       OrientationType orientation = bc->GetCurrentOrientationType();
    
    742 747
       if (nsContentUtils::ShouldResistFingerprinting(
    
    743
    -          aCallerType, GetRelevantGlobal(), RFPTarget::ScreenOrientation)) {
    
    748
    +          aCallerType, GetRelevantGlobal(), RFPTarget::ScreenOrientation) &&
    
    749
    +      bc->GetOrientationLock() == hal::ScreenOrientation::None) {
    
    744 750
         CSSIntSize size = bc->TopInnerSizeSpoofedForRFP();
    
    745 751
         return nsRFPService::ViewportSizeToOrientationType(size.width, size.height);
    
    746 752
       }
    
    ... ... @@ -758,7 +764,8 @@ uint16_t ScreenOrientation::GetAngle(CallerType aCallerType,
    758 764
     
    
    759 765
       uint16_t angle = static_cast<uint16_t>(bc->GetCurrentOrientationAngle());
    
    760 766
       if (nsContentUtils::ShouldResistFingerprinting(
    
    761
    -          aCallerType, GetRelevantGlobal(), RFPTarget::ScreenOrientation)) {
    
    767
    +          aCallerType, GetRelevantGlobal(), RFPTarget::ScreenOrientation) &&
    
    768
    +      bc->GetOrientationLock() == hal::ScreenOrientation::None) {
    
    762 769
         CSSIntSize size = bc->TopInnerSizeSpoofedForRFP();
    
    763 770
         return nsRFPService::ViewportSizeToAngle(size.width, size.height);
    
    764 771
       }
    

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx